Search in sources :

Example 1 with ApLibrary

use of com.taobao.android.builder.dependency.model.ApLibrary in project atlas by alibaba.

the class DependencyTree method toAndroidDependency.

/**
     * 转换为Android的依赖
     *
     * @return
     */
public AndroidDependencyTree toAndroidDependency() {
    AndroidDependencyTree androidDependencyTree = new AndroidDependencyTree(mResolvedDependencies);
    for (ResolvedDependencyInfo dependencyInfo : mResolvedDependencies) {
        switch(DependencyConvertUtils.Type.getType(dependencyInfo.getType())) {
            case AAR:
                AarBundle aarBundle = DependencyConvertUtils.toAarBundle(dependencyInfo);
                androidDependencyTree.getAarBundles().add(aarBundle);
                for (AndroidLibrary libraryDependency : aarBundle.getLibraryDependencies()) {
                    if (libraryDependency instanceof AarBundle) {
                        androidDependencyTree.getAarBundles().add((AarBundle) libraryDependency);
                    }
                }
                androidDependencyTree.getJars().addAll(aarBundle.getJavaDependencies());
                androidDependencyTree.getSoLibraries().addAll(aarBundle.getSoLibraries());
                break;
            case AWB:
                AwbBundle awbBundle = DependencyConvertUtils.toAwbBundle(dependencyInfo);
                androidDependencyTree.getAwbBundles().add(awbBundle);
                break;
            case JAR:
                JavaLibrary jarInfo = DependencyConvertUtils.toJarDependency(dependencyInfo);
                androidDependencyTree.getJars().add(jarInfo);
                androidDependencyTree.getJars().addAll(jarInfo.getDependencies());
                break;
            case SOLIB:
                SoLibrary soLibrary = DependencyConvertUtils.toSoLibrary(dependencyInfo);
                androidDependencyTree.getSoLibraries().add(soLibrary);
                break;
            case APK:
                ApkLibrary apkLibrary = DependencyConvertUtils.toApkLibrary(dependencyInfo);
                androidDependencyTree.getApkLibraries().add(apkLibrary);
                break;
            case AP:
                ApLibrary apLibrary = DependencyConvertUtils.toApLibrary(dependencyInfo);
                androidDependencyTree.getApLibraries().add(apLibrary);
                break;
            default:
                break;
        }
    }
    return androidDependencyTree;
}
Also used : JavaLibrary(com.android.builder.model.JavaLibrary) AndroidLibrary(com.android.builder.model.AndroidLibrary) AarBundle(com.taobao.android.builder.dependency.model.AarBundle) ApLibrary(com.taobao.android.builder.dependency.model.ApLibrary) ApkLibrary(com.taobao.android.builder.dependency.model.ApkLibrary) AwbBundle(com.taobao.android.builder.dependency.model.AwbBundle) SoLibrary(com.taobao.android.builder.dependency.model.SoLibrary)

Example 2 with ApLibrary

use of com.taobao.android.builder.dependency.model.ApLibrary in project atlas by alibaba.

the class DependencyConvertUtils method toApLibrary.

public static ApLibrary toApLibrary(ResolvedDependencyInfo resolvedDependencyInfo) {
    assertType(Type.AP, resolvedDependencyInfo);
    ResolvedArtifact artifact = resolvedDependencyInfo.getResolvedArtifact();
    ApLibrary apLibrary = new ApLibrary(convert(artifact), artifact.getFile(), resolvedDependencyInfo.getExplodedDir());
    return apLibrary;
}
Also used : ResolvedArtifact(org.gradle.api.artifacts.ResolvedArtifact) ApLibrary(com.taobao.android.builder.dependency.model.ApLibrary)

Example 3 with ApLibrary

use of com.taobao.android.builder.dependency.model.ApLibrary in project atlas by alibaba.

the class DependencyConvertUtils method toApLibrary.

public static ApLibrary toApLibrary(ResolvedDependencyInfo resolvedDependencyInfo) {
    assertType(Type.AP, resolvedDependencyInfo);
    ResolvedArtifact artifact = resolvedDependencyInfo.getResolvedArtifact();
    ApLibrary apLibrary = new ApLibrary(convert(artifact, Type.AP), artifact.getFile(), resolvedDependencyInfo.getExplodedDir());
    return apLibrary;
}
Also used : ResolvedArtifact(org.gradle.api.artifacts.ResolvedArtifact) ApLibrary(com.taobao.android.builder.dependency.model.ApLibrary)

Aggregations

ApLibrary (com.taobao.android.builder.dependency.model.ApLibrary)3 ResolvedArtifact (org.gradle.api.artifacts.ResolvedArtifact)2 AndroidLibrary (com.android.builder.model.AndroidLibrary)1 JavaLibrary (com.android.builder.model.JavaLibrary)1 AarBundle (com.taobao.android.builder.dependency.model.AarBundle)1 ApkLibrary (com.taobao.android.builder.dependency.model.ApkLibrary)1 AwbBundle (com.taobao.android.builder.dependency.model.AwbBundle)1 SoLibrary (com.taobao.android.builder.dependency.model.SoLibrary)1