Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ org.gradle.kotlin.dsl.allWarningsAsErrors=true

systemProp.pts.enabled=true

org.gradle.android.latestKnownAgpVersion=8.13.0-alpha02
org.gradle.android.latestKnownAgpVersion=8.13.0-rc01
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class PluginApplicationTest extends AbstractTest {
def projectDir = temporaryFolder.newFolder()
SimpleAndroidApp.builder(projectDir, cacheDir)
.withAndroidVersion(androidVersion)
.withKotlinVersion(VersionNumber.parse(TestVersions.kotlinVersionCompatibleWithOlderAgp))
.withKotlinVersion(VersionNumber.parse(TestVersions.kotlinVersion19))
.build()
.writeProject()

Expand Down
20 changes: 13 additions & 7 deletions src/test/groovy/org/gradle/android/TestVersions.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,22 @@ class TestVersions {
return minorVersions.collect { getLatestVersionForAndroid(it) }
}

static String kotlinVersion = "2.0.21"
// AGP versions <= 7.0 can't use the kotlin-android plugin version 2.0
static String kotlinVersionCompatibleWithOlderAgp = "1.9.0"

static String kotlinVersion22 = "2.2.0"
static String kotlinVersion20 = "2.0.0"
static String kotlinVersion19 = "1.9.0"

static VersionNumber latestSupportedKotlinVersion() {
// version 7.1.3 or higher should be used with kotlin-android plugin 2
if(latestAndroidVersionForCurrentJDK() <= VersionNumber.parse("7.0.4")) {
return VersionNumber.parse(kotlinVersionCompatibleWithOlderAgp)
def agp = latestAndroidVersionForCurrentJDK()
if (agp.compareTo(VersionNumber.parse("7.0.4")) <= 0) {
// AGP ≤ 7.0.4 → Kotlin 1.9.0
return VersionNumber.parse(kotlinVersion19);
} else if (agp.compareTo(VersionNumber.parse("8.0.2")) < 0) {
// 7.0.4 < AGP < 8.0.2 → Kotlin 2.0
return VersionNumber.parse(kotlinVersion20);
} else {
return VersionNumber.parse(kotlinVersion)
// AGP ≥ 8.0.2 → Kotlin 2.2.0
return VersionNumber.parse(kotlinVersion22);
}
}

Expand Down
8 changes: 7 additions & 1 deletion src/test/resources/expectedOutcomes/8.13_outcomes.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,11 @@
":app:checkKotlinGradlePluginConfigurationErrors" : "SKIPPED",
":library:checkKotlinGradlePluginConfigurationErrors": "SKIPPED",
":library:checkReleaseAarMetadata" : "SUCCESS",
":library:checkDebugAarMetadata" : "SUCCESS"
":library:checkDebugAarMetadata" : "SUCCESS",
":library:processDebugNavigationResources" : "FROM_CACHE",
":app:processDebugNavigationResources" : "FROM_CACHE",
":app:compileDebugNavigationResources" : "FROM_CACHE",
":library:processReleaseNavigationResources" : "FROM_CACHE",
":app:processReleaseNavigationResources" : "FROM_CACHE",
":app:compileReleaseNavigationResources" : "FROM_CACHE"
}
4 changes: 2 additions & 2 deletions src/test/resources/versions.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"testedVersions": {
"8.13.0-alpha02": [
"8.13.0-rc01": [
"8.14"
],
"8.12.0-rc01": [
"8.12.0": [
"8.14"
],
"8.11.1": [
Expand Down
Loading