Skip to content

Instantly share code, notes, and snippets.

@imbryk
Created November 4, 2014 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imbryk/d5bd6bb99c8d48e81fe3 to your computer and use it in GitHub Desktop.
Save imbryk/d5bd6bb99c8d48e81fe3 to your computer and use it in GitHub Desktop.
roblectric gradle
//Main module build file
apply plugin: 'com.android.application'
apply plugin: 'robolectric'
android {
packagingOptions {
exclude 'LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
defaultConfig {
applicationId "com.example.app"
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
}
}
sourceSets {
androidTest {
setRoot('src/test')
}
}
}
robolectric {
include '**/*Test.class'
}
dependencies {
repositories {
mavenCentral()
}
androidTestCompile 'org.hamcrest:hamcrest-integration:1.1'
androidTestCompile 'org.hamcrest:hamcrest-core:1.1'
androidTestCompile 'org.hamcrest:hamcrest-library:1.1'
androidTestCompile('junit:junit:4.11') {
exclude module: 'hamcrest-core'
}
androidTestCompile('org.robolectric:robolectric:2.3')
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.13.2'
classpath 'org.robolectric:robolectric-gradle-plugin:0.13.2'
}
}
allprojects {
repositories {
jcenter()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment