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;
}
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;
}
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;
}
Aggregations