use of org.jfrog.build.extractor.builder.ModuleBuilder in project build-info by JFrogDev.
the class NpmBuildInfoExtractor method createBuild.
private BuildInfo createBuild(List<Dependency> dependencies, String moduleId) {
Module module = new ModuleBuilder().type(ModuleType.NPM).id(moduleId).dependencies(dependencies).build();
List<Module> modules = new ArrayList<>();
modules.add(module);
BuildInfo buildInfo = new BuildInfo();
buildInfo.setModules(modules);
return buildInfo;
}
use of org.jfrog.build.extractor.builder.ModuleBuilder in project build-info by JFrogDev.
the class ArtifactoryBuildInfoTrigger method getOrCreateModule.
private Module getOrCreateModule(Map<String, String> attributes) {
List<Module> modules = ctx.getModules();
final String org = attributes.get("organisation");
final String moduleName = attributes.get("module");
String moduleKey = getModuleIdString(org, moduleName, "");
String moduleId = getModuleIdString(org, moduleName, attributes.get("revision"));
Module module = findModule(modules, moduleKey);
if (module == null) {
ModuleBuilder moduleBuilder = new ModuleBuilder().type(ModuleType.IVY).id(moduleId).repository(ctx.getClientConf().publisher.getRepoKey());
module = moduleBuilder.build();
modules.add(module);
} else {
module.setId(moduleId);
}
return module;
}
Aggregations