use of org.jboss.pnc.bacon.pig.impl.pnc.PncBuild in project bacon by project-ncl.
the class JavadocManager method init.
private void init() {
this.temporaryDestination = FileUtils.mkTempDir("javadoc");
this.settingsXml = Indy.getConfiguredIndySettingsXmlPath(this.tempBuild);
this.localRepo = new File(temporaryDestination + File.separator + "localRepo");
this.localRepo.mkdir();
this.topLevelDirectory = new File(temporaryDestination, getTargetTopLevelDirectoryName());
this.archiveFile = getTargetZipPath().toFile();
this.generationProject = generationData.getGenerationProject();
this.sourceBuilds = generationData.getSourceBuilds();
if (this.sourceBuilds == null || this.sourceBuilds.isEmpty()) {
this.sourceBuilds = builds.values().stream().map(PncBuild::getName).collect(Collectors.toList());
}
this.scmRevision = generationData.getScmRevision();
}
use of org.jboss.pnc.bacon.pig.impl.pnc.PncBuild in project bacon by project-ncl.
the class BomVerifierAddon method getDependencyGavs.
protected Stream<GAV> getDependencyGavs() {
PncBuild build = builds.get(pigConfiguration.getFlow().getRepositoryGeneration().getSourceBuild());
File bom = new File("bom");
build.findArtifactByFileName(pigConfiguration.getFlow().getRepositoryGeneration().getSourceArtifact()).downloadTo(bom);
List<Node> nodeList = listNodes(bom, "//dependencies/dependency");
Map<String, String> properties = XmlUtils.getProperties(bom);
return nodeList.stream().map(node -> GAV.fromXml((Element) node, properties));
}
use of org.jboss.pnc.bacon.pig.impl.pnc.PncBuild in project bacon by project-ncl.
the class NotYetAlignedFromDependencyTree method trigger.
@Override
public void trigger() {
String filename = extrasPath + "DependencyTreeMissingAlignment.txt";
log.info("Running NotYetAlignedFromDependencyTree - report is {}", filename);
try (PrintWriter file = new PrintWriter(filename, StandardCharsets.UTF_8.name())) {
for (PncBuild build : builds.values()) {
// Make a unique list so we don't get multiples from
// sub-module's dependency tree list
List<String> bcLog = build.getBuildLog().stream().distinct().collect(Collectors.toList());
file.print("-------- [" + build.getId() + "] " + build.getName() + " --------\n");
for (String bcLine : bcLog) {
if (bcLine.startsWith("[INFO] +") && (bcLine.endsWith(":runtime") || bcLine.endsWith(":compile")) && !bcLine.contains("redhat-")) {
file.print(bcLine + "\n");
}
}
file.print("\n");
}
} catch (FileNotFoundException | UnsupportedEncodingException e) {
log.error("Error while creating NotYetAlignedFromDependencyTree report", e);
}
}
use of org.jboss.pnc.bacon.pig.impl.pnc.PncBuild in project bacon by project-ncl.
the class DeliverableManager method downloadAndRepackage.
protected ResultType downloadAndRepackage() {
PncBuild build = getBuild(getGenerationData().getSourceBuild());
File downloadedZip = new File(workDir, "downloaded.zip");
build.downloadArtifact(getGenerationData().getSourceArtifact(), downloadedZip);
File extractedZip = unzip(downloadedZip);
File downloadedTopLevelDirectory = getTopLevelDirectory(extractedZip);
File targetTopLevelDirectory = new File(workDir, getTargetTopLevelDirectoryName());
targetTopLevelDirectory.mkdirs();
repackage(downloadedTopLevelDirectory, targetTopLevelDirectory);
zip(targetTopLevelDirectory, getTargetZipPath());
return null;
}
use of org.jboss.pnc.bacon.pig.impl.pnc.PncBuild in project bacon by project-ncl.
the class EmptyProjectBuildTest method shouldReturnPreviousBuildsOnRebuild.
@Test
void shouldReturnPreviousBuildsOnRebuild(@TempDir Path targetDir) {
String suffix = init(Paths.get("src", "test", "resources", "empty"), true, Optional.empty(), targetDir);
PigFacade.configure(true, false);
GroupBuildInfo build = PigFacade.build(false, false, RebuildMode.EXPLICIT_DEPENDENCY_CHECK, true, false);
Map<String, PncBuild> builds = build.getBuilds();
assertThat(builds).isNotEmpty();
assertThat(builds.keySet()).contains(format(emptyNameBase1, suffix), format(emptyNameBase2, suffix));
assertThat(builds.values().stream()).allMatch(b -> b.getBuildStatus() == BuildStatus.SUCCESS);
List<String> successfulBuilds = buildIds(build);
GroupBuildInfo rebuild = PigFacade.build(false, false, RebuildMode.EXPLICIT_DEPENDENCY_CHECK, true, false);
assertThat(buildIds(rebuild)).containsAll(successfulBuilds);
}
Aggregations