use of com.android.build.gradle.internal.api.ApContext in project atlas by alibaba.
the class PrepareAaptTask method doExecute.
//MergeResources mergeResources;
@TaskAction
public void doExecute() {
AaptOptions aaptOptions = processAndroidResources.getAaptOptions();
if (null == aaptOptions) {
aaptOptions = new AaptOptions();
}
if (null == aaptOptions.getAdditionalParameters()) {
aaptOptions.setAdditionalParameters(new ArrayList<String>());
}
if (!appVariantContext.getAtlasExtension().getTBuildConfig().getAaptConstantId()) {
aaptOptions.getAdditionalParameters().add("--non-constant-id");
}
processAndroidResources.setAndroidBuilder(getBuilder());
processAndroidResources.setAaptOptions(aaptOptions);
ApContext apContext = appVariantContext.apContext;
if (null != apContext && apContext.getBaseApk().exists()) {
File baseApk = appVariantContext.apContext.getBaseApk();
//需要增加-b参数
if (!aaptOptions.getAdditionalParameters().contains("-B")) {
aaptOptions.getAdditionalParameters().add("-B");
aaptOptions.getAdditionalParameters().add(baseApk.getAbsolutePath());
}
//AndroidManifest文件不能有修改OR在patch的时候忽略,目前选择在patch的时候忽略
}
//TODO update merge resource
//mergeResources.setAndroidBuilder(AtlasBuildContext.androidBuilder);
}
Aggregations