aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2012-12-05 15:24:50 -0800
committerXavier Ducrohet <xav@android.com>2012-12-05 15:27:40 -0800
commita90b8efbabf82ef153c2a908e880a4f993f19ef4 (patch)
tree0ce199beaf1680d195b232912315efedfea539b2 /eclipse
parent6ecf7a13a0dc2dbdfce71c83d86328ec6c80b6e3 (diff)
downloadsdk-a90b8efbabf82ef153c2a908e880a4f993f19ef4.zip
sdk-a90b8efbabf82ef153c2a908e880a4f993f19ef4.tar.gz
sdk-a90b8efbabf82ef153c2a908e880a4f993f19ef4.tar.bz2
Add flag to disable dex merging.
with dex.disable.merger=true in the project.properties, it is now possible to revert to the old build mechanism where every jar files is always passed to dex during dex'ing instead of pre-dexing them only when they change. This is to go around some issue with dexmerger that are only triggered in some cases. Change-Id: I7288ae4e1ae02b088c2f74f2f63c819c6587016a
Diffstat (limited to 'eclipse')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtConstants.java3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/BuildHelper.java7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PostCompilerBuilder.java11
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/ExportHelper.java8
4 files changed, 21 insertions, 8 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtConstants.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtConstants.java
index f83bd3c..edfc30c 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtConstants.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtConstants.java
@@ -18,9 +18,9 @@ package com.android.ide.eclipse.adt;
import static com.android.SdkConstants.DOT_AIDL;
import static com.android.SdkConstants.DOT_DEP;
+import static com.android.SdkConstants.DOT_FS;
import static com.android.SdkConstants.DOT_JAVA;
import static com.android.SdkConstants.DOT_RS;
-import static com.android.SdkConstants.DOT_FS;
import com.android.SdkConstants;
import com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder;
@@ -223,4 +223,5 @@ public class AdtConstants {
public static final String DOC_HIDE = "@hide"; //$NON-NLS-1$
public static final String DEX_OPTIONS_FORCEJUMBO = "dex.force.jumbo"; //$NON-NLS-1$
+ public static final String DEX_OPTIONS_DISABLE_MERGER = "dex.disable.merger"; //$NON-NLS-1$
}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/BuildHelper.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/BuildHelper.java
index 5ffe2b3..c94ef9a 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/BuildHelper.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/BuildHelper.java
@@ -109,6 +109,7 @@ public class BuildHelper {
private final AndroidPrintStream mOutStream;
private final AndroidPrintStream mErrStream;
private final boolean mForceJumbo;
+ private final boolean mDisableDexMerger;
private final boolean mVerbose;
private final boolean mDebugMode;
@@ -140,7 +141,7 @@ public class BuildHelper {
public BuildHelper(@NonNull IProject project,
@NonNull AndroidPrintStream outStream,
@NonNull AndroidPrintStream errStream,
- boolean forceJumbo, boolean debugMode,
+ boolean forceJumbo, boolean disableDexMerger, boolean debugMode,
boolean verbose, ResourceMarker resMarker) throws CoreException {
mProject = project;
mOutStream = outStream;
@@ -148,6 +149,7 @@ public class BuildHelper {
mDebugMode = debugMode;
mVerbose = verbose;
mForceJumbo = forceJumbo;
+ mDisableDexMerger = disableDexMerger;
gatherPaths(resMarker);
}
@@ -712,13 +714,12 @@ public class BuildHelper {
// replace the libs by their dexed versions (dexing them if needed.)
List<String> finalInputPaths = new ArrayList<String>(inputPaths.size());
- if (inputPaths.size() == 1) {
+ if (mDisableDexMerger || inputPaths.size() == 1) {
// only one input, no need to put a pre-dexed version, even if this path is
// just a jar file (case for proguard'ed builds)
finalInputPaths.addAll(inputPaths);
} else {
-
for (String input : inputPaths) {
File inputFile = new File(input);
if (inputFile.isDirectory()) {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PostCompilerBuilder.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PostCompilerBuilder.java
index 3dfcd1e..6e3dce3 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PostCompilerBuilder.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/build/builders/PostCompilerBuilder.java
@@ -372,6 +372,7 @@ public class PostCompilerBuilder extends BaseBuilder {
BuildHelper helper = new BuildHelper(project,
mOutStream, mErrStream,
false /*jumbo mode doesn't matter here*/,
+ false /*dex merger doesn't matter here*/,
true /*debugMode*/,
AdtPrefs.getPrefs().getBuildVerbosity() == BuildVerbosity.VERBOSE,
mResourceMarker);
@@ -477,10 +478,16 @@ public class PostCompilerBuilder extends BaseBuilder {
if (mPackageResources || mConvertToDex || mBuildFinalPackage) {
String forceJumboStr = projectState.getProperty(
AdtConstants.DEX_OPTIONS_FORCEJUMBO);
- Boolean b = Boolean.valueOf(forceJumboStr);
+ Boolean jumbo = Boolean.valueOf(forceJumboStr);
+
+ String dexMergerStr = projectState.getProperty(
+ AdtConstants.DEX_OPTIONS_DISABLE_MERGER);
+ Boolean dexMerger = Boolean.valueOf(dexMergerStr);
+
BuildHelper helper = new BuildHelper(project,
mOutStream, mErrStream,
- b.booleanValue(),
+ jumbo.booleanValue(),
+ dexMerger.booleanValue(),
true /*debugMode*/,
AdtPrefs.getPrefs().getBuildVerbosity() == BuildVerbosity.VERBOSE,
mResourceMarker);
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/ExportHelper.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/ExportHelper.java
index d048f43..d215f2f 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/ExportHelper.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/ExportHelper.java
@@ -127,11 +127,15 @@ public final class ExportHelper {
// get the jumbo mode option
String forceJumboStr = projectState.getProperty(AdtConstants.DEX_OPTIONS_FORCEJUMBO);
- Boolean b = Boolean.valueOf(forceJumboStr);
+ Boolean jumbo = Boolean.valueOf(forceJumboStr);
+
+ String dexMergerStr = projectState.getProperty(AdtConstants.DEX_OPTIONS_DISABLE_MERGER);
+ Boolean dexMerger = Boolean.valueOf(dexMergerStr);
BuildHelper helper = new BuildHelper(project,
fakeStream, fakeStream,
- b.booleanValue(),
+ jumbo.booleanValue(),
+ dexMerger.booleanValue(),
debugMode, false /*verbose*/,
null /*resourceMarker*/);