Search in sources :

Example 1 with AwoDependency

use of com.taobao.android.builder.tasks.awo.utils.AwoDependency in project atlas by alibaba.

the class AtlasLibTaskManager method createAwbBundle.

private AwbBundle createAwbBundle(LibVariantContext libVariantContext, String variantName) throws IOException {
    AndroidDependencyTree libDependencyTree = AtlasBuildContext.libDependencyTrees.get(variantName);
    if (null == libDependencyTree) {
        dependencyManager.resolveDependencyForConfig(libVariantContext.getVariantDependency(), true);
        libDependencyTree = AtlasBuildContext.libDependencyTrees.get(variantName);
    }
    String groupName = (String) project.getGroup();
    String name = "";
    String version = (String) project.getVersion();
    if (project.hasProperty("archivesBaseName")) {
        name = (String) project.getProperties().get("archivesBaseName");
    } else {
        name = project.getName();
    }
    File explodedDir = project.file(project.getBuildDir().getAbsolutePath() + "/" + FD_INTERMEDIATES + "/exploded-awb/" + computeArtifactPath(groupName, name, version));
    FileUtils.deleteDirectory(explodedDir);
    AwbBundle awbBundle = new AwbBundle(libVariantContext.getBundleTask().getArchivePath(), explodedDir, new ArrayList<LibraryDependency>(), new ArrayList<JarDependency>(), groupName + ":" + name, libVariantContext.getVariantName(), project.getPath(), null, new MavenCoordinatesImpl(groupName, name, version));
    new AwoDependency(libVariantContext).parseDependency(libDependencyTree, awbBundle);
    return awbBundle;
}
Also used : JarDependency(com.android.builder.dependency.JarDependency) MavenCoordinatesImpl(com.android.builder.dependency.MavenCoordinatesImpl) AwoDependency(com.taobao.android.builder.tasks.awo.utils.AwoDependency) LibraryDependency(com.android.builder.dependency.LibraryDependency) AndroidDependencyTree(com.taobao.android.builder.dependency.AndroidDependencyTree) AwbBundle(com.taobao.android.builder.dependency.model.AwbBundle) File(java.io.File)

Example 2 with AwoDependency

use of com.taobao.android.builder.tasks.awo.utils.AwoDependency 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);
}
Also used : AwoDependency(com.taobao.android.builder.tasks.awo.utils.AwoDependency) GradleException(org.gradle.api.GradleException) AndroidDependencyTree(com.taobao.android.builder.dependency.AndroidDependencyTree) File(java.io.File) MtlBaseTaskAction(com.taobao.android.builder.tasks.manager.MtlBaseTaskAction) TaskAction(org.gradle.api.tasks.TaskAction)

Aggregations

AndroidDependencyTree (com.taobao.android.builder.dependency.AndroidDependencyTree)2 AwoDependency (com.taobao.android.builder.tasks.awo.utils.AwoDependency)2 File (java.io.File)2 JarDependency (com.android.builder.dependency.JarDependency)1 LibraryDependency (com.android.builder.dependency.LibraryDependency)1 MavenCoordinatesImpl (com.android.builder.dependency.MavenCoordinatesImpl)1 AwbBundle (com.taobao.android.builder.dependency.model.AwbBundle)1 MtlBaseTaskAction (com.taobao.android.builder.tasks.manager.MtlBaseTaskAction)1 GradleException (org.gradle.api.GradleException)1 TaskAction (org.gradle.api.tasks.TaskAction)1