Search in sources :

Example 16 with ModuleBuilder

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;
}
Also used : ModuleBuilder(org.jfrog.build.extractor.builder.ModuleBuilder) BuildInfo(org.jfrog.build.extractor.ci.BuildInfo) ArrayList(java.util.ArrayList) Module(org.jfrog.build.extractor.ci.Module)

Example 17 with ModuleBuilder

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;
}
Also used : ModuleBuilder(org.jfrog.build.extractor.builder.ModuleBuilder) BuildInfoExtractorUtils.getModuleIdString(org.jfrog.build.extractor.BuildInfoExtractorUtils.getModuleIdString) BuildInfoExtractorUtils.getTypeString(org.jfrog.build.extractor.BuildInfoExtractorUtils.getTypeString) Module(org.jfrog.build.extractor.ci.Module)

Aggregations

ModuleBuilder (org.jfrog.build.extractor.builder.ModuleBuilder)17 Module (org.jfrog.build.extractor.ci.Module)7 BuildInfo (org.jfrog.build.extractor.ci.BuildInfo)6 IOException (java.io.IOException)3 BuildInfoMavenBuilder (org.jfrog.build.extractor.builder.BuildInfoMavenBuilder)3 ArrayList (java.util.ArrayList)2 BuildInfoExtractorUtils.getModuleIdString (org.jfrog.build.extractor.BuildInfoExtractorUtils.getModuleIdString)2 BuildInfoExtractorUtils.getTypeString (org.jfrog.build.extractor.BuildInfoExtractorUtils.getTypeString)2 BuildInfoBuilder (org.jfrog.build.extractor.builder.BuildInfoBuilder)2 DependencyBuilder (org.jfrog.build.extractor.builder.DependencyBuilder)2 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1 ArtifactBuilder (org.jfrog.build.extractor.builder.ArtifactBuilder)1 Artifact (org.jfrog.build.extractor.ci.Artifact)1 Dependency (org.jfrog.build.extractor.ci.Dependency)1 ArtifactoryClientConfiguration (org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration)1 IncludeExcludePatterns (org.jfrog.build.extractor.clientConfiguration.IncludeExcludePatterns)1 ArtifactoryManager (org.jfrog.build.extractor.clientConfiguration.client.artifactory.ArtifactoryManager)1 DeployDetails (org.jfrog.build.extractor.clientConfiguration.deploy.DeployDetails)1 ArtifactoryTask (org.jfrog.gradle.plugin.artifactory.task.ArtifactoryTask)1