Search in sources :

Example 1 with DependencyMediation

use of com.google.cloud.tools.opensource.classpath.DependencyMediation in project cloud-opensource-java by GoogleCloudPlatform.

the class DashboardMain method generate.

private static Path generate(Bom bom, DependencyMediationAlgorithm dependencyMediationAlgorithm) throws IOException, TemplateException, URISyntaxException, InvalidVersionSpecificationException {
    ImmutableList<Artifact> managedDependencies = bom.getManagedDependencies();
    DependencyMediation dependencyMediation = dependencyMediationAlgorithm == DependencyMediationAlgorithm.MAVEN ? DependencyMediation.MAVEN : GradleDependencyMediation.withEnforcedPlatform(bom);
    ClassPathResult classPathResult = classPathBuilder.resolve(managedDependencies, false, dependencyMediation);
    ImmutableList<ClassPathEntry> classpath = classPathResult.getClassPath();
    LinkageChecker linkageChecker = LinkageChecker.create(classpath);
    ImmutableSet<LinkageProblem> linkageProblems = linkageChecker.findLinkageProblems();
    ArtifactCache cache = loadArtifactInfo(managedDependencies);
    Path output = generateHtml(bom, cache, classPathResult, linkageProblems);
    return output;
}
Also used : Path(java.nio.file.Path) DependencyPath(com.google.cloud.tools.opensource.dependencies.DependencyPath) LinkageProblem(com.google.cloud.tools.opensource.classpath.LinkageProblem) GradleDependencyMediation(com.google.cloud.tools.opensource.classpath.GradleDependencyMediation) DependencyMediation(com.google.cloud.tools.opensource.classpath.DependencyMediation) ClassPathResult(com.google.cloud.tools.opensource.classpath.ClassPathResult) LinkageChecker(com.google.cloud.tools.opensource.classpath.LinkageChecker) Artifact(org.eclipse.aether.artifact.Artifact) DefaultArtifact(org.eclipse.aether.artifact.DefaultArtifact) ClassPathEntry(com.google.cloud.tools.opensource.classpath.ClassPathEntry)

Aggregations

ClassPathEntry (com.google.cloud.tools.opensource.classpath.ClassPathEntry)1 ClassPathResult (com.google.cloud.tools.opensource.classpath.ClassPathResult)1 DependencyMediation (com.google.cloud.tools.opensource.classpath.DependencyMediation)1 GradleDependencyMediation (com.google.cloud.tools.opensource.classpath.GradleDependencyMediation)1 LinkageChecker (com.google.cloud.tools.opensource.classpath.LinkageChecker)1 LinkageProblem (com.google.cloud.tools.opensource.classpath.LinkageProblem)1 DependencyPath (com.google.cloud.tools.opensource.dependencies.DependencyPath)1 Path (java.nio.file.Path)1 Artifact (org.eclipse.aether.artifact.Artifact)1 DefaultArtifact (org.eclipse.aether.artifact.DefaultArtifact)1