use of com.android.build.gradle.internal.core.GradleVariantConfiguration in project atlas by alibaba.
the class PreProcessManifestAction method execute.
@Override
public void execute(Task task) {
AtlasExtension atlasExtension = appVariantContext.getAtlasExtension();
ManifestProcessorTask manifestProcessorTask = baseVariantOutput.getProcessManifest();
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();
AtlasDependencyTree dependencyTree = AtlasBuildContext.androidDependencyTrees.get(config.getFullName());
List<ManifestProvider> bundleProviders = ManifestHelper.getBundleManifest(appVariantContext, dependencyTree, atlasExtension);
List<ManifestProvider> mainDexProviders = ManifestHelper.getMainDexManifest(appVariantContext, dependencyTree, atlasExtension);
List<ManifestProvider> allManifest = new ArrayList<>();
modifyForIncremental(mergeManifests, allManifest);
// allManifest.addAll(ManifestHelper.convert(mergeManifests.getProviders(), appVariantContext));
allManifest.addAll(bundleProviders);
allManifest.addAll(mainDexProviders);
AtlasBuildContext.androidBuilderMap.get(appVariantContext.getProject()).manifestProviders = allManifest;
mergeManifests.setAndroidBuilder(AtlasBuildContext.androidBuilderMap.get(appVariantContext.getProject()));
// if (sLogger.isInfoEnabled()) {
// for (ManifestProvider manifestProvider : allManifest) {
// sLogger.warn("[manifestLibs] " + manifestProvider.getManifest().getAbsolutePath());
// }
// }
// Without this step, each time getLibraries It's going to be recomputed from the mapping
// mergeManifests.(allManifest);
}
}
Aggregations