Skip to content

Commit 8570df2

Browse files
authored
Gradle 6 & raise minimum AGP to 3.5.0 (#206)
* Official Gradle Wrapper Validation Action See: https://github.com/gradle/wrapper-validation-action *
1 parent e078b5b commit 8570df2

File tree

36 files changed

+53
-364
lines changed

36 files changed

+53
-364
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: "Validate Gradle Wrapper"
2+
on: [push, pull_request]
3+
4+
jobs:
5+
validation:
6+
name: "Validation"
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: gradle/wrapper-validation-action@v1

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
![Logo](.images/logo.png)
99

10-
A Gradle plugin that allows for the execution of [JUnit 5][junit5gh] tests in Android environments using **Android Gradle Plugin 3.2.0 or later.**
10+
A Gradle plugin that allows for the execution of [JUnit 5][junit5gh] tests in Android environments using **Android Gradle Plugin 3.5.0 or later.**
1111

1212
## How?
1313

@@ -56,15 +56,15 @@ Snapshots of the development version are available through [Sonatype's `snapshot
5656
5757
dependencies {
5858
// (Required) Writing and executing Unit Tests on the JUnit Platform
59-
testImplementation "org.junit.jupiter:junit-jupiter-api:5.5.2"
60-
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.5.2"
59+
testImplementation "org.junit.jupiter:junit-jupiter-api:5.6.0"
60+
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.6.0"
6161
6262
// (Optional) If you need "Parameterized Tests"
63-
testImplementation "org.junit.jupiter:junit-jupiter-params:5.5.2"
63+
testImplementation "org.junit.jupiter:junit-jupiter-params:5.6.0"
6464
6565
// (Optional) If you also have JUnit 4-based tests
66-
testImplementation "junit:junit:4.12"
67-
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:5.5.2"
66+
testImplementation "junit:junit:4.13"
67+
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:5.6.0"
6868
}
6969
```
7070
</details>
@@ -79,15 +79,15 @@ Snapshots of the development version are available through [Sonatype's `snapshot
7979

8080
dependencies {
8181
// (Required) Writing and executing Unit Tests on the JUnit Platform
82-
testImplementation("org.junit.jupiter:junit-jupiter-api:5.5.2")
83-
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.5.2")
82+
testImplementation("org.junit.jupiter:junit-jupiter-api:5.6.0")
83+
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.6.0")
8484

8585
// (Optional) If you need "Parameterized Tests"
86-
testImplementation("org.junit.jupiter:junit-jupiter-params:5.5.2")
86+
testImplementation("org.junit.jupiter:junit-jupiter-params:5.6.0")
8787

8888
// (Optional) If you also have JUnit 4-based tests
89-
testImplementation("junit:junit:4.12")
90-
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.5.2")
89+
testImplementation("junit:junit:4.13")
90+
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.6.0")
9191
}
9292
```
9393
</details>
@@ -99,8 +99,8 @@ More information on Getting Started can be found [on the wiki][wiki-gettingstart
9999
## Requirements
100100

101101
The latest version of this plugin requires:
102-
* Android Gradle Plugin `3.2.0` or above
103-
* Gradle `4.7` or above
102+
* Android Gradle Plugin `3.5.0` or above
103+
* Gradle `6.1.1` or above
104104

105105
## Instrumentation Test Support
106106

@@ -135,7 +135,7 @@ To start writing instrumentation tests with JUnit Jupiter, make the following ch
135135
dependencies {
136136
// 5) Jupiter API & Test Runner, if you don't have it already
137137
androidTestImplementation "androidx.test:runner:1.2.0"
138-
androidTestImplementation "org.junit.jupiter:junit-jupiter-api:5.5.2"
138+
androidTestImplementation "org.junit.jupiter:junit-jupiter-api:5.6.0"
139139
140140
// 6) The instrumentation test companion libraries
141141
androidTestImplementation "de.mannodermaus.junit5:android-test-core:1.2.0"
@@ -170,7 +170,7 @@ To start writing instrumentation tests with JUnit Jupiter, make the following ch
170170
dependencies {
171171
// 5) Jupiter API & Test Runner, if you don't have it already
172172
androidTestImplementation("androidx.test:runner:1.2.0")
173-
androidTestImplementation("org.junit.jupiter:junit-jupiter-api:5.5.2")
173+
androidTestImplementation("org.junit.jupiter:junit-jupiter-api:5.6.0")
174174
175175
// 6) The instrumentation test companion libraries
176176
androidTestImplementation("de.mannodermaus.junit5:android-test-core:1.2.0")
@@ -199,7 +199,7 @@ This repository contains multiple modules, divided into two sub-projects. The re
199199
## License
200200

201201
```
202-
Copyright 2017-2019 Marcel Schnelle
202+
Copyright 2017-2020 Marcel Schnelle
203203
204204
Licensed under the Apache License, Version 2.0 (the "License");
205205
you may not use this file except in compliance with the License.

README.md.template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![Logo](.images/logo.png)
44

5-
A Gradle plugin that allows for the execution of [JUnit 5][junit5gh] tests in Android environments using **Android Gradle Plugin 3.2.0 or later.**
5+
A Gradle plugin that allows for the execution of [JUnit 5][junit5gh] tests in Android environments using **Android Gradle Plugin 3.5.0 or later.**
66

77
## How?
88

@@ -94,8 +94,8 @@ More information on Getting Started can be found [on the wiki][wiki-gettingstart
9494
## Requirements
9595

9696
The latest version of this plugin requires:
97-
* Android Gradle Plugin `3.2.0` or above
98-
* Gradle `4.7` or above
97+
* Android Gradle Plugin `3.5.0` or above
98+
* Gradle `6.1.1` or above
9999

100100
## Instrumentation Test Support
101101

buildSrc/src/main/kotlin/Libs.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ object Libs {
3434
* https://developer.android.com/studio */
3535
const val com_android_tools_build_gradle: String = "com.android.tools.build:gradle:" +
3636
Versions.com_android_tools_build_gradle
37-
const val com_android_tools_build_gradle_32x: String = "com.android.tools.build:gradle:" +
38-
Versions.com_android_tools_build_gradle_32x
39-
const val com_android_tools_build_gradle_33x: String = "com.android.tools.build:gradle:" +
40-
Versions.com_android_tools_build_gradle_33x
41-
const val com_android_tools_build_gradle_34x: String = "com.android.tools.build:gradle:" +
42-
Versions.com_android_tools_build_gradle_34x
4337
const val com_android_tools_build_gradle_35x: String = "com.android.tools.build:gradle:" +
4438
Versions.com_android_tools_build_gradle_35x
4539
const val com_android_tools_build_gradle_36x: String = "com.android.tools.build:gradle:" +

buildSrc/src/main/kotlin/Versions.kt

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,14 @@ object Versions {
1313
const val androidx_test_monitor: String = "1.2.0"
1414
const val androidx_test_runner: String = "1.2.0"
1515

16-
const val aapt2: String = "3.2.1-4818971"
16+
const val aapt2: String = "3.5.0-5435860"
1717

18-
const val com_android_tools_build_gradle_32x: String = "3.2.1"
19-
const val com_android_tools_build_gradle_33x: String = "3.3.2"
20-
const val com_android_tools_build_gradle_34x: String = "3.4.2"
21-
const val com_android_tools_build_gradle_35x: String = "3.5.1"
22-
const val com_android_tools_build_gradle_36x: String = "3.6.0-beta01"
23-
const val com_android_tools_build_gradle_40x: String = "4.0.0-alpha01"
24-
const val com_android_tools_build_gradle: String = "3.4.2"
18+
const val com_android_tools_build_gradle_35x: String = "3.5.0"
19+
const val com_android_tools_build_gradle_36x: String = "3.6.0"
20+
const val com_android_tools_build_gradle_40x: String = "4.0.0-beta01"
21+
const val com_android_tools_build_gradle: String = com_android_tools_build_gradle_35x
2522

26-
const val lint_gradle: String = "26.2.1"
23+
const val lint_gradle: String = "26.5.0"
2724

2825
const val stream: String = "1.2.1"
2926

@@ -57,7 +54,7 @@ object Versions {
5754

5855
const val assertj_core: String = "3.11.1"
5956

60-
const val org_jetbrains_kotlin: String = "1.3.21"
57+
const val org_jetbrains_kotlin: String = "1.3.61"
6158

6259
const val org_jetbrains_spek: String = "1.2.1"
6360

@@ -75,14 +72,4 @@ object Versions {
7572
const val mockito_core: String = "2.19.0"
7673

7774
const val mockito_kotlin: String = "2.1.0"
78-
79-
object Gradle {
80-
const val runningVersion: String = "5.0"
81-
82-
const val currentVersion: String = "5.0"
83-
84-
const val nightlyVersion: String = "5.2-20181230000028+0000"
85-
86-
const val releaseCandidate: String = "5.1-rc-3"
87-
}
8875
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

plugin/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ Change Log
44
## Unreleased
55

66
#### Added
7+
- JUnit 5.6.0
78
- Compatibility with Android Gradle Plugin 4.x versions
8-
- Compatibility with Gradle 6
9+
- Compatibility with Gradle 6; also raised minimum supported version to Gradle 6.1.1
910
#### Changed
1011
#### Fixed
1112
#### Removed

plugin/android-junit5/build.gradle.kts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,12 @@ tasks.named("processTestResources", Copy::class.java).configure {
6464
"MIN_SDK_VERSION" to Android.sampleMinSdkVersion.toString(),
6565
"TARGET_SDK_VERSION" to Android.targetSdkVersion.toString(),
6666

67-
"AGP_32X" to Versions.com_android_tools_build_gradle_32x,
68-
"AGP_33X" to Versions.com_android_tools_build_gradle_33x,
69-
"AGP_34X" to Versions.com_android_tools_build_gradle_34x,
7067
"AGP_35X" to Versions.com_android_tools_build_gradle_35x,
7168
"AGP_36X" to Versions.com_android_tools_build_gradle_36x,
7269
"AGP_40X" to Versions.com_android_tools_build_gradle_40x,
7370
"KOTLIN" to Versions.org_jetbrains_kotlin,
7471

72+
"KOTLIN_STD_LIB" to Libs.kotlin_stdlib,
7573
"JUPITER_API" to Libs.junit_jupiter_api,
7674
"JUPITER_ENGINE" to Libs.junit_jupiter_engine
7775
)
@@ -112,9 +110,6 @@ data class AgpConfiguration(val version: String, val dependency: String) {
112110
}
113111

114112
private val agpConfigurations = listOf(
115-
AgpConfiguration("3.2", Libs.com_android_tools_build_gradle_32x),
116-
AgpConfiguration("3.3", Libs.com_android_tools_build_gradle_33x),
117-
AgpConfiguration("3.4", Libs.com_android_tools_build_gradle_34x),
118113
AgpConfiguration("3.5", Libs.com_android_tools_build_gradle_35x),
119114
AgpConfiguration("3.6", Libs.com_android_tools_build_gradle_36x),
120115
AgpConfiguration("4.0", Libs.com_android_tools_build_gradle_40x)

plugin/android-junit5/src/main/kotlin/de/mannodermaus/gradle/plugins/junit5/Constants.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package de.mannodermaus.gradle.plugins.junit5
22

3-
const val MIN_REQUIRED_GRADLE_VERSION = "4.7"
4-
const val MIN_REQUIRED_AGP_VERSION = "3.2.0"
3+
const val MIN_REQUIRED_GRADLE_VERSION = "6.1.1"
4+
const val MIN_REQUIRED_AGP_VERSION = "3.5.0"
55

66
const val EXTENSION_NAME = "junitPlatform"
77
const val FILTERS_EXTENSION_NAME = "filters"

plugin/android-junit5/src/test/kotlin/de/mannodermaus/gradle/plugins/junit5/FunctionalTests.kt

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -44,33 +44,6 @@ class FunctionalTests {
4444
with(result) {
4545
@Suppress("UNUSED_VARIABLE")
4646
val u: Any = when (agpVersion) {
47-
// ------------------------------------------------------------------------------------------------
48-
// AGP 3.2
49-
// - Build Types
50-
// ------------------------------------------------------------------------------------------------
51-
AgpVersion.AGP_32X -> {
52-
assertAgpTests(buildType = "debug", tests = listOf("JavaTest"))
53-
assertAgpTests(buildType = "release", tests = listOf("JavaTest", "KotlinReleaseTest"))
54-
}
55-
// ------------------------------------------------------------------------------------------------
56-
// AGP 3.3
57-
// - Simple
58-
// ------------------------------------------------------------------------------------------------
59-
AgpVersion.AGP_33X -> {
60-
assertAgpTests(buildType = "debug", tests = listOf("JavaTest"))
61-
assertAgpTests(buildType = "release", tests = listOf("JavaTest"))
62-
}
63-
// ------------------------------------------------------------------------------------------------
64-
// AGP 3.4
65-
// - Product Flavors
66-
// - Build Types
67-
// ------------------------------------------------------------------------------------------------
68-
AgpVersion.AGP_34X -> {
69-
assertAgpTests(buildType = "debug", productFlavor = "free", tests = listOf("JavaTest"))
70-
assertAgpTests(buildType = "debug", productFlavor = "paid", tests = listOf("JavaTest", "KotlinPaidDebugTest"))
71-
assertAgpTests(buildType = "release", productFlavor = "free", tests = listOf("JavaTest", "KotlinReleaseTest", "JavaFreeReleaseTest"))
72-
assertAgpTests(buildType = "release", productFlavor = "paid", tests = listOf("JavaTest", "KotlinReleaseTest"))
73-
}
7447
// ------------------------------------------------------------------------------------------------
7548
// AGP 3.5
7649
// - Product Flavors
@@ -166,7 +139,7 @@ class FunctionalTests {
166139
// Perform assertions
167140
assertThat(this).output().ofTask(taskName).apply {
168141
tests.forEach { expectedClass ->
169-
contains("de.mannodermaus.app.$expectedClass > test() PASSED")
142+
contains("$expectedClass > test() PASSED")
170143
}
171144
executedTestCount().isEqualTo(tests.size)
172145
}

0 commit comments

Comments
 (0)