Skip to content

Commit 10077fc

Browse files
Upgrades to Java 11, Gradle 8.9, AGP 8.6.1, and Kotlin 1.9.25 (#263)
* Upgrades to Java 11, Gradle 8.9, AGP 8.6.1, and Kotlin 1.9.25 * Update to 0.4.0-SNAPSHOT * Update Github Actions to JDK 17 * Fix jvm toolchain * Add namespace * Fix more sample app gradle config * Update tests
1 parent d89407b commit 10077fc

File tree

22 files changed

+295
-190
lines changed

22 files changed

+295
-190
lines changed

.github/workflows/ci_test_and_publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: actions/setup-java@v3
2424
with:
2525
distribution: 'zulu'
26-
java-version: '11'
26+
java-version: '17'
2727

2828
- name: Upload Artifacts
2929
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel
@@ -60,7 +60,7 @@ jobs:
6060
uses: actions/setup-java@v3
6161
with:
6262
distribution: 'zulu'
63-
java-version: '11'
63+
java-version: '17'
6464
- name: Run tests
6565
uses: reactivecircus/android-emulator-runner@v2
6666
with:

.github/workflows/sample_app.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
uses: actions/setup-java@v3
2121
with:
2222
distribution: 'zulu'
23-
java-version: '11'
23+
java-version: '17'
2424
- name: Build sample
2525
run: |
2626
./gradlew :affectedmoduledetector:publishToMavenLocal

affectedmoduledetector/build.gradle

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ plugins {
99
apply from: rootProject.file("gradle/jacoco.gradle")
1010

1111
java {
12-
sourceCompatibility = JavaVersion.VERSION_1_8
13-
targetCompatibility = JavaVersion.VERSION_1_8
12+
sourceCompatibility = JavaVersion.VERSION_11
13+
targetCompatibility = JavaVersion.VERSION_11
14+
}
15+
16+
kotlin {
17+
jvmToolchain(11)
1418
}
1519

1620
jacoco {
17-
toolVersion = "0.8.8"
21+
toolVersion = "0.8.10"
1822
}
1923

2024
gradlePlugin {

affectedmoduledetector/src/main/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetectorPlugin.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import org.gradle.api.Plugin
88
import org.gradle.api.Project
99
import org.gradle.api.Task
1010
import org.gradle.api.tasks.testing.Test
11-
import org.gradle.internal.impldep.org.jetbrains.annotations.VisibleForTesting
1211
import org.gradle.util.GradleVersion
12+
import org.jetbrains.annotations.VisibleForTesting
1313

1414
/**
1515
* This plugin creates and registers all affected test tasks.

affectedmoduledetector/src/test/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetectorIntegrationTest.kt

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ class AffectedModuleDetectorIntegrationTest {
6060
| jcenter()
6161
| }
6262
| dependencies {
63-
| classpath "com.android.tools.build:gradle:4.1.0"
64-
| classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
63+
| classpath "com.android.tools.build:gradle:7.4.0"
64+
| classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25"
6565
| }
6666
|}
6767
|plugins {
@@ -81,14 +81,22 @@ class AffectedModuleDetectorIntegrationTest {
8181
| id 'kotlin-android'
8282
| }
8383
| android {
84-
| compileSdkVersion 30
85-
| buildToolsVersion "30.0.2"
84+
| compileSdkVersion 33
85+
| namespace "sample"
8686
| }
8787
| dependencies {
8888
| implementation project(":sample-core")
8989
| }""".trimMargin()
9090
)
9191

92+
tmpFolder.newFolder("sample-app/src/main/")
93+
tmpFolder.newFile("sample-app/src/main/AndroidManifest.xml").writeText(
94+
"""
95+
|<manifest>
96+
|</manifest>
97+
""".trimMargin()
98+
)
99+
92100
tmpFolder.newFile("sample-core/build.gradle").writeText(
93101
"""plugins {
94102
| id 'com.android.library'
@@ -98,11 +106,19 @@ class AffectedModuleDetectorIntegrationTest {
98106
| assembleAndroidTestTask = "assembleAndroidTest"
99107
| }
100108
| android {
101-
| compileSdkVersion 30
102-
| buildToolsVersion "30.0.2"
109+
| namespace 'sample.core'
110+
| compileSdkVersion 33
103111
| }""".trimMargin()
104112
)
105113

114+
tmpFolder.newFolder("sample-core/src/main/")
115+
tmpFolder.newFile("sample-core/src/main/AndroidManifest.xml").writeText(
116+
"""
117+
|<manifest>
118+
|</manifest>
119+
""".trimMargin()
120+
)
121+
106122
// WHEN
107123
val result = GradleRunner.create()
108124
.withProjectDir(tmpFolder.root)
@@ -138,8 +154,8 @@ class AffectedModuleDetectorIntegrationTest {
138154
| jcenter()
139155
| }
140156
| dependencies {
141-
| classpath "com.android.tools.build:gradle:4.1.0"
142-
| classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
157+
| classpath "com.android.tools.build:gradle:7.4.0"
158+
| classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25"
143159
| }
144160
|}
145161
|plugins {
@@ -162,14 +178,22 @@ class AffectedModuleDetectorIntegrationTest {
162178
| id 'kotlin-android'
163179
| }
164180
| android {
165-
| compileSdkVersion 30
166-
| buildToolsVersion "30.0.2"
181+
| namespace 'sample'
182+
| compileSdkVersion 33
167183
| }
168184
| dependencies {
169185
| implementation project(":sample-core")
170186
| }""".trimMargin()
171187
)
172188

189+
tmpFolder.newFolder("sample-app/src/main/")
190+
tmpFolder.newFile("sample-app/src/main/AndroidManifest.xml").writeText(
191+
"""
192+
|<manifest>
193+
|</manifest>
194+
""".trimMargin()
195+
)
196+
173197
tmpFolder.newFile("sample-core/build.gradle").writeText(
174198
"""plugins {
175199
| id 'com.android.library'
@@ -179,11 +203,19 @@ class AffectedModuleDetectorIntegrationTest {
179203
| assembleAndroidTestTask = "assembleAndroidTest"
180204
| }
181205
| android {
182-
| compileSdkVersion 30
183-
| buildToolsVersion "30.0.2"
206+
| namespace 'sample.core'
207+
| compileSdkVersion 33
184208
| }""".trimMargin()
185209
)
186210

211+
tmpFolder.newFolder("sample-core/src/main/")
212+
tmpFolder.newFile("sample-core/src/main/AndroidManifest.xml").writeText(
213+
"""
214+
|<manifest>
215+
|</manifest>
216+
""".trimMargin()
217+
)
218+
187219
// WHEN
188220
val result = GradleRunner.create()
189221
.withProjectDir(tmpFolder.root)

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
buildscript {
3-
ext.kotlin_version = "1.6.20"
3+
ext.kotlin_version = "1.9.25"
44
repositories {
55
google()
66
mavenCentral()
@@ -9,10 +9,10 @@ buildscript {
99
}
1010
}
1111
dependencies {
12-
classpath "com.android.tools.build:gradle:7.3.1"
12+
classpath "com.android.tools.build:gradle:8.6.1"
1313
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14-
classpath("org.jlleitschuh.gradle:ktlint-gradle:10.2.1")
15-
classpath("org.jacoco:org.jacoco.core:0.8.8")
14+
classpath("org.jlleitschuh.gradle:ktlint-gradle:11.4.2")
15+
classpath("org.jacoco:org.jacoco.core:0.8.10")
1616
classpath "com.vanniktech:gradle-maven-publish-plugin:0.19.0"
1717
}
1818
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ kotlin.code.style=official
2222

2323
# POM
2424
GROUP = com.dropbox.affectedmoduledetector
25-
VERSION_NAME=0.3.2-SNAPSHOT
25+
VERSION_NAME=0.4.0-SNAPSHOT
2626

2727
POM_ARTIFACT_ID = affectedmoduledetector
2828
POM_NAME = Affected Module Detector

gradle/jacoco.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ project.afterEvaluate {
4747
executionData.setFrom files(coverageData)
4848

4949
reports {
50-
xml.enabled = true
50+
xml.required = true
5151
xml.destination = file("${buildDir}/reports/jacoco/report.xml")
52-
html.enabled = true
52+
html.required = true
5353
}
5454
}
5555

gradle/wrapper/gradle-wrapper.jar

5.36 KB
Binary file not shown.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Thu Oct 15 15:49:37 PDT 2020
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip

0 commit comments

Comments
 (0)