Search in sources :

Example 6 with DependencyJson

use of com.taobao.android.builder.dependency.output.DependencyJson in project atlas by alibaba.

the class AndroidDependencyTree method getDependencyJson.

/**
     * 转换为ependencyJSon对象
     *
     * @return
     */
public DependencyJson getDependencyJson() {
    DependencyJson dependencyJson = new DependencyJson();
    for (ResolvedDependencyInfo dep : mResolvedDependencies) {
        String value = getDependencyString(dep);
        if ("awb".equalsIgnoreCase(dep.getType())) {
            ArrayList<String> awbDeps = dependencyJson.getAwbs().get(value);
            if (null == awbDeps) {
                awbDeps = new ArrayList<String>();
            }
            addChildDependency(awbDeps, dep);
            dependencyJson.getAwbs().put(value, awbDeps);
        } else {
            dependencyJson.getMainDex().add(value);
            addChildDependency(dependencyJson.getMainDex(), dep);
        }
    }
    return dependencyJson;
}
Also used : DependencyJson(com.taobao.android.builder.dependency.output.DependencyJson)

Example 7 with DependencyJson

use of com.taobao.android.builder.dependency.output.DependencyJson in project atlas by alibaba.

the class AndroidDependencyTree method getFlatDependencies.

public Set<String> getFlatDependencies() {
    DependencyJson dependencyJson = getDependencyJson();
    Set<String> depenSets = new HashSet<String>();
    if (null != dependencyJson.getAwbs()) {
        for (String key : dependencyJson.getAwbs().keySet()) {
            depenSets.add(key);
            depenSets.addAll(dependencyJson.getAwbs().get(key));
        }
    }
    depenSets.addAll(dependencyJson.getMainDex());
    return depenSets;
}
Also used : DependencyJson(com.taobao.android.builder.dependency.output.DependencyJson) HashSet(java.util.HashSet)

Example 8 with DependencyJson

use of com.taobao.android.builder.dependency.output.DependencyJson in project atlas by alibaba.

the class AtlasDependencyTree method getFlatDependencies.

public Set<String> getFlatDependencies() {
    DependencyJson dependencyJson = getDependencyJson();
    Set<String> depenSets = new HashSet<String>();
    if (null != dependencyJson.getAwbs()) {
        for (String key : dependencyJson.getAwbs().keySet()) {
            depenSets.add(key);
            depenSets.addAll(dependencyJson.getAwbs().get(key));
        }
    }
    depenSets.addAll(dependencyJson.getMainDex());
    return depenSets;
}
Also used : DependencyJson(com.taobao.android.builder.dependency.output.DependencyJson) HashSet(java.util.HashSet)

Aggregations

DependencyJson (com.taobao.android.builder.dependency.output.DependencyJson)8 MtlBaseTaskAction (com.taobao.android.builder.tasks.manager.MtlBaseTaskAction)2 File (java.io.File)2 HashSet (java.util.HashSet)2 TaskAction (org.gradle.api.tasks.TaskAction)2 AndroidLibrary (com.android.builder.model.AndroidLibrary)1 JavaLibrary (com.android.builder.model.JavaLibrary)1 MavenCoordinates (com.android.builder.model.MavenCoordinates)1 AtlasDependencyTree (com.taobao.android.builder.dependency.AtlasDependencyTree)1 DependencyDiff (com.taobao.android.builder.dependency.diff.DependencyDiff)1 AwbBundle (com.taobao.android.builder.dependency.model.AwbBundle)1 SoLibrary (com.taobao.android.builder.dependency.model.SoLibrary)1 ResolvedDependencyInfo (com.taobao.android.builder.dependency.parser.ResolvedDependencyInfo)1 AtlasExtensionOutput (com.taobao.android.builder.tools.guide.AtlasExtensionOutput)1 IOException (java.io.IOException)1 URL (java.net.URL)1 URLClassLoader (java.net.URLClassLoader)1 ArrayList (java.util.ArrayList)1 GradleException (org.gradle.api.GradleException)1