Search in sources :

Example 1 with ModuleBuilder

use of org.jfrog.build.api.builder.ModuleBuilder in project build-info by JFrogDev.

the class BuildInfoRecorder method addFilesToCurrentModule.

private void addFilesToCurrentModule(MavenProject project) {
    ModuleBuilder module = currentModule.get();
    if (module == null) {
        logger.warn("Skipping Artifactory Build-Info module finalization: Null current module.");
        return;
    }
    addArtifactsToCurrentModule(project, module);
    addDependenciesToCurrentModule(module);
    buildInfoBuilder.addModule(module.build());
}
Also used : ModuleBuilder(org.jfrog.build.api.builder.ModuleBuilder)

Example 2 with ModuleBuilder

use of org.jfrog.build.api.builder.ModuleBuilder in project build-info by JFrogDev.

the class BuildInfoRecorder method initModule.

private void initModule(MavenProject project) {
    if (project == null) {
        logger.warn("Skipping Artifactory Build-Info module initialization: Null project.");
        return;
    }
    ModuleBuilder module = new ModuleBuilder();
    module.id(getModuleIdString(project.getGroupId(), project.getArtifactId(), project.getVersion()));
    module.properties(project.getProperties());
    currentModule.set(module);
    currentModuleArtifacts.set(Collections.synchronizedSet(new HashSet<Artifact>()));
    currentModuleDependencies.set(Collections.synchronizedSet(new HashSet<Artifact>()));
}
Also used : ModuleBuilder(org.jfrog.build.api.builder.ModuleBuilder)

Example 3 with ModuleBuilder

use of org.jfrog.build.api.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().id(moduleId);
        module = moduleBuilder.build();
        modules.add(module);
    } else {
        module.setId(moduleId);
    }
    return module;
}
Also used : ModuleBuilder(org.jfrog.build.api.builder.ModuleBuilder) BuildInfoExtractorUtils.getModuleIdString(org.jfrog.build.extractor.BuildInfoExtractorUtils.getModuleIdString) BuildInfoExtractorUtils.getTypeString(org.jfrog.build.extractor.BuildInfoExtractorUtils.getTypeString) Module(org.jfrog.build.api.Module)

Aggregations

ModuleBuilder (org.jfrog.build.api.builder.ModuleBuilder)3 Module (org.jfrog.build.api.Module)1 BuildInfoExtractorUtils.getModuleIdString (org.jfrog.build.extractor.BuildInfoExtractorUtils.getModuleIdString)1 BuildInfoExtractorUtils.getTypeString (org.jfrog.build.extractor.BuildInfoExtractorUtils.getTypeString)1