use of org.jboss.pnc.bacon.pig.impl.config.RepoGenerationData 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.config.RepoGenerationData in project bacon by project-ncl.
the class ResolveOnlyRepositoryTest method mockRepoGenerationDataAndMethods.
private RepoGenerationData mockRepoGenerationDataAndMethods() {
RepoGenerationData generationData = new RepoGenerationData();
RepoGenerationData generationDataSpy = Mockito.spy(generationData);
generationDataSpy.setStrategy(RepoGenerationStrategy.RESOLVE_ONLY);
return generationDataSpy;
}
use of org.jboss.pnc.bacon.pig.impl.config.RepoGenerationData in project bacon by project-ncl.
the class LicenseManager method generate.
private void generate() {
log.info("Generating licenses");
RepoGenerationData repoGen = pigConfiguration.getFlow().getRepositoryGeneration();
if (repoGen.isIncludeLicenses()) {
LicenseGenerator.extractLicenses(repositoryData.getRepositoryPath().toFile(), getTargetZipPath().toFile(), getTargetTopLevelDirectoryName());
} else {
LicenseGenerator.generateLicenses(repositoryData.getGavs(), getTargetZipPath().toFile(), getTargetTopLevelDirectoryName(), strict);
}
}
use of org.jboss.pnc.bacon.pig.impl.config.RepoGenerationData in project bacon by project-ncl.
the class GenerationDataCheckTest method testGenerationDataValidationOnDownload.
/**
* Test that for when the Generation strategy is DOWNLOAD, that the sourceArtifact and the sourceBuild are also
* specified
*/
@Test
void testGenerationDataValidationOnDownload() {
LicenseGenerationData licenseGenerationData = new LicenseGenerationData();
licenseGenerationData.setStrategy(LicenseGenerationStrategy.DOWNLOAD);
this.<LicenseGenerationData>testGenerationDataValidationOnDownloadHelper(licenseGenerationData);
RepoGenerationData repoGenerationData = new RepoGenerationData();
repoGenerationData.setStrategy(RepoGenerationStrategy.DOWNLOAD);
this.<RepoGenerationData>testGenerationDataValidationOnDownloadHelper(repoGenerationData);
JavadocGenerationData javadocGenerationData = new JavadocGenerationData();
javadocGenerationData.setStrategy(JavadocGenerationStrategy.DOWNLOAD);
this.<JavadocGenerationData>testGenerationDataValidationOnDownloadHelper(javadocGenerationData);
}
use of org.jboss.pnc.bacon.pig.impl.config.RepoGenerationData in project bacon by project-ncl.
the class OfflineManifestGenerator method sourceBuilds.
private Collection<PncBuild> sourceBuilds() {
RepoGenerationData generationData = pigConfiguration.getFlow().getRepositoryGeneration();
RepoGenerationStrategy strategy = generationData.getStrategy();
if (!Arrays.asList(IGNORE, BUILD_GROUP).contains(strategy)) {
return builds.values();
}
List<String> excludeSourceBuilds = generationData.getExcludeSourceBuilds();
return builds.values().stream().filter(build -> !excludeSourceBuilds.contains(build.getName())).collect(Collectors.toList());
}
Aggregations