मैं हाल ही में गूगल से नवीनतम उपकरण स्थापित मेरी एंड्रॉयड परियोजना के लिए:एंड्रॉइड बिल्ड टूल्स 1.1.0, यूनिट टेस्ट फ़ोल्डर?
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
}
}
allprojects {
repositories {
jcenter()
}
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "com.xxx"
minSdkVersion 10
targetSdkVersion 21
versionCode 200
versionName "2.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
signingConfigs {
debug {
...
}
release {
...
}
}
buildTypes {
release {
...
}
debug {
...
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
// ---- Tests with robolectric
testCompile 'com.google.guava:guava:14.0.1'
testCompile 'junit:junit:4.+'
testCompile 'org.robolectric:robolectric:2.4'
testCompile 'org.mockito:mockito-all:2.0.2-beta'
// ---- Tests with Espresso
androidTestCompile ('com.android.support.test.espresso:espresso-core:2.0') {
exclude module: 'hamcrest-core'
}
androidTestCompile 'org.hamcrest:hamcrest-core:1.1'
androidTestCompile 'org.hamcrest:hamcrest-integration:1.1'
androidTestCompile 'org.hamcrest:hamcrest-library:1.1'
androidTestCompile ('com.android.support.test:testing-support-lib:0.1') {
exclude module: 'hamcrest-core'
}
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.0'
androidTestCompile('junit:junit-dep:4.10') {
exclude module: 'hamcrest-core'
}
}
कहाँ है कि इससे पहले कि मैं JVM में मेरी robolectric परीक्षण चलाने के लिए com.github.jcandksolutions.gradle:android-unit-test:2.1.1
का उपयोग करते थे। गूगल के रूप में अपने नए निर्माण उपकरणों के लिए कहते हैं: "नए स्रोत फ़ोल्डर्स इकाई परीक्षण के रूप में पहचाना: आदि src/परीक्षण/जावा, src/testDebug/जावा, src/testMyFlavor/जावा" लेकिन जैसा कि आप नीचे देख सकते हैं, मेरा परीक्षण फ़ोल्डर स्रोत फ़ोल्डर के रूप में पहचाना नहीं गया है।
मैं यहाँ क्या याद कर रहा हूँ: यह नए निर्माण उपकरणों के साथ कोई और अधिक com.github.jcandksolutions.gradle:android-unit-test:2.1.1
के साथ काम किया है, लेकिन? धन्यवाद
सही जवाब है .. – StefMa