Search in sources :

Example 1 with ApkLibrary

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

the class DependencyConvertUtils method toApkLibrary.

public static ApkLibrary toApkLibrary(ResolvedDependencyInfo resolvedDependencyInfo) {
    assertType(Type.APK, resolvedDependencyInfo);
    ResolvedArtifact artifact = resolvedDependencyInfo.getResolvedArtifact();
    ApkLibrary apkLibrary = new ApkLibrary(convert(artifact), artifact.getFile());
    return apkLibrary;
}
Also used : ResolvedArtifact(org.gradle.api.artifacts.ResolvedArtifact) ApkLibrary(com.taobao.android.builder.dependency.model.ApkLibrary)

Example 2 with ApkLibrary

use of com.taobao.android.builder.dependency.model.ApkLibrary 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 3 with ApkLibrary

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

the class DependencyConvertUtils method toApkLibrary.

public static ApkLibrary toApkLibrary(ResolvedDependencyInfo resolvedDependencyInfo) {
    assertType(Type.APK, resolvedDependencyInfo);
    ResolvedArtifact artifact = resolvedDependencyInfo.getResolvedArtifact();
    ApkLibrary apkLibrary = new ApkLibrary(convert(artifact, Type.APK), artifact.getFile());
    return apkLibrary;
}
Also used : ResolvedArtifact(org.gradle.api.artifacts.ResolvedArtifact) ApkLibrary(com.taobao.android.builder.dependency.model.ApkLibrary)

Aggregations

ApkLibrary (com.taobao.android.builder.dependency.model.ApkLibrary)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 ApLibrary (com.taobao.android.builder.dependency.model.ApLibrary)1 AwbBundle (com.taobao.android.builder.dependency.model.AwbBundle)1 SoLibrary (com.taobao.android.builder.dependency.model.SoLibrary)1