use of com.taobao.android.builder.extension.AtlasExtension in project atlas by alibaba.
the class AtlasPlugin method createExtendsion.
/**
* 设置插件的extension值
*/
protected void createExtendsion() {
final NamedDomainObjectContainer<TBuildType> buildTypeContainer = project.container(TBuildType.class, new TBuildTypeFactory(instantiator, project, project.getLogger()));
final NamedDomainObjectContainer<PatchConfig> patchConfigContainer = project.container(PatchConfig.class, new PatchConfigFactory(instantiator, project, project.getLogger()));
atlasExtension = project.getExtensions().create("atlas", AtlasExtension.class, project, instantiator, buildTypeContainer, patchConfigContainer);
}
use of com.taobao.android.builder.extension.AtlasExtension in project atlas by alibaba.
the class PreProcessManifestTask method addAwbManifest2Merge.
private void addAwbManifest2Merge() {
AtlasExtension atlasExtension = appVariantContext.getAtlasExtension();
for (final BaseVariantOutputData vod : appVariantContext.getVariantData().getOutputs()) {
ManifestProcessorTask manifestProcessorTask = vod.manifestProcessorTask;
Set<String> notMergedArtifacts = Sets.newHashSet();
if (null != atlasExtension.getManifestOptions() && null != atlasExtension.getManifestOptions().getNotMergedBundles()) {
notMergedArtifacts = atlasExtension.getManifestOptions().getNotMergedBundles();
}
if (manifestProcessorTask instanceof MergeManifests) {
MergeManifests mergeManifests = (MergeManifests) manifestProcessorTask;
VariantScope variantScope = appVariantContext.getScope();
GradleVariantConfiguration config = variantScope.getVariantConfiguration();
AndroidDependencyTree dependencyTree = AtlasBuildContext.androidDependencyTrees.get(config.getFullName());
if (null == dependencyTree) {
throw new StopExecutionException("DependencyTree cannot be null!");
}
List<? extends AndroidLibrary> awbManifests = ManifestDependencyUtil.getManifestDependencies(dependencyTree.getAwbBundles(), notMergedArtifacts, getLogger());
for (AndroidLibrary manifest : awbManifests) {
getLogger().info("[MTLPlugin]Add manifest:" + manifest.getName() + ",path is:" + manifest.getManifest().getAbsolutePath());
}
//FIXME 不加这一步,每次的getibraries 都会从mapping里去重新计算
mergeManifests.setLibraries(mergeManifests.getLibraries());
mergeManifests.getLibraries().addAll(awbManifests);
}
}
}
Aggregations