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