Skip to content

Commit 840d490

Browse files
authored
New AGP target migration (#5466)
Update test AGP and Gradle versions and all test projects. gradle: `['8.7', '9.0.0'] -> ['8.13', '9.2.0']` agp: `['8.6.0', '8.9.0', '9.0.0-alpha01'] -> ['8.11.2', '8.12.3', '9.0.0-alpha13']` Fixes [CMP-9162](https://youtrack.jetbrains.com/issue/CMP-9162) Bump AGP 9.0 latest alpha tests ## Testing Integration tests ## Release Notes N/A
1 parent 3969d04 commit 840d490

File tree

55 files changed

+440
-335
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+440
-335
lines changed

.github/workflows/gradle-plugin.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
os: ['ubuntu-24.04', 'macos-15-xlarge', 'windows-2022']
20-
gradle: ['8.7', '9.0.0']
21-
agp: ['8.6.0', '8.9.0', '9.0.0-alpha01']
20+
gradle: ['8.13', '9.2.0']
21+
agp: ['8.11.2', '8.12.3', '9.0.0-alpha13']
2222
runs-on: ${{ matrix.os }}
2323
steps:
2424
- name: Checkout Repository

gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/MultimoduleResources.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.jetbrains.compose.resources
22

3-
import com.android.build.api.dsl.KotlinMultiplatformAndroidTarget
3+
import com.android.build.api.dsl.KotlinMultiplatformAndroidLibraryTarget
44
import org.gradle.api.Project
55
import org.gradle.api.provider.Provider
66
import org.gradle.api.tasks.SourceSet
@@ -107,7 +107,7 @@ private fun KotlinTarget.skipResourcesConfiguration(): Boolean = when {
107107

108108
@Suppress("UnstableApiUsage")
109109
private fun KotlinTarget.isMultiplatformAndroidTarget(): Boolean = try {
110-
this is KotlinMultiplatformAndroidTarget
110+
this is KotlinMultiplatformAndroidLibraryTarget
111111
} catch (e: NoClassDefFoundError) {
112112
false
113113
}

gradle-plugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/ResourcesTest.kt

Lines changed: 92 additions & 111 deletions
Large diffs are not rendered by default.

gradle-plugins/compose/src/test/test-projects/application/hotReload/build.gradle

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
2-
31
plugins {
4-
id "com.android.application"
2+
id "com.android.kotlin.multiplatform.library"
53
id "org.jetbrains.kotlin.multiplatform"
64
id "org.jetbrains.kotlin.plugin.compose"
75
id "org.jetbrains.compose"
@@ -10,7 +8,11 @@ plugins {
108
kotlin {
119
// empty stub (no actual android app) to detect configuration conflicts
1210
// like https://github.com/JetBrains/compose-jb/issues/2345
13-
androidTarget()
11+
androidLibrary {
12+
namespace = "org.jetbrains.compose.testapp"
13+
compileSdk = 35
14+
minSdk = 23
15+
}
1416

1517
jvm()
1618
sourceSets {
@@ -22,16 +24,6 @@ kotlin {
2224
}
2325
}
2426

25-
android {
26-
namespace = "org.jetbrains.compose.testapp"
27-
compileSdk = 35
28-
29-
defaultConfig {
30-
minSdk = 23
31-
targetSdk = 35
32-
}
33-
}
34-
3527
compose.desktop {
3628
application {
3729
mainClass = "MainKt"

gradle-plugins/compose/src/test/test-projects/application/hotReload/settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pluginManagement {
33
id 'org.jetbrains.kotlin.multiplatform' version 'KOTLIN_VERSION_PLACEHOLDER'
44
id 'org.jetbrains.kotlin.plugin.compose' version 'KOTLIN_VERSION_PLACEHOLDER'
55
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
6-
id 'com.android.application' version 'AGP_VERSION_PLACEHOLDER'
6+
id 'com.android.kotlin.multiplatform.library' version 'AGP_VERSION_PLACEHOLDER'
77
}
88
repositories {
99
mavenLocal()

gradle-plugins/compose/src/test/test-projects/application/mpp/build.gradle

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
22

33
plugins {
4-
id "com.android.application"
4+
id "com.android.kotlin.multiplatform.library"
55
id "org.jetbrains.kotlin.multiplatform"
66
id "org.jetbrains.kotlin.plugin.compose"
77
id "org.jetbrains.compose"
@@ -10,7 +10,11 @@ plugins {
1010
kotlin {
1111
// empty stub (no actual android app) to detect configuration conflicts
1212
// like https://github.com/JetBrains/compose-jb/issues/2345
13-
androidTarget()
13+
androidLibrary {
14+
namespace = "org.jetbrains.compose.testapp"
15+
compileSdk = 35
16+
minSdk = 23
17+
}
1418

1519
jvm()
1620
sourceSets {
@@ -27,16 +31,6 @@ kotlin {
2731
}
2832
}
2933

30-
android {
31-
namespace = "org.jetbrains.compose.testapp"
32-
compileSdk = 35
33-
34-
defaultConfig {
35-
minSdk = 23
36-
targetSdk = 35
37-
}
38-
}
39-
4034
compose.desktop {
4135
application {
4236
mainClass = "MainKt"

gradle-plugins/compose/src/test/test-projects/application/mpp/settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pluginManagement {
33
id 'org.jetbrains.kotlin.multiplatform' version 'KOTLIN_VERSION_PLACEHOLDER'
44
id 'org.jetbrains.kotlin.plugin.compose' version 'KOTLIN_VERSION_PLACEHOLDER'
55
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
6-
id 'com.android.application' version 'AGP_VERSION_PLACEHOLDER'
6+
id 'com.android.kotlin.multiplatform.library' version 'AGP_VERSION_PLACEHOLDER'
77
}
88
repositories {
99
mavenLocal()
Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
plugins {
2-
id "com.android.application"
2+
id "com.android.kotlin.multiplatform.library"
33
id "org.jetbrains.kotlin.multiplatform"
44
id "org.jetbrains.kotlin.plugin.compose"
55
id "org.jetbrains.compose"
66
}
77

88
kotlin {
9-
androidTarget()
9+
androidLibrary {
10+
namespace = "org.jetbrains.compose.testapp"
11+
compileSdk = 35
12+
minSdk = 23
13+
}
1014
iosX64()
1115
iosArm64()
1216
iosSimulatorArm64()
1317
}
14-
15-
android {
16-
namespace = "org.jetbrains.compose.testapp"
17-
compileSdk = 35
18-
19-
defaultConfig {
20-
minSdk = 23
21-
targetSdk = 35
22-
}
23-
}

gradle-plugins/compose/src/test/test-projects/application/nonJvm/settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pluginManagement {
33
id 'org.jetbrains.kotlin.multiplatform' version 'KOTLIN_VERSION_PLACEHOLDER'
44
id 'org.jetbrains.kotlin.plugin.compose' version 'KOTLIN_VERSION_PLACEHOLDER'
55
id 'org.jetbrains.compose' version 'COMPOSE_GRADLE_PLUGIN_VERSION_PLACEHOLDER'
6-
id 'com.android.application' version 'AGP_VERSION_PLACEHOLDER'
6+
id 'com.android.kotlin.multiplatform.library' version 'AGP_VERSION_PLACEHOLDER'
77
}
88
repositories {
99
mavenLocal()
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
plugins {
2+
id("org.jetbrains.compose")
3+
kotlin("plugin.compose")
4+
id("com.android.application")
5+
}
6+
7+
android {
8+
namespace = "me.sample.app"
9+
compileSdk = 35
10+
defaultConfig {
11+
applicationId = "org.example.project"
12+
minSdk = 23
13+
targetSdk = 35
14+
versionCode = 1
15+
versionName = "1.0"
16+
}
17+
}
18+
19+
dependencies {
20+
implementation(project(":featureModule"))
21+
}

0 commit comments

Comments
 (0)