use of com.taobao.android.builder.dependency.AndroidDependencyTree in project atlas by alibaba.
the class MergeAssetAwbsConfigAction method execute.
@Override
public void execute(MtlParallelTask parallelTask) {
super.execute(parallelTask);
AndroidDependencyTree androidDependencyTree = AtlasBuildContext.androidDependencyTrees.get(parallelTask.getVariantName());
if (null == androidDependencyTree) {
return;
}
List<DefaultTask> tasks = new ArrayList<DefaultTask>();
for (final AwbBundle awbBundle : androidDependencyTree.getAwbBundles()) {
MergeAwbAssetConfigAction mergeAwbAssetConfigAction = new MergeAwbAssetConfigAction(appVariantContext, baseVariantOutputData, awbBundle);
MergeSourceSetFolders mergeTask = TaskCreater.create(appVariantContext.getProject(), mergeAwbAssetConfigAction.getName(), mergeAwbAssetConfigAction.getType());
mergeAwbAssetConfigAction.execute(mergeTask);
tasks.add(mergeTask);
}
parallelTask.parallelTask = tasks;
parallelTask.uniqueTaskName = getName();
}
use of com.taobao.android.builder.dependency.AndroidDependencyTree in project atlas by alibaba.
the class MergeResAwbsConfigAction method execute.
@Override
public void execute(MtlParallelTask parallelTask) {
super.execute(parallelTask);
AndroidDependencyTree androidDependencyTree = AtlasBuildContext.androidDependencyTrees.get(parallelTask.getVariantName());
if (null == androidDependencyTree) {
return;
}
List<DefaultTask> tasks = new ArrayList<DefaultTask>();
for (final AwbBundle awbBundle : androidDependencyTree.getAwbBundles()) {
MergeAwbResourceConfigAction mergeAwbResourceConfigAction = new MergeAwbResourceConfigAction(appVariantContext, baseVariantOutputData, awbBundle);
final MergeResources mergeTask = TaskCreater.create(appVariantContext.getProject(), mergeAwbResourceConfigAction.getName(), mergeAwbResourceConfigAction.getType());
mergeAwbResourceConfigAction.execute(mergeTask);
tasks.add(mergeTask);
mergeTask.doLast(new Action<Task>() {
@Override
public void execute(Task task) {
File publicRes = new File(awbBundle.getResFolder(), "values/public.xml");
if (publicRes.exists()) {
try {
FileUtils.copyFile(publicRes, new File(mergeTask.getOutputDir(), "values/public.xml"));
} catch (IOException e) {
e.printStackTrace();
}
}
}
});
}
parallelTask.parallelTask = tasks;
parallelTask.uniqueTaskName = getName();
parallelTask.concurrent = true;
}
use of com.taobao.android.builder.dependency.AndroidDependencyTree in project atlas by alibaba.
the class BundleInfoUtils method getBundleInfoList.
@NotNull
public static List<BundleInfo> getBundleInfoList(AppVariantContext appVariantContext) {
AndroidDependencyTree androidDependencyTree = AtlasBuildContext.androidDependencyTrees.get(appVariantContext.getScope().getVariantConfiguration().getFullName());
List<BundleInfo> bundleInfoList = new ArrayList<BundleInfo>();
for (AwbBundle awbBundle : androidDependencyTree.getAwbBundles()) {
bundleInfoList.add(awbBundle.bundleInfo);
}
return bundleInfoList;
}
use of com.taobao.android.builder.dependency.AndroidDependencyTree in project atlas by alibaba.
the class ApkInjectInfoCreator method creteInjectParam.
public InjectParam creteInjectParam(AppVariantContext appVariantContext) throws IOException, DocumentException {
InjectParam injectParam = new InjectParam();
injectParam.removePreverify = !appVariantContext.getAtlasExtension().getTBuildConfig().getDoPreverify();
injectParam.version = appVariantContext.getVariantConfiguration().getVersionName();
AndroidDependencyTree androidDependencyTree = AtlasBuildContext.androidDependencyTrees.get(appVariantContext.getScope().getVariantConfiguration().getFullName());
List<BasicBundleInfo> basicBundleInfos = new ArrayList<BasicBundleInfo>();
for (AwbBundle awbBundle : androidDependencyTree.getAwbBundles()) {
BundleInfo muppBundleInfo = awbBundle.bundleInfo;
BasicBundleInfo basicBundleInfo = new BasicBundleInfo();
basicBundleInfo.setApplicationName(muppBundleInfo.getApplicationName());
basicBundleInfo.setVersion(muppBundleInfo.getVersion());
basicBundleInfo.setPkgName(muppBundleInfo.getPkgName());
if (!muppBundleInfo.getIsInternal()) {
basicBundleInfo.setIsInternal(false);
}
if (!muppBundleInfo.getActivities().isEmpty()) {
basicBundleInfo.setActivities(muppBundleInfo.getActivities());
}
if (!muppBundleInfo.getContentProviders().isEmpty()) {
basicBundleInfo.setContentProviders(muppBundleInfo.getContentProviders());
}
if (!muppBundleInfo.getDependency().isEmpty()) {
basicBundleInfo.setDependency(muppBundleInfo.getDependency());
}
if (!muppBundleInfo.getReceivers().isEmpty()) {
basicBundleInfo.setReceivers(muppBundleInfo.getReceivers());
}
if (!muppBundleInfo.getServices().isEmpty()) {
basicBundleInfo.setServices(muppBundleInfo.getServices());
}
basicBundleInfos.add(basicBundleInfo);
}
injectParam.bundleInfo = JSON.toJSONString(basicBundleInfos);
//FIXME MOVE TO MTL-PLUGIN
//List<String> autoStartBundles = new ArrayList<String>(appVariantContext.getAtlasExtension().getTBuildConfig().getAutoStartBundles());
//
//UpdateConfig updateConfig = appVariantContext.getAtlasExtension().getUpdateConfig();
//if (updateConfig.enabled) {
// injectParam.group = updateConfig.getProductName();
// injectParam.outApp = updateConfig.isOutApp();
// autoStartBundles.add(0, updateConfig.getSdkPkgName());
//}
//
injectParam.autoStartBundles = StringUtils.join(appVariantContext.getAtlasExtension().getTBuildConfig().getAutoStartBundles(), ",");
injectParam.preLaunch = appVariantContext.getAtlasExtension().getTBuildConfig().getPreLaunch();
return injectParam;
}
use of com.taobao.android.builder.dependency.AndroidDependencyTree in project atlas by alibaba.
the class PrepareMainDexJarsTask method doFullTaskAction.
@TaskAction
public void doFullTaskAction() {
AndroidDependencyTree libDependencyTree = AtlasBuildContext.libDependencyTrees.get(this.getVariantName());
if (null == libDependencyTree) {
throw new GradleException("The libDependencyTree is null!");
}
List<File> jarList = new AwoDependency(libVariantContext).getDependencyJar(libDependencyTree);
libVariantContext.setJarDexList(jarList);
}
Aggregations