Skip to content

Commit 992848e

Browse files
Merge pull request #29 from tiembo/update_dependencies
Update dependencies and Gradle version
2 parents 617197f + 65678d6 commit 992848e

File tree

6 files changed

+34
-39
lines changed

6 files changed

+34
-39
lines changed

AndroidTestingBlueprint/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ A collection of Google's Android testing tools and frameworks, all integrated in
88
- `app/test/` - Unit tests
99
- `app/androidTest/` - Instrumentation tests
1010
- `app/androidTestFlavor2/` - Additional Instrumentation tests for Flavor2.
11-
- `module-flavor1-androidTest-only/` - Test-only module with Instrumentation tests for Flavor1
1211
- `module-android-library/` - An Android module (typically a library)
1312
- `module-android-library/androidTest` - Android Tests for the module-android-library
13+
- `module-flavor1-androidTest-only/` - Test-only module with Instrumentation tests for Flavor1
1414
- `module-plain-java/` - A Java module for non-Android code (business logic, utils classes, etc.)
1515
- `module-plain-java/test` - Unit tests for module-plain-java
1616

@@ -226,7 +226,7 @@ See [AndroidJUnitRunner](http://developer.android.com/reference/android/support/
226226
- Stack Overflow: http://stackoverflow.com/questions/tagged/android-testing
227227

228228
If you've found an error in this sample, please file an issue:
229-
https://github.com/googlesamples/android-testing-blueprint
229+
https://github.com/googlesamples/android-testing-templates/issues
230230

231231
## Contributions
232232
Patches are encouraged, and may be submitted by forking this project and

AndroidTestingBlueprint/app/build.gradle

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@ apply plugin: 'com.android.application'
22

33
android {
44
compileSdkVersion rootProject.ext.compileSdkVersion
5-
buildToolsVersion rootProject.ext.buildToolsVersion
6-
7-
/*
8-
Test only modules require other artifacts like the classes.jar to be published, so the test can
9-
reference the tested java sources and compile them correctly. In order to get all these
10-
artifacts published from the tested module publishNonDefault needs to be set to true.
11-
*/
12-
publishNonDefault true
135

146
defaultConfig {
157
minSdkVersion rootProject.ext.minSdkVersion
@@ -54,6 +46,8 @@ android {
5446
}
5547
}
5648

49+
flavorDimensions "defaultDimension"
50+
5751
productFlavors {
5852
flavor1 {
5953
applicationId 'com.example.android.testing.blueprint.flavor1'
@@ -74,34 +68,34 @@ android {
7468

7569
dependencies {
7670
// App's dependencies, including test
77-
compile 'com.android.support:appcompat-v7:' + rootProject.ext.supportLibVersion
71+
implementation 'com.android.support:appcompat-v7:' + rootProject.ext.supportLibVersion
7872

79-
compile project(':module-plain-java') // Optional module for non-Android code
80-
compile project(':module-android-library') // Optional module for additional Android code
73+
implementation project(':module-plain-java') // Optional module for non-Android code
74+
implementation project(':module-android-library') // Optional module for additional Android code
8175

8276
// Dependencies for local unit tests
83-
testCompile 'junit:junit:' + rootProject.ext.junitVersion
84-
testCompile 'org.mockito:mockito-all:' + rootProject.ext.mockitoVersion
85-
testCompile 'org.hamcrest:hamcrest-all:' + rootProject.ext.hamcrestVersion
77+
testImplementation 'junit:junit:' + rootProject.ext.junitVersion
78+
testImplementation 'org.mockito:mockito-all:' + rootProject.ext.mockitoVersion
79+
testImplementation 'org.hamcrest:hamcrest-all:' + rootProject.ext.hamcrestVersion
8680

8781
// Android Testing Support Library's runner and rules
88-
androidTestCompile 'com.android.support.test:runner:' + rootProject.ext.runnerVersion
89-
androidTestCompile 'com.android.support.test:rules:' + rootProject.ext.rulesVersion
82+
androidTestImplementation 'com.android.support.test:runner:' + rootProject.ext.runnerVersion
83+
androidTestImplementation 'com.android.support.test:rules:' + rootProject.ext.rulesVersion
9084

9185
// Espresso UI Testing
92-
androidTestCompile 'com.android.support.test.espresso:espresso-core:' + rootProject.ext.espressoVersion
86+
androidTestImplementation 'com.android.support.test.espresso:espresso-core:' + rootProject.ext.espressoVersion
9387

9488
// Espresso-Contrib, Intents and Web dependencies are not used in this project.
9589
/*
96-
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:' + rootProject.ext.espressoVersion
97-
androidTestCompile 'com.android.support.test.espresso:espresso-intents:' + rootProject.ext.espressoVersion
98-
androidTestCompile 'com.android.support.test.espresso:espresso-web:' + rootProject.ext.espressoVersion
90+
androidTestImplementation 'com.android.support.test.espresso:espresso-contrib:' + rootProject.ext.espressoVersion
91+
androidTestImplementation 'com.android.support.test.espresso:espresso-intents:' + rootProject.ext.espressoVersion
92+
androidTestImplementation 'com.android.support.test.espresso:espresso-web:' + rootProject.ext.espressoVersion
9993
*/
10094

10195
// UIAutomator Testing. Learn about this dependency in this projects README file.
102-
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:' + rootProject.ext.uiautomatorVersion
96+
androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:' + rootProject.ext.uiautomatorVersion
10397

10498
// Resolve conflicts between main and test APK:
105-
androidTestCompile "com.android.support:support-annotations:$rootProject.supportLibVersion"
99+
androidTestImplementation "com.android.support:support-annotations:$rootProject.supportLibVersion"
106100

107101
}

AndroidTestingBlueprint/build.gradle

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
buildscript {
44
repositories {
55
jcenter()
6+
google()
67
}
78
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.2.1'
9+
classpath 'com.android.tools.build:gradle:3.0.1'
910

1011
// NOTE: Do not place your application dependencies here; they belong
1112
// in the individual module build.gradle files
@@ -15,16 +16,16 @@ buildscript {
1516
allprojects {
1617
repositories {
1718
jcenter()
19+
google()
1820
}
1921
}
2022

2123
ext {
22-
minSdkVersion = 10
23-
targetSdkVersion = 25
24-
compileSdkVersion = 25
25-
buildToolsVersion = "25.0.1"
24+
minSdkVersion = 14
25+
targetSdkVersion = 27
26+
compileSdkVersion = 27
2627

27-
supportLibVersion = "25.0.1"
28+
supportLibVersion = "27.0.1"
2829
junitVersion = "4.12"
2930
mockitoVersion = "1.10.19"
3031
hamcrestVersion = "1.3"

AndroidTestingBlueprint/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3.1-all.zip

AndroidTestingBlueprint/module-android-library/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ apply plugin: 'com.android.library'
22

33
android {
44
compileSdkVersion rootProject.ext.compileSdkVersion
5-
buildToolsVersion rootProject.ext.buildToolsVersion
65

76
defaultConfig {
87
minSdkVersion rootProject.ext.minSdkVersion
@@ -21,6 +20,6 @@ android {
2120

2221
dependencies {
2322
// Android Testing Support Library's runner and rules
24-
androidTestCompile 'com.android.support.test:runner:' + rootProject.ext.runnerVersion
25-
androidTestCompile 'com.android.support.test:rules:' + rootProject.ext.rulesVersion
23+
androidTestImplementation 'com.android.support.test:runner:' + rootProject.ext.runnerVersion
24+
androidTestImplementation 'com.android.support.test:rules:' + rootProject.ext.rulesVersion
2625
}

AndroidTestingBlueprint/module-flavor1-androidTest-only/build.gradle

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ apply plugin: 'com.android.test' // A plugin used for test-only-modules
22

33
android {
44
compileSdkVersion rootProject.ext.compileSdkVersion
5-
buildToolsVersion rootProject.ext.buildToolsVersion
65

76
defaultConfig {
87
minSdkVersion rootProject.ext.minSdkVersion
98
targetSdkVersion rootProject.ext.targetSdkVersion
109

10+
// Only include the 'flavor1' product flavor from the 'defaultDimension' flavor dimension
11+
missingDimensionStrategy 'defaultDimension', 'flavor1'
12+
1113
// The package name of the test app
1214
testApplicationId 'com.example.android.testing.blueprint.test'
1315
// The Instrumentation test runner used to run tests.
@@ -17,12 +19,11 @@ android {
1719
// Set the target app project. The module specified here should contain the production code
1820
// test should run against.
1921
targetProjectPath ':app'
20-
targetVariant 'flavor1Debug'
2122
}
2223

2324
dependencies {
2425
// Android Testing Support Library's runner and rules and hamcrest matchers
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
26+
implementation 'com.android.support.test:runner:' + rootProject.ext.runnerVersion
27+
implementation 'com.android.support.test:rules:' + rootProject.ext.rulesVersion
28+
implementation 'org.hamcrest:hamcrest-core:' + rootProject.ext.hamcrestVersion
2829
}

0 commit comments

Comments
 (0)