Skip to content

Commit

Permalink
Generate dependency list for Develocity consumption
Browse files Browse the repository at this point in the history
We used to build the hashes ourselves but it's best to use the
Develocity infrastructure for that.

Fixes quarkusio#39256
  • Loading branch information
gsmet committed Jun 27, 2024
1 parent edb58b5 commit 95d720b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import java.util.Collections;
import java.util.List;
import java.util.Properties;
import java.util.zip.Adler32;
import java.util.zip.Checksum;

import org.apache.maven.plugin.MojoExecutionException;
Expand Down Expand Up @@ -148,24 +147,19 @@ protected void doExecute() throws MojoExecutionException, MojoFailureException {
}

if (dumpDependencies) {
final List<String> deps = new ArrayList<>();
final List<Path> deps = new ArrayList<>();
for (var d : curatedApplication.getApplicationModel().getDependencies(DependencyFlags.DEPLOYMENT_CP)) {
StringBuilder entry = new StringBuilder(d.toGACTVString());
if (d.isSnapshot()) {
var adler32 = new Adler32();
updateChecksum(adler32, d.getResolvedPaths());
entry.append(" ").append(adler32.getValue());
for (Path resolvedPath : d.getResolvedPaths()) {
deps.add(resolvedPath.toAbsolutePath());
}

deps.add(entry.toString());
}
Collections.sort(deps);
final Path targetFile = getOutputFile(dependenciesFile, launchMode.getDefaultProfile(),
"-dependency-checksums.txt");
"-dependencies.txt");
Files.createDirectories(targetFile.getParent());
try (BufferedWriter writer = Files.newBufferedWriter(targetFile)) {
for (var s : deps) {
writer.write(s);
for (var dep : deps) {
writer.write(dep.toString());
writer.newLine();
}
}
Expand Down
5 changes: 3 additions & 2 deletions docs/src/main/asciidoc/config-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -744,8 +744,9 @@ It will log the changed options and save the current values of each of the optio

==== Dump Quarkus application dependencies

In addition to dumping configuration values, `track-config-changes` goal also dumps all the Quarkus application dependencies, including Quarkus build time dependencies, along with their checksums (Adler32). This file could be used to check whether Quarkus build classpath has changed since the previous run.
By default, the dependency checksums will be stored under `target/quarkus-prod-dependency-checksums.txt` file. A different location could be configured using plugin parameters.
In addition to dumping configuration values, `track-config-changes` goal also dumps all the Quarkus application dependencies, including Quarkus build time dependencies.
This file could be used to check whether Quarkus build classpath has changed since the previous run, for instance together with Develocity's ability to checksum a classpath.
By default, the list of dependencies will be stored under `target/quarkus-prod-dependencies.txt` file. A different location could be configured using plugin parameters.

==== Dump current build configuration when the recorded configuration isn't found

Expand Down

0 comments on commit 95d720b

Please sign in to comment.