Search in sources :

Example 6 with JarDependency

use of com.android.builder.dependency.JarDependency in project atlas by alibaba.

the class DependencyConvertUtils method toAwbBundle.

public static AwbBundle toAwbBundle(ResolvedDependencyInfo resolvedDependencyInfo) {
    assertType(Type.AWB, resolvedDependencyInfo);
    List<LibraryDependency> dependencies = Lists.newArrayList();
    Collection<JarDependency> jarDependencies = Lists.newArrayList();
    List<SoLibrary> soLibraries = Lists.newArrayList();
    collectChildren(resolvedDependencyInfo, dependencies, jarDependencies, soLibraries);
    AwbBundle awbBundle = new AwbBundle(resolvedDependencyInfo.getResolvedArtifact().getFile(), resolvedDependencyInfo.getExplodedDir(), dependencies, jarDependencies, resolvedDependencyInfo.getGroup() + "-" + resolvedDependencyInfo.getName(), resolvedDependencyInfo.getVariantName(), resolvedDependencyInfo.getGradlePath(), null, convert(resolvedDependencyInfo.getResolvedArtifact()));
    awbBundle.setSoLibraries(soLibraries);
    return awbBundle;
}
Also used : JarDependency(com.android.builder.dependency.JarDependency) LibraryDependency(com.android.builder.dependency.LibraryDependency) SoLibrary(com.taobao.android.builder.dependency.model.SoLibrary) AwbBundle(com.taobao.android.builder.dependency.model.AwbBundle)

Example 7 with JarDependency

use of com.android.builder.dependency.JarDependency in project atlas by alibaba.

the class DependencyConvertUtils method toJarDependency.

/**
     * 转换为jar依赖
     *
     * @param resolvedDependencyInfo
     * @return
     */
private static JarDependency toJarDependency(ResolvedDependencyInfo resolvedDependencyInfo, boolean containChild) {
    assertType(Type.JAR, resolvedDependencyInfo);
    ResolvedArtifact artifact = resolvedDependencyInfo.getResolvedArtifact();
    List<JarDependency> dependencies = Lists.newArrayList();
    if (containChild) {
        collectChildren(resolvedDependencyInfo, Lists.<LibraryDependency>newArrayList(), dependencies, Lists.<SoLibrary>newArrayList());
    }
    JarDependency jarInfo = new JarDependency(artifact.getFile(), dependencies, convert(artifact), resolvedDependencyInfo.getGradlePath(), false);
    return jarInfo;
}
Also used : JarDependency(com.android.builder.dependency.JarDependency) ResolvedArtifact(org.gradle.api.artifacts.ResolvedArtifact)

Example 8 with JarDependency

use of com.android.builder.dependency.JarDependency in project atlas by alibaba.

the class TDependencyManager method recursiveJavaSkip.

private static void recursiveJavaSkip(@NonNull List<JarDependency> libs) {
    for (JarDependency lib : libs) {
        lib.skip();
        //noinspection unchecked
        recursiveJavaSkip((List<JarDependency>) lib.getDependencies());
    }
}
Also used : JarDependency(com.android.builder.dependency.JarDependency)

Example 9 with JarDependency

use of com.android.builder.dependency.JarDependency in project atlas by alibaba.

the class TDependencyManager method recursiveLibSkip.

private static void recursiveLibSkip(@NonNull List<LibraryDependency> libs) {
    for (LibraryDependency lib : libs) {
        lib.skip();
        //noinspection unchecked
        recursiveLibSkip((List<LibraryDependency>) lib.getLibraryDependencies());
        //noinspection unchecked
        recursiveJavaSkip((List<JarDependency>) lib.getJavaDependencies());
    }
}
Also used : JarDependency(com.android.builder.dependency.JarDependency) LibraryDependency(com.android.builder.dependency.LibraryDependency)

Aggregations

JarDependency (com.android.builder.dependency.JarDependency)9 LibraryDependency (com.android.builder.dependency.LibraryDependency)6 SoLibrary (com.taobao.android.builder.dependency.model.SoLibrary)3 File (java.io.File)3 MavenCoordinates (com.android.builder.model.MavenCoordinates)2 ImmutableList (com.google.common.collect.ImmutableList)2 AarBundle (com.taobao.android.builder.dependency.model.AarBundle)2 AwbBundle (com.taobao.android.builder.dependency.model.AwbBundle)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 ModuleVersionIdentifier (org.gradle.api.artifacts.ModuleVersionIdentifier)2 ResolvedArtifact (org.gradle.api.artifacts.ResolvedArtifact)2 ComponentSelector (org.gradle.api.artifacts.component.ComponentSelector)2 DependencyResult (org.gradle.api.artifacts.result.DependencyResult)2 ResolvedDependencyResult (org.gradle.api.artifacts.result.ResolvedDependencyResult)2 UnresolvedDependencyResult (org.gradle.api.artifacts.result.UnresolvedDependencyResult)2 NonNull (com.android.annotations.NonNull)1 DependencyContainerImpl (com.android.builder.dependency.DependencyContainerImpl)1 MavenCoordinatesImpl (com.android.builder.dependency.MavenCoordinatesImpl)1 AndroidLibrary (com.android.builder.model.AndroidLibrary)1