Search in sources :

Example 1 with MultiDexConfig

use of com.taobao.android.builder.extension.MultiDexConfig in project atlas by alibaba.

the class FastDexMergeTest method testB.

private void testB(Collection<File> files) throws IOException {
    MultiDexConfig multiDexConfig = new MultiDexConfig("debug");
    multiDexConfig.setDexCount(3);
    DexMerger dexMerger = new DexMerger(multiDexConfig, files);
    List<DexGroup> dexDtos = dexMerger.group();
    // System.out.println(JSON.toJSONString(dexDtos,true));
    System.out.println(dexDtos.size());
    System.out.println(dexMerger.dexList.size());
}
Also used : DexGroup(com.taobao.android.builder.tools.multidex.dex.DexGroup) DexMerger(com.taobao.android.builder.tools.multidex.dex.DexMerger) MultiDexConfig(com.taobao.android.builder.extension.MultiDexConfig)

Example 2 with MultiDexConfig

use of com.taobao.android.builder.extension.MultiDexConfig in project atlas by alibaba.

the class FastDexMergeTest method testA.

private void testA(Collection<File> files) throws IOException {
    MultiDexConfig multiDexConfig = new MultiDexConfig("debug");
    DexMerger dexMerger = new DexMerger(multiDexConfig, files);
    List<DexGroup> dexDtos = dexMerger.group();
    // System.out.println(JSON.toJSONString(dexDtos,true));
    System.out.println(dexDtos.size());
    System.out.println(dexMerger.dexList.size());
}
Also used : DexGroup(com.taobao.android.builder.tools.multidex.dex.DexGroup) DexMerger(com.taobao.android.builder.tools.multidex.dex.DexMerger) MultiDexConfig(com.taobao.android.builder.extension.MultiDexConfig)

Example 3 with MultiDexConfig

use of com.taobao.android.builder.extension.MultiDexConfig in project atlas by alibaba.

the class FastDexMergeTest method testC.

private void testC(Collection<File> files) throws IOException {
    MultiDexConfig multiDexConfig = new MultiDexConfig("debug");
    // multiDexConfig.setDexSplitRules("a12312,123213;c123123,d123123;ee123123");
    // multiDexConfig.setDexCount(3);
    DexMerger dexMerger = new DexMerger(multiDexConfig, files);
    List<DexGroup> dexDtos = dexMerger.group();
    System.out.println(dexDtos.size());
    System.out.println(dexMerger.dexList.size());
    FileUtils.deleteDirectory(new File("/Users/wuzhong/Downloads/dex"));
    new File("/Users/wuzhong/Downloads/dex").mkdirs();
    dexMerger.executeMerge(new File("/Users/wuzhong/Downloads/dex"), dexDtos);
}
Also used : DexGroup(com.taobao.android.builder.tools.multidex.dex.DexGroup) DexMerger(com.taobao.android.builder.tools.multidex.dex.DexMerger) File(java.io.File) MultiDexConfig(com.taobao.android.builder.extension.MultiDexConfig)

Example 4 with MultiDexConfig

use of com.taobao.android.builder.extension.MultiDexConfig in project atlas by alibaba.

the class PostProcessManifestAction method isMultiDexEnabled.

private boolean isMultiDexEnabled() {
    boolean isMultiDex = false;
    for (BuildType buildType : appVariantContext.getAppExtension().getBuildTypes()) {
        if (buildType.getName().equals(baseVariantOutputData.getName())) {
            isMultiDex = (null != buildType.getMultiDexEnabled()) ? buildType.getMultiDexEnabled() : false;
            break;
        }
    }
    MultiDexConfig multiDexConfig = (MultiDexConfig) appVariantContext.getAtlasExtension().getMultiDexConfigs().findByName(appVariantContext.getBuildType().getName());
    boolean fastMultiDex = null != multiDexConfig && multiDexConfig.isFastMultiDex();
    return isMultiDex || fastMultiDex;
}
Also used : BuildType(com.android.build.gradle.internal.dsl.BuildType) MultiDexConfig(com.taobao.android.builder.extension.MultiDexConfig)

Aggregations

MultiDexConfig (com.taobao.android.builder.extension.MultiDexConfig)4 DexGroup (com.taobao.android.builder.tools.multidex.dex.DexGroup)3 DexMerger (com.taobao.android.builder.tools.multidex.dex.DexMerger)3 BuildType (com.android.build.gradle.internal.dsl.BuildType)1 File (java.io.File)1