use of org.jboss.pnc.bacon.pig.impl.PigContext in project bacon by project-ncl.
the class QuarkusCommunityDepAnalyzerTest method test.
@Test
@Disabled
void test() {
File tempFolder = Files.newTemporaryFolder();
System.out.println(tempFolder.getAbsolutePath());
File extras = new File(tempFolder, "extras");
extras.mkdir();
RepositoryData repositoryData = new RepositoryData();
repositoryData.setRepositoryPath(Paths.get(REPO_ZIP_PATH));
PigContext context = new PigContext();
PigConfiguration pigConfig = new PigConfiguration();
Flow flow = new Flow();
RepoGenerationData repositoryGeneration = new RepoGenerationData();
repositoryGeneration.setBomArtifactId("quarkus-bom");
flow.setRepositoryGeneration(repositoryGeneration);
pigConfig.setFlow(flow);
Map<String, Map<String, ?>> addons = new HashMap<>();
Map<String, Object> depAnalyzerConfig = new HashMap<>();
depAnalyzerConfig.put("skippedExtensions", asList("quarkus-resteasy-reactive-kotlin", "quarkus-mongodb-client"));
addons.put(QuarkusCommunityDepAnalyzer.NAME, depAnalyzerConfig);
pigConfig.setAddons(addons);
context.setPigConfiguration(pigConfig);
context.setRepositoryData(repositoryData);
PigContext.setInstance(context);
Config instance = new Config();
ConfigProfile configProfile = new ConfigProfile();
PigConfig pig = new PigConfig();
pig.setIndyUrl(INDY_URL);
configProfile.setPig(pig);
DaConfig da = new DaConfig();
da.setUrl(DA_URL);
configProfile.setDa(da);
instance.setActiveProfile(configProfile);
Config.setInstance(instance);
QuarkusCommunityDepAnalyzer analyzer = new QuarkusCommunityDepAnalyzer(pigConfig, Collections.emptyMap(), tempFolder.getAbsolutePath(), extras.getAbsolutePath(), new Deliverables());
analyzer.trigger();
}
use of org.jboss.pnc.bacon.pig.impl.PigContext in project bacon by project-ncl.
the class ResolveOnlyRepositoryTest method mockPigContextAndMethods.
private void mockPigContextAndMethods() {
PigContext pigContext = Mockito.mock(PigContext.class);
doReturn(false).when(pigContext).isTempBuild();
MockedStatic<PigContext> pigContextMockedStatic = Mockito.mockStatic(PigContext.class);
pigContextMockedStatic.when(PigContext::get).thenReturn(pigContext);
}
use of org.jboss.pnc.bacon.pig.impl.PigContext in project bacon by project-ncl.
the class PigFacade method generateJavadoc.
public static void generateJavadoc() {
abortIfContextDataAbsent();
PigContext context = context();
context.getDeliverables().setJavadocZipName(context.getPrefix() + "-javadoc.zip");
PigConfiguration pigConfiguration = context.getPigConfiguration();
Map<String, PncBuild> builds = context.getBuilds();
new JavadocManager(pigConfiguration, context.getReleasePath(), context.getDeliverables(), builds).prepare();
}
use of org.jboss.pnc.bacon.pig.impl.PigContext in project bacon by project-ncl.
the class PigFacade method generateNvrList.
/**
* Generate the nvr list from the information gathered during repository generation. If the latter was ignored, then
* nothing happens
*/
private static void generateNvrList() {
PigContext context = PigContext.get();
Map<String, Collection<String>> checksums = context.getChecksums();
if (checksums == null) {
// checksums populated only when repository generation is switched on
log.warn("No nvr list generated since repository generation may have been ignored");
} else {
Path targetPath = Paths.get(context.getReleasePath()).resolve(context.getDeliverables().getNvrListName()).toAbsolutePath();
NvrListGenerator.generateNvrList(checksums, targetPath);
}
}
use of org.jboss.pnc.bacon.pig.impl.PigContext in project bacon by project-ncl.
the class PigFacade method release.
public static PigReleaseOutput release() {
abortIfBuildDataAbsentFromContext();
pushToBrew(false);
// if repository data not present, skip generation of nvr list and upload script
if (context().getRepositoryData() == null) {
log.info("Skipping generation of nvr list and upload script since repository has not been generated");
return new PigReleaseOutput("", "", "");
}
generateNvrList();
// generate upload to candidates script
ScriptGenerator scriptGenerator = new ScriptGenerator(context().getPigConfiguration());
scriptGenerator.generateReleaseScripts(Paths.get(context().getTargetPath()));
PigContext context = PigContext.get();
return new PigReleaseOutput(context.getReleaseDirName(), context.getReleasePath(), context.getDeliverables().getNvrListName());
}
Aggregations