use of com.android.build.gradle.internal.api.ApkFiles in project atlas by alibaba.
the class ApkFileListUtils method recordApkFileInfos.
/**
* Records resource information for apk files
*/
public static ApkFiles recordApkFileInfos(AppVariantContext appVariantContext) {
ApkFiles apkFiles = new ApkFiles();
List<File> mainBundleResFolders = new ArrayList<File>();
mainBundleResFolders.add(appVariantContext.getScope().getVariantData().mergeResourcesTask.getOutputDir());
prepareApkFileList(appVariantContext.getScope().getVariantData().mergeAssetsTask.getOutputDir(), "assets", apkFiles);
for (File resFolder : mainBundleResFolders) {
prepareApkFileList(resFolder, "res", apkFiles);
}
// Record the resource information for each bundle
AtlasDependencyTree dependencyTree = AtlasBuildContext.androidDependencyTrees.get(appVariantContext.getScope().getVariantConfiguration().getFullName());
if (null == dependencyTree) {
throw new StopExecutionException("DependencyTree cannot be null!");
}
List<AwbBundle> libs = dependencyTree.getAwbBundles();
for (AwbBundle awbLib : libs) {
File mergeAssertFolder = appVariantContext.getMergeAssets(awbLib);
File mergeResFolder = appVariantContext.getMergeResources(awbLib);
String awbName = awbLib.getName();
prepareApkFileList(mergeAssertFolder, "assets", awbName, apkFiles);
prepareApkFileList(mergeResFolder, "res", awbName, apkFiles);
}
return apkFiles;
}
Aggregations