Last active
December 30, 2015 13:59
-
-
Save noxi515/7839282 to your computer and use it in GitHub Desktop.
Mockitoテスト実行に成功したbuild.gradle Android Studio 0.3.7
Device: Galaxy Nexus 4.4 JCROM-2.0.2-20131128
This file contains hidden or 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.6.+' | |
} | |
} | |
apply plugin: 'android' | |
repositories { | |
mavenCentral() | |
} | |
android { | |
compileSdkVersion 19 | |
buildToolsVersion "19.0.0" | |
defaultConfig { | |
minSdkVersion 19 | |
targetSdkVersion 19 | |
testInstrumentationRunner "com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner" | |
} | |
compileOptions { | |
sourceCompatibility JavaVersion.VERSION_1_7 | |
targetCompatibility JavaVersion.VERSION_1_7 | |
} | |
buildTypes { | |
release { | |
runProguard false | |
proguardFile getDefaultProguardFile('proguard-android.txt') | |
} | |
} | |
productFlavors { | |
defaultFlavor { | |
proguardFile 'proguard-rules.txt' | |
} | |
} | |
} | |
// Library versions | |
ext.junitVersion = "4.11" | |
ext.hamcrestVersion = "1.1" | |
ext.dexmakerVersion = "1.0" | |
ext.mockitoVersion = "1.9.5" | |
ext.daggerVersion = "1.1.0" | |
dependencies { | |
compile 'com.google.code.gson:gson:2.2.4' | |
compile 'org.apache.commons:commons-lang3:3.1' | |
compile 'com.google.code.findbugs:jsr305:2.0.2' | |
compile "com.google.guava:guava:15.0" | |
// Dagger | |
compile("com.squareup.dagger:dagger:${daggerVersion}") { | |
exclude group: "junit" | |
exclude group: "org.easytesting" | |
} | |
compile "com.squareup.dagger:dagger-compiler:${daggerVersion}" | |
compile files("libs/nxdialog-1.0-SNAPSHOT.jar") | |
// Test | |
instrumentTestCompile("junit:junit:${junitVersion}") { | |
exclude group: 'org.hamcrest' | |
} | |
// instrumentTestCompile "org.hamcrest:hamcrest-all:${hamcrestVersion}" | |
instrumentTestCompile "org.hamcrest:hamcrest-core:${hamcrestVersion}" | |
instrumentTestCompile "org.hamcrest:hamcrest-integration:${hamcrestVersion}" | |
instrumentTestCompile "org.hamcrest:hamcrest-library:${hamcrestVersion}" | |
// Espresso | |
// https://code.google.com/p/android-test-kit/wiki/Espresso | |
instrumentTestCompile files('libs/espresso-1.0-SNAPSHOT.jar', | |
'libs/testrunner-1.0-SNAPSHOT.jar', | |
'libs/testrunner-runtime-1.0-SNAPSHOT.jar') | |
// Mockito | |
// 注) | |
// http://objenesis.org/download.htmlからobjenesis-tck-android-2.1.apkをダウンロードして | |
// テスト実行する端末にインストールすること | |
instrumentTestCompile "com.google.dexmaker:dexmaker:${dexmakerVersion}" | |
instrumentTestCompile("com.google.dexmaker:dexmaker-mockito:${dexmakerVersion}") { | |
exclude group: 'org.mockito' | |
} | |
instrumentTestCompile("org.mockito:mockito-core:${mockitoVersion}") { | |
exclude group: "org.hamcrest" | |
exclude group: "org.objenesis" | |
} | |
instrumentTestCompile "org.objenesis:objenesis:2.1" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment