use of com.taobao.android.builder.dependency.parser.AtlasDepTreeParser in project atlas by alibaba.
the class AwbGenerator method createAwbBundle.
public AwbBundle createAwbBundle(LibVariantContext libVariantContext) throws IOException {
String variantName = libVariantContext.getVariantName();
AtlasDependencyTree libDependencyTree = AtlasBuildContext.libDependencyTrees.get(variantName);
// TODO 2.3
if (null == libDependencyTree) {
libDependencyTree = new AtlasDepTreeParser(libVariantContext.getProject(), new ExtraModelInfo(new ProjectOptions(libVariantContext.getProject()), null), new HashSet<>()).parseDependencyTree(libVariantContext.getVariantDependency());
AtlasBuildContext.libDependencyTrees.put(variantName, libDependencyTree);
}
Project project = libVariantContext.getProject();
String groupName = (String) project.getGroup();
String name = "";
String version = (String) project.getVersion();
if (project.hasProperty("archivesBaseName")) {
name = (String) project.getProperties().get("archivesBaseName");
} else {
name = project.getName();
}
File explodedDir = project.file(project.getBuildDir().getAbsolutePath() + "/" + FD_INTERMEDIATES + "/exploded-awb/" + computeArtifactPath(groupName, name, version));
FileUtils.deleteDirectory(explodedDir);
MavenCoordinates mavenCoordinates = new MavenCoordinatesImpl(groupName, name, version, "awb", "");
ResolvedDependencyInfo resolvedDependencyInfo = new ResolvedDependencyInfo(groupName, name, version, "awb");
resolvedDependencyInfo.setVariantName(libVariantContext.getVariantName());
AwbBundle awbBundle = new AwbBundle(resolvedDependencyInfo, DependencyConvertUtils.toAndroidLibrary(mavenCoordinates, libVariantContext.getBundleTask().getArchivePath(), explodedDir));
awbBundle.getSoLibraries().addAll(libDependencyTree.getMainBundle().getSoLibraries());
awbBundle.getAndroidLibraries().addAll(libDependencyTree.getMainBundle().getAndroidLibraries());
awbBundle.getJavaLibraries().addAll(libDependencyTree.getMainBundle().getJavaLibraries());
return awbBundle;
}
use of com.taobao.android.builder.dependency.parser.AtlasDepTreeParser in project atlas by alibaba.
the class AtlasDependencyManager method resolveDependencies.
/**
* 1 . detect if has awb dependency
* <p>
* yes : special process
* no : default process
* <p>
* 2. parse to AtlasDependencyTree
*/
public Set<AndroidDependency> resolveDependencies(@NonNull VariantDependencies variantDeps) {
this.apDependency = resolveApDependencies(variantDeps);
AtlasDependencyTree atlasDependencyTree = new AtlasDepTreeParser(project, extraModelInfo, awbs).parseDependencyTree(variantDeps);
sLogger.info("[dependencyTree" + variantDeps.getName() + "] {}", JSON.toJSONString(atlasDependencyTree.getDependencyJson(), true));
if (PluginTypeUtils.isAppProject(project)) {
AtlasBuildContext.androidDependencyTrees.put(variantDeps.getName(), atlasDependencyTree);
} else {
AtlasBuildContext.libDependencyTrees.put(variantDeps.getName(), atlasDependencyTree);
}
// return libsToExplode;
return new HashSet<>(0);
}
Aggregations