Search in sources :

Example 1 with Result

use of com.taobao.android.builder.tools.manifest.Result in project atlas by alibaba.

the class PostProcessManifestAction method execute.

@Override
public void execute(Task task) {
    AtlasExtension atlasExtension = appVariantContext.getAtlasExtension();
    File bundleBaseLineInfo = appVariantContext.getBundleBaseInfoFile();
    VariantScope variantScope = appVariantContext.getScope();
    GradleVariantConfiguration config = variantScope.getVariantConfiguration();
    AtlasDependencyTree dependencyTree = AtlasBuildContext.androidDependencyTrees.get(config.getFullName());
    File androidManifest = null;
    File file = variantScope.getInstantRunManifestOutputDirectory();
    if (null != file && file.exists() && variantScope.getInstantRunBuildContext().isInInstantRunMode()) {
        androidManifest = FileUtils.join(baseVariantOutputData.getProcessManifest().getInstantRunManifestOutputDirectory(), baseVariantOutputData.getDirName(), SdkConstants.ANDROID_MANIFEST_XML);
    } else {
        androidManifest = FileUtils.join(baseVariantOutputData.getProcessManifest().getManifestOutputDirectory(), baseVariantOutputData.getDirName(), SdkConstants.ANDROID_MANIFEST_XML);
    }
    try {
        Result result = ManifestFileUtils.postProcessManifests(androidManifest, getLibManifestMap(), getLibManifestDepenendyMap(), bundleBaseLineInfo, atlasExtension.manifestOptions, isMultiDexEnabled(), variantScope.getInstantRunBuildContext().isInInstantRunMode(), appVariantContext.getBuildType().isDebuggable(), atlasExtension.getTBuildConfig().getOutOfApkBundles(), atlasExtension.getTBuildConfig().getInsideOfApkBundles(), atlasExtension.getTBuildConfig().isPushInstall());
        File proxySrcDir = appVariantContext.getAtlasProxySourceDir();
        if (AtlasProxy.genProxyJavaSource(proxySrcDir, result)) {
        // appVariantContext.getVariantData().javacTask.source(proxySrcDir);
        }
        ManifestHelper.checkManifest(appVariantContext, androidManifest, dependencyTree, atlasExtension);
    } catch (DocumentException e1) {
        e1.printStackTrace();
    } catch (IOException e1) {
        e1.printStackTrace();
    }
// ManifestFileUtils.postProcessManifests(
// instantRunAndroidManifest,
// getLibManifestMap(),
// getLibManifestDepenendyMap(),
// bundleBaseLineInfo,
// atlasExtension.manifestOptions,
// isMultiDexEnabled(),
// true,
// appVariantContext.getBuildType().isDebuggable(),
// atlasExtension.getTBuildConfig()
// .getOutOfApkBundles(),atlasExtension.getTBuildConfig().getInsideOfApkBundles(),atlasExtension.getTBuildConfig().isPushInstall());
// }
// manifest list check
// TODO??
// AtlasBuildContext.androidBuilderMap.get(appVariantContext.getProject()).generateKeepList(
// baseVariantOutputData.manifestProcessorTask.getManifestOutputFile(),
// appVariantContext.getScope()
// .getManifestKeepListProguardFile());
}
Also used : AtlasExtension(com.taobao.android.builder.extension.AtlasExtension) VariantScope(com.android.build.gradle.internal.scope.VariantScope) DocumentException(org.dom4j.DocumentException) GradleVariantConfiguration(com.android.build.gradle.internal.core.GradleVariantConfiguration) IOException(java.io.IOException) File(java.io.File) AtlasDependencyTree(com.taobao.android.builder.dependency.AtlasDependencyTree) Result(com.taobao.android.builder.tools.manifest.Result)

Aggregations

GradleVariantConfiguration (com.android.build.gradle.internal.core.GradleVariantConfiguration)1 VariantScope (com.android.build.gradle.internal.scope.VariantScope)1 AtlasDependencyTree (com.taobao.android.builder.dependency.AtlasDependencyTree)1 AtlasExtension (com.taobao.android.builder.extension.AtlasExtension)1 Result (com.taobao.android.builder.tools.manifest.Result)1 File (java.io.File)1 IOException (java.io.IOException)1 DocumentException (org.dom4j.DocumentException)1