Unverified Commit ae148869 authored by Evan W. Patton's avatar Evan W. Patton Committed by GitHub

Implement multidex in the buildserver (#2187)

* Implement multidex in the buildserver

Change-Id: I1593438f80d59e9bcf6e7eb407ce902700bc67dc
parent 3757bc23
......@@ -193,7 +193,7 @@
<sysproperty key="file.encoding" value="UTF-8" />
<jvmarg value="-Djava.awt.headless=true" />
<arg value="--childProcessRamMb" />
<arg value="1024" />
<arg value="2048" />
<arg value="--inputZipFile" />
<arg value="${local.build.dir}/aiplayapp.zip" />
<arg value="--userName" />
......@@ -226,7 +226,7 @@
<sysproperty key="file.encoding" value="UTF-8" />
<jvmarg value="-Djava.awt.headless=true" />
<arg value="--childProcessRamMb" />
<arg value="1024" />
<arg value="2048" />
<arg value="--inputZipFile" />
<arg value="${local.build.dir}/aiplayapp.zip" />
<arg value="--userName" />
......@@ -264,7 +264,7 @@
<sysproperty key="file.encoding" value="UTF-8" />
<jvmarg value="-Djava.awt.headless=true" />
<arg value="--childProcessRamMb" />
<arg value="1024" />
<arg value="2048" />
<arg value="--inputZipFile" />
<arg value="${local.build.dir}/aiplayapp.zip" />
<arg value="--userName" />
......
......@@ -44,6 +44,8 @@ public class DexExecTask {
private int mChildProcessRamMb = 1024;
private boolean mDisableDexMerger = false;
private static Map<String, String> alreadyChecked = new HashMap<String, String>();
private String mainDexFile = null;
private boolean mPredex = true;
private static final Object semaphore = new Object(); // Used to protect dex cache creation
......@@ -66,6 +68,13 @@ public class DexExecTask {
mVerbose = verbose;
}
public void setMainDexClassesFile(String classList) {
mainDexFile = classList;
if (classList != null) {
mPredex = false;
}
}
/**
* Sets the value of the "output" attribute.
*
......@@ -79,6 +88,10 @@ public class DexExecTask {
mDexedLibs = dexedLibs;
}
public void setPredex(boolean predex) {
mPredex = predex;
}
/**
* Sets the value of the "nolocals" attribute.
*
......@@ -164,8 +177,10 @@ public class DexExecTask {
public boolean execute(List<File> paths) {
// pre dex libraries if needed
boolean successPredex = preDexLibraries(paths);
if (!successPredex) return false;
if (mPredex) {
boolean successPredex = preDexLibraries(paths);
if (!successPredex) return false;
}
System.out.println(String.format(
"Converting compiled files and external libraries into %1$s...", mOutput));
......@@ -189,6 +204,12 @@ public class DexExecTask {
commandLineList.add("--dex");
commandLineList.add("--positions=lines");
if (mainDexFile != null) {
commandLineList.add("--multi-dex");
commandLineList.add("--main-dex-list=" + mainDexFile);
commandLineList.add("--minimal-main-dex");
}
if (mNoLocals) {
commandLineList.add("--no-locals");
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment