Skip to content

Commit

Permalink
Disable pre-dex for Circle CI builds
Browse files Browse the repository at this point in the history
Summary:
Pre-dexing is of no value in a CI environment likes Circle CI's which builds from a clean folder each time.

Disabling it should speed up the build and reduce its memory footprint.

Reviewed By: aagnes

Differential Revision: D3340565

fbshipit-source-id: b8a4a45e094a294ca938545d815309fd8c0e6989
  • Loading branch information
kirwan authored and Facebook Github Bot 8 committed May 24, 2016
1 parent 7386fe6 commit e0df705
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions build.gradle
Expand Up @@ -20,6 +20,7 @@ project.ext {
compileSdkVersion = COMPILE_SDK_VERSION.toInteger()
minSdkVersion = MIN_SDK_VERSION;
targetSdkVersion = TARGET_SDK_VERSION;
preDexLibs = !project.hasProperty('disablePreDex');
}

subprojects {
Expand Down Expand Up @@ -50,6 +51,14 @@ subprojects {
}
}
}

project.plugins.whenPluginAdded { plugin ->
if ("com.android.build.gradle.AppPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
} else if ("com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)) {
project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs
}
}
}

repositories {
Expand Down
2 changes: 2 additions & 0 deletions circle.yml
Expand Up @@ -6,6 +6,8 @@ machine:
environment:
PATH: $ANDROID_NDK:$PATH
test:
override:
- ./gradlew assembleDebug -PdisablePreDex
post:
# copy test report for Circle CI to display
- mkdir -p $CIRCLE_TEST_REPORTS/junit/
Expand Down

0 comments on commit e0df705

Please sign in to comment.