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 26, 2024
1 parent 16956ca commit 2f803cf
Showing 1 changed file with 6 additions and 12 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

0 comments on commit 2f803cf

Please sign in to comment.