Slackbot
02/15/2023, 12:29 PMJavi
02/15/2023, 12:31 PM./gradlew build --dry-run?ephemient
02/15/2023, 12:32 PMproto is a java-library, api can consume its classes and resources without going through proto:assembleAlon Eitan
02/15/2023, 12:32 PM14:32:16: Executing 'clean build --dry-run'...
:clean SKIPPED
:api:clean SKIPPED
:proto:clean SKIPPED
:server:clean SKIPPED
:assemble SKIPPED
:spotlessCheck SKIPPED
:test SKIPPED
:proto:extractIncludeProto SKIPPED
:proto:extractProto SKIPPED
:proto:generateProto SKIPPED
:proto:compileJava SKIPPED
:proto:processResources SKIPPED
:api:extractIncludeProto SKIPPED
:api:extractProto SKIPPED
:api:generateProto SKIPPED
:api:compileJava SKIPPED
:api:processResources SKIPPED
:api:classes SKIPPED
:api:sourcesJar SKIPPED
:api:jar SKIPPED
:api:assemble SKIPPED
:api:findDuplicates SKIPPED
:spotlessInternalRegisterDependencies SKIPPED
:api:spotlessJava SKIPPED
:api:spotlessJavaCheck SKIPPED
:api:spotlessKotlin SKIPPED
:api:spotlessKotlinCheck SKIPPED
:api:spotlessCheck SKIPPED
:api:extractIncludeTestProto SKIPPED
:api:extractTestProto SKIPPED
:api:generateTestProto SKIPPED
:api:compileTestJava SKIPPED
:api:processTestResources SKIPPED
:api:testClasses SKIPPED
:proto:classes SKIPPED
:proto:sourcesJar SKIPPED
:proto:jar SKIPPED
:api:test SKIPPED
:api:verifyBreakingChanges SKIPPED
:api:verifyCyclicDependencies SKIPPED
:api:verifyDeniedModules SKIPPED
:api:verifyMajorVersion SKIPPED
:api:verifyDependencies SKIPPED
:api:check SKIPPED
:proto:assemble SKIPPED
:proto:findDuplicates SKIPPED
:proto:spotlessJava SKIPPED
:proto:spotlessJavaCheck SKIPPED
:proto:spotlessKotlin SKIPPED
:proto:spotlessKotlinCheck SKIPPED
:proto:spotlessCheck SKIPPED
:proto:extractIncludeTestProto SKIPPED
:proto:extractTestProto SKIPPED
:proto:generateTestProto SKIPPED
:proto:compileTestJava SKIPPED
:proto:processTestResources SKIPPED
:proto:testClasses SKIPPED
:proto:test SKIPPED
:proto:verifyBreakingChanges SKIPPED
:proto:verifyCyclicDependencies SKIPPED
:proto:verifyDeniedModules SKIPPED
:proto:verifyMajorVersion SKIPPED
:proto:verifyDependencies SKIPPED
:proto:check SKIPPED
:server:compileJava SKIPPED
:server:processResources SKIPPED
:server:classes SKIPPED
:server:sourcesJar SKIPPED
:server:jar SKIPPED
:server:assemble SKIPPED
:server:findDuplicates SKIPPED
:server:spotlessJava SKIPPED
:server:spotlessJavaCheck SKIPPED
:server:spotlessKotlin SKIPPED
:server:spotlessKotlinCheck SKIPPED
:server:spotlessCheck SKIPPED
:server:compileTestJava SKIPPED
:server:processTestResources SKIPPED
:server:testClasses SKIPPED
:server:test SKIPPED
:server:verifyBreakingChanges SKIPPED
:server:verifyCyclicDependencies SKIPPED
:server:verifyDeniedModules SKIPPED
:server:verifyMajorVersion SKIPPED
:server:verifyDependencies SKIPPED
:server:check SKIPPED
:gateOnAllTests SKIPPED
:api:jacocoTestReport SKIPPED
:proto:jacocoTestReport SKIPPED
:server:jacocoTestReport SKIPPED
:jacocoMerge SKIPPED
:jacocoTestReport SKIPPED
:check SKIPPED
:build SKIPPED
:api:build SKIPPED
:proto:build SKIPPED
:server:build SKIPPED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See <https://docs.gradle.org/7.4/userguide/command_line_interface.html#sec:command_line_warnings>
BUILD SUCCESSFUL in 196ms
14:32:17: Execution finished 'clean build --dry-run'.ephemient
02/15/2023, 12:33 PMephemient
02/15/2023, 12:34 PMAlon Eitan
02/15/2023, 12:36 PMAlon Eitan
02/15/2023, 12:37 PMfindDuplicates which examines the contents of the jars files to check whether there are files with the same name in all the different jarsephemient
02/15/2023, 12:38 PM:api:assemble doesn't depend on :proto:assemble, it depends on :proto:classes etc.Alon Eitan
02/15/2023, 12:38 PMfindDuplicates is run?Alon Eitan
02/15/2023, 12:39 PM:api:findDuplicates is run before :proto:assembleephemient
02/15/2023, 12:39 PMephemient
02/15/2023, 12:39 PMAlon Eitan
02/15/2023, 12:40 PMfindDuplicates task cares about the jar files because that is its source of information to examine whether there are duplicate file namesAlon Eitan
02/15/2023, 12:40 PMephemient
02/15/2023, 12:42 PMAlon Eitan
02/15/2023, 12:42 PMfindDuplicates task:
@SuppressWarnings("LogAndThrow")
private Set<ArtifactFile> readJarEntries(ResolvedArtifact artifact) {
try (ZipFile zip = new ZipFile(artifact.getFile())) {
return zip.stream()
.filter(e -> !e.isDirectory())
.filter(e -> !e.getName().startsWith("META-INF/"))
.map(e -> new ArtifactFile(e.getName(), artifact, e.getCrc()))
.collect(Collectors.toSet());
} catch (IOException e) {
if (!artifact.getFile().exists()) {
throw new GradleException(
"The jar "
+ artifact.getFile().toString()
+ " doesn't exist.\n Run `./gradlew build` to generate all of the project's jars.",
e);
}
throw new GradleException("Error while opening jar '" + artifact.getFile() + "'", e);
}
}Alon Eitan
02/15/2023, 12:43 PMartifact represents a jar fileephemient
02/15/2023, 12:43 PMreadJarEntries, and with what valuesAlon Eitan
02/15/2023, 12:44 PMconfiguration.getResolvedConfiguration().getResolvedArtifacts().stream()
.filter(a -> !a.getFile().toString().endsWith(".exe"))
.filter(a -> !shouldIgnoreJar(a.getModuleVersion().toString()))Alon Eitan
02/15/2023, 12:44 PMephemient
02/15/2023, 12:51 PMAlon Eitan
02/15/2023, 12:53 PMephemient
02/15/2023, 12:53 PMtasks.register("foo") {
inputs.files(configurations.runtimeClasspath)
}
will cause gradle to build those jars, because you're asking for themephemient
02/15/2023, 12:53 PMAlon Eitan
02/15/2023, 12:53 PM:api:findDuplicates only depends on :api:assembleephemient
02/15/2023, 12:54 PMAlon Eitan
02/15/2023, 12:54 PM:proto:assemble then?ephemient
02/15/2023, 12:54 PMephemient
02/15/2023, 12:55 PMAlon Eitan
02/15/2023, 1:01 PMinputs.files code segment. now I understand this is your recommendation how to rewrite the task properlyAlon Eitan
02/15/2023, 1:01 PMAlon Eitan
02/15/2023, 1:02 PMtask.getInputs().files(project.getConfigurations().named("runtimeClasspath"));
I think this will work, trying it out nowJavi
02/15/2023, 1:04 PMapi:assemble is ran before proto:assembleAlon Eitan
02/15/2023, 1:05 PMephemient
02/15/2023, 1:07 PMassemble (or build) at the root doesn't force any particular order of the assemble of subprojects, and there is no dependency between api:assemble and proto:assemble as I mentioned up at the startJavi
02/15/2023, 3:27 PMephemient
02/15/2023, 3:46 PM