Skip to content

Commit e2ea007

Browse files
committed
Merge pull request #10 from ycdev-fork/master
Add variables for build tools versions
2 parents 127b24b + a316749 commit e2ea007

File tree

5 files changed

+49
-30
lines changed

5 files changed

+49
-30
lines changed

AndroidTestingBlueprint/app/build.gradle

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 23
5-
buildToolsVersion '23.0.1'
4+
compileSdkVersion rootProject.ext.compileSdkVersion
5+
buildToolsVersion rootProject.ext.buildToolsVersion
66

77
/*
88
Test only modules require other artifacts like the classes.jar to be published, so the test can
@@ -12,9 +12,10 @@ android {
1212
publishNonDefault true
1313

1414
defaultConfig {
15+
minSdkVersion rootProject.ext.minSdkVersion
16+
targetSdkVersion rootProject.ext.targetSdkVersion
17+
1518
applicationId 'com.example.android.testing.blueprint'
16-
minSdkVersion 10
17-
targetSdkVersion 23
1819
versionCode 1
1920
versionName '1.0'
2021

@@ -67,30 +68,30 @@ android {
6768

6869
dependencies {
6970
// App's dependencies, including test
70-
compile 'com.android.support:appcompat-v7:23.0.1'
71+
compile 'com.android.support:appcompat-v7:' + rootProject.ext.supportLibVersion
7172

7273
compile project(':module-plain-java') // Optional module for non-Android code
7374
compile project(':module-android-library') // Optional module for additional Android code
7475

7576
// Dependencies for local unit tests
76-
testCompile 'junit:junit:4.12'
77-
testCompile 'org.mockito:mockito-all:1.10.19'
78-
testCompile 'org.hamcrest:hamcrest-all:1.3'
77+
testCompile 'junit:junit:' + rootProject.ext.junitVersion
78+
testCompile 'org.mockito:mockito-all:' + rootProject.ext.mockitoVersion
79+
testCompile 'org.hamcrest:hamcrest-all:' + rootProject.ext.hamcrestVersion
7980

8081
// Android Testing Support Library's runner and rules
81-
androidTestCompile 'com.android.support.test:runner:0.4'
82-
androidTestCompile 'com.android.support.test:rules:0.4'
82+
androidTestCompile 'com.android.support.test:runner:' + rootProject.ext.runnerVersion
83+
androidTestCompile 'com.android.support.test:rules:' + rootProject.ext.rulesVersion
8384

8485
// Espresso UI Testing
85-
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
86+
androidTestCompile 'com.android.support.test.espresso:espresso-core:' + rootProject.ext.espressoVersion
8687

8788
// Espresso-Contrib, Intents and Web dependencies are not used in this project.
8889
/*
89-
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.2.1'
90-
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.1'
91-
androidTestCompile 'com.android.support.test.espresso:espresso-web:2.2.1'
90+
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:' + rootProject.ext.espressoVersion
91+
androidTestCompile 'com.android.support.test.espresso:espresso-intents:' + rootProject.ext.espressoVersion
92+
androidTestCompile 'com.android.support.test.espresso:espresso-web:' + rootProject.ext.espressoVersion
9293
*/
9394

9495
// UIAutomator Testing. Learn about this dependency in this projects README file.
95-
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
96+
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:' + rootProject.ext.uiautomatorVersion
9697
}

AndroidTestingBlueprint/build.gradle

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,19 @@ allprojects {
1717
jcenter()
1818
}
1919
}
20+
21+
ext {
22+
minSdkVersion = 10
23+
targetSdkVersion = 23
24+
compileSdkVersion = 23
25+
buildToolsVersion = "23.0.1"
26+
27+
supportLibVersion = "23.0.1"
28+
junitVersion = "4.12"
29+
mockitoVersion = "1.10.19"
30+
hamcrestVersion = "1.3"
31+
runnerVersion = "0.4"
32+
rulesVersion = "0.4"
33+
espressoVersion = "2.2.1"
34+
uiautomatorVersion = "2.1.2"
35+
}
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
apply plugin: 'com.android.library'
22

33
android {
4-
compileSdkVersion 23
5-
buildToolsVersion "23.0.1"
4+
compileSdkVersion rootProject.ext.compileSdkVersion
5+
buildToolsVersion rootProject.ext.buildToolsVersion
66

77
defaultConfig {
8-
minSdkVersion 10
9-
targetSdkVersion 23
8+
minSdkVersion rootProject.ext.minSdkVersion
9+
targetSdkVersion rootProject.ext.targetSdkVersion
10+
1011
versionCode 1
1112
versionName "1.0"
1213

@@ -20,6 +21,6 @@ android {
2021

2122
dependencies {
2223
// Android Testing Support Library's runner and rules
23-
androidTestCompile 'com.android.support.test:runner:0.4'
24-
androidTestCompile 'com.android.support.test:rules:0.4'
24+
androidTestCompile 'com.android.support.test:runner:' + rootProject.ext.runnerVersion
25+
androidTestCompile 'com.android.support.test:rules:' + rootProject.ext.rulesVersion
2526
}
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
apply plugin: 'com.android.test' // A plugin used for test-only-modules
22

33
android {
4-
compileSdkVersion 23
5-
buildToolsVersion = '23.0.1'
4+
compileSdkVersion rootProject.ext.compileSdkVersion
5+
buildToolsVersion rootProject.ext.buildToolsVersion
66

77
defaultConfig {
8-
minSdkVersion 10
9-
targetSdkVersion 23
8+
minSdkVersion rootProject.ext.minSdkVersion
9+
targetSdkVersion rootProject.ext.targetSdkVersion
10+
1011
// The package name of the test app
1112
testApplicationId 'com.example.android.testing.blueprint.test'
1213
// The Instrumentation test runner used to run tests.
@@ -21,7 +22,7 @@ android {
2122

2223
dependencies {
2324
// Android Testing Support Library's runner and rules and hamcrest matchers
24-
compile 'com.android.support.test:runner:0.4'
25-
compile 'com.android.support.test:rules:0.4'
26-
compile 'org.hamcrest:hamcrest-core:1.3'
25+
compile 'com.android.support.test:runner:' + rootProject.ext.runnerVersion
26+
compile 'com.android.support.test:rules:' + rootProject.ext.rulesVersion
27+
compile 'org.hamcrest:hamcrest-core:' + rootProject.ext.hamcrestVersion
2728
}

AndroidTestingBlueprint/module-plain-java/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ targetCompatibility = 1.7
77

88
dependencies {
99
// Dependencies for local unit tests
10-
testCompile 'junit:junit:4.12'
11-
testCompile 'org.hamcrest:hamcrest-core:1.3'
10+
testCompile 'junit:junit:' + rootProject.ext.junitVersion
11+
testCompile 'org.hamcrest:hamcrest-core:' + rootProject.ext.hamcrestVersion
1212
}

0 commit comments

Comments
 (0)