Last active
August 29, 2015 14:07
-
-
Save KarlNosworthy/ca3649e8077693bd33dd to your computer and use it in GitHub Desktop.
A default build.gradle file for Android apps that includes dependency injection support, headless testing and mocks for CI and AssertJ to make testing sweeter.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.13.3' | |
classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.0' | |
classpath 'org.robolectric:robolectric-gradle-plugin:0.13.0' | |
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4' | |
} | |
} | |
apply plugin: 'android-sdk-manager' | |
apply plugin: 'com.android.application' | |
apply plugin: 'robolectric' | |
apply plugin: 'com.neenbedankt.android-apt' | |
dependencies { | |
apt 'com.squareup.dagger:dagger-compiler:1.2.2' | |
compile fileTree(dir: 'libs', include: ['*.jar']) | |
compile 'com.jakewharton:butterknife:5.1.2' | |
compile 'com.squareup.dagger:dagger:1.2.2' | |
provided 'com.squareup.assertj:assertj-android:1.0.0' | |
androidTestApt 'com.squareup.dagger:dagger-compiler:1.2.2' | |
androidTestCompile 'com.squareup.dagger:dagger-compiler:1.2.2' | |
androidTestCompile 'junit:junit:4.11' | |
androidTestCompile 'org.robolectric:robolectric:2.3' | |
androidTestCompile 'org.mockito:mockito-core:1.10.8' | |
} | |
android { | |
compileSdkVersion 20 | |
buildToolsVersion "20" | |
defaultConfig { | |
minSdkVersion 15 | |
targetSdkVersion 20 | |
} | |
buildTypes { | |
release { | |
runProguard true | |
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | |
} | |
} | |
lintOptions { | |
quiet true | |
abortOnError false | |
} | |
} | |
robolectric { | |
include '**/*Test.class' | |
ignoreFailures true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Extended to add in Android SDK bootstrapping of required dependencies where required.