-
Notifications
You must be signed in to change notification settings - Fork 302
/
Copy pathbuild.gradle
106 lines (84 loc) · 4.02 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
applicationId 'com.example.android.testing.blueprint'
versionCode 1
versionName '1.0'
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
/*
The Android Testing Support Library collects analytics to continuously improve the testing
experience. More specifically, it uploads a hash of the package name of the application
under test for each invocation. If you do not wish to upload this data, you can opt-out by
passing the following argument to the test runner: disableAnalytics "true".
*/
// testInstrumentationRunnerArguments disableAnalytics: 'true'
/*
Uncomment this to pass custom arguments to AndroidJUnitRunner. If uncommented the
custom argument "argument1" will be passed to AndroidJUnitRunner and make
AndroidLibraryModuleIntegrationTest fail.
*/
// testInstrumentationRunnerArgument "argument1", "make_test_fail"
}
buildTypes {
debug {
// Run code coverage reports by default on debug builds.
testCoverageEnabled = true
// Uncomment this to run test against a minified version of the production APK
/*
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
testProguardFile 'proguard-test-rules.pro'
*/
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
flavorDimensions "defaultDimension"
productFlavors {
flavor1 {
applicationId 'com.example.android.testing.blueprint.flavor1'
}
flavor2 {
applicationId 'com.example.android.testing.blueprint.flavor2'
}
}
// Always show the result of every unit test, even if it passes.
testOptions.unitTests.all {
testLogging {
events 'passed', 'skipped', 'failed', 'standardOut', 'standardError'
}
}
}
dependencies {
// App's dependencies, including test
implementation "androidx.appcompat:appcompat:$appcompatVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
implementation project(':module-plain-kotlin') // Optional module for non-Android code
implementation project(':module-android-library') // Optional module for additional Android code
// Dependencies for local unit tests
testImplementation "junit:junit:$rootProject.ext.junitVersion"
testImplementation "org.mockito:mockito-all:$rootProject.ext.mockitoVersion"
testImplementation "org.hamcrest:hamcrest-all:$rootProject.ext.hamcrestVersion"
// Android Testing Support Library's runner and rules
androidTestImplementation "androidx.test.ext:junit:1.1.1"
androidTestImplementation "androidx.test:rules:$rulesVersion"
// Espresso UI Testing
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion"
// Espresso-Contrib, Intents and Web dependencies are not used in this project.
/*
androidTestImplementation "com.android.support.test.espresso:espresso-contrib:$rootProject.ext.espressoVersion"
androidTestImplementation "com.android.support.test.espresso:espresso-intents:$rootProject.ext.espressoVersion"
androidTestImplementation "com.android.support.test.espresso:espresso-web:$rootProject.ext.espressoVersion"
*/
// UIAutomator Testing. Learn about this dependency in this projects README file.
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
// Resolve conflicts between main and test APK:
androidTestImplementation 'androidx.annotation:annotation:1.1.0'
}