use of com.taobao.android.builder.tasks.library.publish.UpdatePomTask in project atlas by alibaba.
the class AtlasLibTaskManager method runTask.
@Override
public void runTask() {
new UpdatePomTask(project).updatePom();
libraryExtension.getLibraryVariants().forEach(libraryVariant -> {
LibVariantContext libVariantContext = new LibVariantContext((LibraryVariantImpl) libraryVariant, project, atlasExtension, libraryExtension);
TBuildType tBuildType = libVariantContext.getBuildType();
if (null != tBuildType) {
try {
new AwoPropHandler().process(tBuildType, atlasExtension.getBundleConfig());
} catch (Exception e) {
throw new GradleException("process awo exception", e);
}
}
AwbGenerator awbGenerator = new AwbGenerator(atlasExtension);
Collection<BaseVariantOutput> list = libVariantContext.getBaseVariant().getOutputs();
if (null != list) {
for (BaseVariantOutput libVariantOutputData : list) {
Zip zipTask = ((LibraryVariantOutput) (libVariantOutputData)).getPackageLibrary();
if (atlasExtension.getBundleConfig().isJarEnabled()) {
new JarExtractTask().generateJarArtifict(zipTask);
}
// Build the awb and extension
if (atlasExtension.getBundleConfig().isAwbBundle()) {
awbGenerator.generateAwbArtifict(zipTask, libVariantContext);
}
if (null != tBuildType && (StringUtils.isNotEmpty(tBuildType.getBaseApDependency()) || null != tBuildType.getBaseApFile()) && libraryVariant.getName().equals("debug")) {
atlasExtension.getTBuildConfig().setUseCustomAapt(true);
libVariantContext.setBundleTask(zipTask);
try {
libVariantContext.setAwbBundle(awbGenerator.createAwbBundle(libVariantContext));
} catch (IOException e) {
throw new GradleException("set awb bundle error");
}
// if (atlasExtension.getBundleConfig().isAwbBundle()) {
// createAwoTask(libVariantContext, zipTask);
// } else {
// createDexTask(libVariantContext, zipTask);
// }
}
}
// List<TransformTask>transformTasks = TransformManager.findTransformTaskByTransformType(libVariantContext,LibraryAarJarsTransform.class);
// for (TransformTask transformTask: transformTasks){
// Transform transform = transformTask.getTransform();
// if (transform instanceof LibraryBaseTransform){
// ReflectUtils.updateField(transform,"excludeListProviders", Lists.newArrayList(new AtlasExcludeListProvider()));
// }
// }
}
});
}
Aggregations