Skip to content

Commit

Permalink
Enable dexcount plugin (#185)
Browse files Browse the repository at this point in the history
Count methods on each build with -PwithDexcount
  • Loading branch information
serj-lotutovici authored and artem-zinnatullin committed Jun 24, 2016
1 parent d33d7a4 commit af459fa
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
16 changes: 15 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ dependencies {

compile libraries.butterKnife
apt libraries.butterKnifeCompiler

compile libraries.picasso
compile libraries.picassoOkHttpDownloader
compile libraries.timber
Expand Down Expand Up @@ -181,3 +181,17 @@ configurations.all {
force libraries.supportAnnotations
}
}

// Check if the build requires dex count
def withDexcount = project.hasProperty('withDexcount')
if (withDexcount) {
apply plugin: 'com.getkeepsafe.dexcount'

dexcount {
format = 'list'
includeFieldCount = true
includeTotalMethodCount = true
verbose = false
maxTreeDepth = Integer.MAX_VALUE
}
}
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ buildscript {

// Catches common Java mistakes as compile-time errors.
classpath gradlePlugins.errorProne

// Method count plugin for android projects
classpath gradlePlugins.dexcount
}

// Part of workaround for Lint + Retrolambda.
Expand Down
2 changes: 1 addition & 1 deletion ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Please run it from root project directory

# This will: compile the project, run lint, run tests under JVM, package apk, check the code quality and run tests on the device/emulator.
./gradlew clean build connectedAndroidTest -PdisablePreDex
./gradlew clean build connectedAndroidTest -PdisablePreDex -PwithDexcount
2 changes: 2 additions & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ext.versions = [
androidDevMetricsGradlePlugin: '0.4',
errorProneVersion : '0.0.8',
errorProneCoreVersion : '2.0.9',
dexcountPlugin : '0.5.4',

dagger : '2.4',

Expand Down Expand Up @@ -56,6 +57,7 @@ ext.gradlePlugins = [
jacoco : "org.jacoco:org.jacoco.core:$versions.jacocoGradlePlugin",
androidDevMetrics: "com.frogermcs.androiddevmetrics:androiddevmetrics-plugin:$versions.androidDevMetricsGradlePlugin",
errorProne : "net.ltgt.gradle:gradle-errorprone-plugin:$versions.errorProneVersion",
dexcount : "com.getkeepsafe.dexcount:dexcount-gradle-plugin:$versions.dexcountPlugin",
]

ext.libraries = [
Expand Down

0 comments on commit af459fa

Please sign in to comment.