Package org.jfrog.build.api.builder

Examples of org.jfrog.build.api.builder.DependencyBuilder


                            Project.MSG_DEBUG);
                    ModuleRevisionId id = artifactsReport.getArtifact().getModuleRevisionId();
                    String type = getType(artifactsReport.getArtifact());
                    Dependency dependency = findDependencyInList(id, type, moduleDependencies);
                    if (dependency == null) {
                        DependencyBuilder dependencyBuilder = new DependencyBuilder();
                        dependencyBuilder.type(type).scopes(Lists.newArrayList(configuration));
                        String idString = getModuleIdString(id.getOrganisation(),
                                id.getName(), id.getRevision());
                        dependencyBuilder.id(idString);
                        File file = artifactsReport.getLocalFile();
                        Map<String, String> checksums;
                        try {
                            checksums = FileChecksumCalculator.calculateChecksums(file, MD5, SHA1);
                        } catch (Exception e) {
                            throw new RuntimeException(e);
                        }
                        String md5 = checksums.get(MD5);
                        String sha1 = checksums.get(SHA1);
                        dependencyBuilder.md5(md5).sha1(sha1);
                        dependency = dependencyBuilder.build();
                        moduleDependencies.add(dependency);
                        project.log(
                                "[buildinfo:collect] Added dependency '" + dependency.getId() + "'", Project.MSG_DEBUG);
                    } else {
                        if (!dependency.getScopes().contains(configuration)) {
View Full Code Here


                    "list.");
            return;
        }
        for (Artifact dependency : moduleDependencies) {
            File depFile = dependency.getFile();
            DependencyBuilder dependencyBuilder = new DependencyBuilder()
                    .id(getModuleIdString(dependency.getGroupId(), dependency.getArtifactId(),
                            dependency.getVersion()))
                    .type(getTypeString(dependency.getType(),
                            dependency.getClassifier(), getExtension(depFile)));
            String scopes = dependency.getScope();
            if (StringUtils.isNotBlank(scopes)) {
                dependencyBuilder.scopes(Lists.newArrayList(scopes));
            }
            setDependencyChecksums(depFile, dependencyBuilder);
            module.addDependency(dependencyBuilder.build());
        }
    }
View Full Code Here

                String md5 = validateMd5Checksum(httpResponse, checksumsMap.get("md5"));
                String sha1 = validateSha1Checksum(httpResponse, checksumsMap.get("sha1"));

                log.info("Successfully downloaded '" + uriWithParams + "' to '" + fileDestination + "'");
                dependencyResult = new DependencyBuilder().id(filePath).md5(md5).sha1(sha1).build();
            }
        } catch (FileNotFoundException e) {
            if (StringUtils.isNotBlank(matrixParams)) {
                String skippedMessage = "Skipping download of '" + uriWithParams + "' due to matrix params mismatch.";
                log.debug(skippedMessage);
View Full Code Here

        String md5 = getMD5ChecksumFromResponse(artifactChecksums);
        String sha1 = getSHA1ChecksumFromResponse(artifactChecksums);

        if (downloader.isFileExistsLocally(filePath, md5, sha1)) {
            log.debug("File '" + filePath + "' already exists locally, skipping remote download.");
            dependencyResult = new DependencyBuilder().id(filePath).md5(md5).sha1(sha1).build();
        }

        return dependencyResult;
    }
View Full Code Here

TOP

Related Classes of org.jfrog.build.api.builder.DependencyBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.