Skip to content

Commit

Permalink
Upgrades to Java 11, Gradle 8.9, AGP 8.6.1, and Kotlin 1.9.25 (#263)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
joshafeinberg authored Nov 6, 2024
1 parent d89407b commit 10077fc
Show file tree
Hide file tree
Showing 22 changed files with 295 additions and 190 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci_test_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
java-version: '17'

- name: Upload Artifacts
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-daemon --no-parallel
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
java-version: '17'
- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sample_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
java-version: '17'
- name: Build sample
run: |
./gradlew :affectedmoduledetector:publishToMavenLocal
Expand Down
10 changes: 7 additions & 3 deletions affectedmoduledetector/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ plugins {
apply from: rootProject.file("gradle/jacoco.gradle")

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

kotlin {
jvmToolchain(11)
}

jacoco {
toolVersion = "0.8.8"
toolVersion = "0.8.10"
}

gradlePlugin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.tasks.testing.Test
import org.gradle.internal.impldep.org.jetbrains.annotations.VisibleForTesting
import org.gradle.util.GradleVersion
import org.jetbrains.annotations.VisibleForTesting

/**
* This plugin creates and registers all affected test tasks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ class AffectedModuleDetectorIntegrationTest {
| jcenter()
| }
| dependencies {
| classpath "com.android.tools.build:gradle:4.1.0"
| classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
| classpath "com.android.tools.build:gradle:7.4.0"
| classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25"
| }
|}
|plugins {
Expand All @@ -81,14 +81,22 @@ class AffectedModuleDetectorIntegrationTest {
| id 'kotlin-android'
| }
| android {
| compileSdkVersion 30
| buildToolsVersion "30.0.2"
| compileSdkVersion 33
| namespace "sample"
| }
| dependencies {
| implementation project(":sample-core")
| }""".trimMargin()
)

tmpFolder.newFolder("sample-app/src/main/")
tmpFolder.newFile("sample-app/src/main/AndroidManifest.xml").writeText(
"""
|<manifest>
|</manifest>
""".trimMargin()
)

tmpFolder.newFile("sample-core/build.gradle").writeText(
"""plugins {
| id 'com.android.library'
Expand All @@ -98,11 +106,19 @@ class AffectedModuleDetectorIntegrationTest {
| assembleAndroidTestTask = "assembleAndroidTest"
| }
| android {
| compileSdkVersion 30
| buildToolsVersion "30.0.2"
| namespace 'sample.core'
| compileSdkVersion 33
| }""".trimMargin()
)

tmpFolder.newFolder("sample-core/src/main/")
tmpFolder.newFile("sample-core/src/main/AndroidManifest.xml").writeText(
"""
|<manifest>
|</manifest>
""".trimMargin()
)

// WHEN
val result = GradleRunner.create()
.withProjectDir(tmpFolder.root)
Expand Down Expand Up @@ -138,8 +154,8 @@ class AffectedModuleDetectorIntegrationTest {
| jcenter()
| }
| dependencies {
| classpath "com.android.tools.build:gradle:4.1.0"
| classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
| classpath "com.android.tools.build:gradle:7.4.0"
| classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25"
| }
|}
|plugins {
Expand All @@ -162,14 +178,22 @@ class AffectedModuleDetectorIntegrationTest {
| id 'kotlin-android'
| }
| android {
| compileSdkVersion 30
| buildToolsVersion "30.0.2"
| namespace 'sample'
| compileSdkVersion 33
| }
| dependencies {
| implementation project(":sample-core")
| }""".trimMargin()
)

tmpFolder.newFolder("sample-app/src/main/")
tmpFolder.newFile("sample-app/src/main/AndroidManifest.xml").writeText(
"""
|<manifest>
|</manifest>
""".trimMargin()
)

tmpFolder.newFile("sample-core/build.gradle").writeText(
"""plugins {
| id 'com.android.library'
Expand All @@ -179,11 +203,19 @@ class AffectedModuleDetectorIntegrationTest {
| assembleAndroidTestTask = "assembleAndroidTest"
| }
| android {
| compileSdkVersion 30
| buildToolsVersion "30.0.2"
| namespace 'sample.core'
| compileSdkVersion 33
| }""".trimMargin()
)

tmpFolder.newFolder("sample-core/src/main/")
tmpFolder.newFile("sample-core/src/main/AndroidManifest.xml").writeText(
"""
|<manifest>
|</manifest>
""".trimMargin()
)

// WHEN
val result = GradleRunner.create()
.withProjectDir(tmpFolder.root)
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.6.20"
ext.kotlin_version = "1.9.25"
repositories {
google()
mavenCentral()
Expand All @@ -9,10 +9,10 @@ buildscript {
}
}
dependencies {
classpath "com.android.tools.build:gradle:7.3.1"
classpath "com.android.tools.build:gradle:8.6.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath("org.jlleitschuh.gradle:ktlint-gradle:10.2.1")
classpath("org.jacoco:org.jacoco.core:0.8.8")
classpath("org.jlleitschuh.gradle:ktlint-gradle:11.4.2")
classpath("org.jacoco:org.jacoco.core:0.8.10")
classpath "com.vanniktech:gradle-maven-publish-plugin:0.19.0"
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ kotlin.code.style=official

# POM
GROUP = com.dropbox.affectedmoduledetector
VERSION_NAME=0.3.2-SNAPSHOT
VERSION_NAME=0.4.0-SNAPSHOT

POM_ARTIFACT_ID = affectedmoduledetector
POM_NAME = Affected Module Detector
Expand Down
4 changes: 2 additions & 2 deletions gradle/jacoco.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ project.afterEvaluate {
executionData.setFrom files(coverageData)

reports {
xml.enabled = true
xml.required = true
xml.destination = file("${buildDir}/reports/jacoco/report.xml")
html.enabled = true
html.required = true
}
}

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Thu Oct 15 15:49:37 PDT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
Loading

0 comments on commit 10077fc

Please sign in to comment.