diff --git a/android-tests/build.gradle.kts b/android-tests/build.gradle.kts index 4fa160b..461f18f 100644 --- a/android-tests/build.gradle.kts +++ b/android-tests/build.gradle.kts @@ -2,7 +2,6 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { alias(libs.plugins.android.application) - alias(libs.plugins.jetbrains.kotlin.android) alias(libs.plugins.compose.compiler) } @@ -17,12 +16,12 @@ java { android { namespace = "com.svenjacobs.reveal.android.tests" - compileSdk = androidCompileSdk + compileSdk { version = release(androidCompileSdk) } defaultConfig { applicationId = "com.svenjacobs.reveal.android.tests" - minSdk = 23 - targetSdk = androidTargetSdk + minSdk { version = release(23) } + targetSdk { version = release(androidTargetSdk) } versionCode = 1 versionName = "1.0" diff --git a/build.gradle.kts b/build.gradle.kts index 5760560..6e5ff3a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ plugins { alias(libs.plugins.jetbrains.compose) apply false alias(libs.plugins.android.application) apply false alias(libs.plugins.android.library) apply false - alias(libs.plugins.jetbrains.kotlin.android) apply false + alias(libs.plugins.android.multiplatform.library) apply false alias(libs.plugins.compose.compiler) apply false alias(libs.plugins.nexus.publish) alias(libs.plugins.ben.manes.versions) diff --git a/convention-plugins/build.gradle.kts b/convention-plugins/build.gradle.kts index 6b4cf17..e88585d 100644 --- a/convention-plugins/build.gradle.kts +++ b/convention-plugins/build.gradle.kts @@ -27,4 +27,9 @@ dependencies { name = "org.jetbrains.kotlin.plugin.compose.gradle.plugin", version = libs.findVersion("kotlin").get().requiredVersion, ) + implementation( + group = "com.android.tools.build", + name = "gradle", + version = libs.findVersion("android-gradle-plugin").get().requiredVersion, + ) } diff --git a/convention-plugins/src/main/kotlin/convention.multiplatform.gradle.kts b/convention-plugins/src/main/kotlin/convention.multiplatform.gradle.kts index 3661b0b..45f6416 100644 --- a/convention-plugins/src/main/kotlin/convention.multiplatform.gradle.kts +++ b/convention-plugins/src/main/kotlin/convention.multiplatform.gradle.kts @@ -4,6 +4,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { kotlin("multiplatform") + id("com.android.kotlin.multiplatform.library") id("org.jetbrains.compose") id("org.jetbrains.kotlin.plugin.compose") } @@ -19,11 +20,10 @@ kotlin { jvm("desktop") - androidTarget { + androidLibrary { compilerOptions { jvmTarget.set(JvmTarget.JVM_11) } - publishLibraryVariants("release") } listOf( diff --git a/demo-app/androidApp/build.gradle.kts b/demo-app/androidApp/build.gradle.kts index 1e61cfc..8735606 100644 --- a/demo-app/androidApp/build.gradle.kts +++ b/demo-app/androidApp/build.gradle.kts @@ -2,17 +2,16 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { alias(libs.plugins.android.application) - alias(libs.plugins.jetbrains.kotlin.android) alias(libs.plugins.compose.compiler) } android { namespace = "com.svenjacobs.reveal.demo.android" - compileSdk = 36 + compileSdk { version = release(36) } defaultConfig { applicationId = "com.svenjacobs.reveal.demo.android" - minSdk = 23 - targetSdk = 36 + minSdk { version = release(23) } + targetSdk { version = release(36) } versionCode = 1 versionName = "1.0" } diff --git a/demo-app/build.gradle.kts b/demo-app/build.gradle.kts index 13b6074..03385c8 100644 --- a/demo-app/build.gradle.kts +++ b/demo-app/build.gradle.kts @@ -3,7 +3,7 @@ import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask plugins { alias(libs.plugins.android.application) apply false alias(libs.plugins.android.library) apply false - alias(libs.plugins.jetbrains.kotlin.android) apply false + alias(libs.plugins.android.multiplatform.library) apply false alias(libs.plugins.jetbrains.kotlin.multiplatform) apply false alias(libs.plugins.jetbrains.compose) apply false alias(libs.plugins.compose.compiler) apply false diff --git a/demo-app/gradle/gradle-daemon-jvm.properties b/demo-app/gradle/gradle-daemon-jvm.properties new file mode 100644 index 0000000..ff1fe47 --- /dev/null +++ b/demo-app/gradle/gradle-daemon-jvm.properties @@ -0,0 +1,13 @@ +#This file is generated by updateDaemonJvm +toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/536afcd1dff540251f85e5d2c80458cf/redirect +toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/67a0fee3c4236b6397dcbe8575ca2011/redirect +toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/29ee363f71d060405f729a8f1b7f7aef/redirect +toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/67a0fee3c4236b6397dcbe8575ca2011/redirect +toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/10fc3bf1ee0001078a473afe6e43cfdb/redirect +toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/658299a896470fbb3103ba3a430ee227/redirect +toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/29ee363f71d060405f729a8f1b7f7aef/redirect +toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/67a0fee3c4236b6397dcbe8575ca2011/redirect +toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/248ffb1098f61659502d0c09aa348294/redirect +toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/c9346d9c4bd3ae087fba56b027600ff7/redirect +toolchainVendor=JETBRAINS +toolchainVersion=21 diff --git a/demo-app/gradle/libs.versions.toml b/demo-app/gradle/libs.versions.toml index 53e9866..73cbb69 100644 --- a/demo-app/gradle/libs.versions.toml +++ b/demo-app/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] -android-gradle-plugin = "8.13.1" +android-gradle-plugin = "9.0.1" androidx-compose-bom = "2025.12.00" -jetbrains-compose = "1.9.3" +jetbrains-compose = "1.10.1" kotlin = "2.2.21" reveal = "4.0.0" @@ -16,11 +16,16 @@ androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" } androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" } reveal-core = { module = "com.svenjacobs.reveal:reveal-core", version.ref = "reveal" } reveal-shapes = { module = "com.svenjacobs.reveal:reveal-shapes", version.ref = "reveal" } +compose-multiplatform-runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "jetbrains-compose" } +compose-multiplatform-foundation = { module = "org.jetbrains.compose.foundation:foundation", version.ref = "jetbrains-compose" } +compose-multiplatform-material3 = "org.jetbrains.compose.material3:material3:1.9.0" +compose-multiplatform-material-icons-extended = "org.jetbrains.compose.material:material-icons-extended:1.7.3" +compose-multiplatform-components-resources = { module = "org.jetbrains.compose.components:components-resources", version.ref = "jetbrains-compose" } [plugins] android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" } android-library = { id = "com.android.library", version.ref = "android-gradle-plugin" } -jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +android-multiplatform-library = { id = "com.android.kotlin.multiplatform.library", version.ref = "android-gradle-plugin" } jetbrains-kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } jetbrains-compose = { id = "org.jetbrains.compose", version.ref = "jetbrains-compose" } compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } diff --git a/demo-app/gradle/wrapper/gradle-wrapper.properties b/demo-app/gradle/wrapper/gradle-wrapper.properties index d4081da..37f78a6 100644 --- a/demo-app/gradle/wrapper/gradle-wrapper.properties +++ b/demo-app/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/demo-app/shared/build.gradle.kts b/demo-app/shared/build.gradle.kts index 80cc23f..3f91d2c 100644 --- a/demo-app/shared/build.gradle.kts +++ b/demo-app/shared/build.gradle.kts @@ -5,7 +5,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { alias(libs.plugins.jetbrains.kotlin.multiplatform) - alias(libs.plugins.android.library) + alias(libs.plugins.android.multiplatform.library) alias(libs.plugins.jetbrains.compose) alias(libs.plugins.compose.compiler) } @@ -17,7 +17,13 @@ kotlin { jvm("desktop") - androidTarget { + android { + namespace = "com.svenjacobs.reveal.demo" + minSdk { version = release(23) } + compileSdk { version = release(36) } + } + + androidLibrary { compilerOptions { jvmTarget.set(JvmTarget.JVM_17) } @@ -35,12 +41,11 @@ kotlin { sourceSets { commonMain.dependencies { - implementation(compose.runtime) - implementation(compose.foundation) - implementation(compose.material3) - implementation(compose.materialIconsExtended) - @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class) - implementation(compose.components.resources) + implementation(libs.compose.multiplatform.runtime) + implementation(libs.compose.multiplatform.foundation) + implementation(libs.compose.multiplatform.material3) + implementation(libs.compose.multiplatform.material.icons.extended) + implementation(libs.compose.multiplatform.components.resources) //noinspection UseTomlInstead implementation("reveal:core") @@ -53,11 +58,3 @@ kotlin { } } } - -android { - namespace = "com.svenjacobs.reveal.demo" - compileSdk = 36 - defaultConfig { - minSdk = 23 - } -} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a0c2bc8..0300d4f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,8 +1,8 @@ [versions] -android-gradle-plugin = "8.13.2" +android-gradle-plugin = "9.0.1" androidx-activity = "1.12.3" androidx-compose-bom = "2026.01.01" # https://developer.android.com/jetpack/compose/bom/bom-mapping -jetbrains-compose = "1.8.2" +jetbrains-compose = "1.10.1" kotlin = "2.3.0" [libraries] @@ -26,11 +26,13 @@ androidx-compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-mani androidx-test-espresso-core = "androidx.test.espresso:espresso-core:3.7.0" androidx-test-ext-junit = "androidx.test.ext:junit:1.3.0" junit = "junit:junit:4.13.2" +compose-multiplatform-runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "jetbrains-compose" } +compose-multiplatform-foundation = { module = "org.jetbrains.compose.foundation:foundation", version.ref = "jetbrains-compose" } [plugins] android-application = { id = "com.android.application", version.ref = "android-gradle-plugin" } android-library = { id = "com.android.library", version.ref = "android-gradle-plugin" } -jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +android-multiplatform-library = { id = "com.android.kotlin.multiplatform.library", version.ref = "android-gradle-plugin" } jetbrains-kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } jetbrains-compose = { id = "org.jetbrains.compose", version.ref = "jetbrains-compose" } compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } diff --git a/reveal-common/build.gradle.kts b/reveal-common/build.gradle.kts index fb44ef9..6891741 100644 --- a/reveal-common/build.gradle.kts +++ b/reveal-common/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - alias(libs.plugins.android.library) + alias(libs.plugins.android.multiplatform.library) id("convention.multiplatform") id("convention.publication") } @@ -7,52 +7,29 @@ plugins { val baseName by extra { "reveal-common" } val publicationName by extra { "Reveal (Common)" } -kotlin { - sourceSets { - commonMain.dependencies { - implementation(compose.runtime) - implementation(compose.foundation) - } - commonTest.dependencies { - implementation(kotlin("test")) - } - } -} - val androidMinSdk: Int by rootProject.extra val androidCompileSdk: Int by rootProject.extra -android { - namespace = "com.svenjacobs.reveal.common" - compileSdk = androidCompileSdk +kotlin { + android { + namespace = "com.svenjacobs.reveal.common" - defaultConfig { - minSdk = androidMinSdk + compileSdk { version = release(androidCompileSdk) } + minSdk { version = release(androidMinSdk) } aarMetadata { minCompileSdk = androidMinSdk } - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } - buildTypes { - release { - isMinifyEnabled = false - proguardFiles( - getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro", - ) + sourceSets { + commonMain.dependencies { + implementation(libs.compose.multiplatform.runtime) + implementation(libs.compose.multiplatform.foundation) + } + commonTest.dependencies { + implementation(kotlin("test")) } - } - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } - - buildFeatures { - compose = true } } diff --git a/reveal-compat-android/build.gradle.kts b/reveal-compat-android/build.gradle.kts index 9570638..9e5ce7e 100644 --- a/reveal-compat-android/build.gradle.kts +++ b/reveal-compat-android/build.gradle.kts @@ -2,7 +2,6 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { alias(libs.plugins.android.library) - alias(libs.plugins.jetbrains.kotlin.android) alias(libs.plugins.compose.compiler) `maven-publish` id("convention.publication") @@ -21,10 +20,10 @@ val androidCompileSdk: Int by rootProject.extra android { namespace = "com.svenjacobs.reveal.compat.android" - compileSdk = androidCompileSdk + compileSdk { version = release(androidCompileSdk) } defaultConfig { - minSdk = androidMinSdk + minSdk { version = release(androidMinSdk) } aarMetadata { minCompileSdk = androidMinSdk diff --git a/reveal-core/build.gradle.kts b/reveal-core/build.gradle.kts index 265191e..1eb4a49 100644 --- a/reveal-core/build.gradle.kts +++ b/reveal-core/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - alias(libs.plugins.android.library) + alias(libs.plugins.android.multiplatform.library) id("convention.multiplatform") id("convention.publication") } @@ -7,55 +7,30 @@ plugins { val baseName by extra { "reveal-core" } val publicationName by extra { "Reveal (Core)" } -kotlin { - sourceSets { - commonMain.dependencies { - api(project(":reveal-common")) - implementation(compose.runtime) - implementation(compose.foundation) - } - commonTest.dependencies { - implementation(kotlin("test")) - } - } -} - val androidMinSdk: Int by rootProject.extra val androidTargetSdk: Int by rootProject.extra val androidCompileSdk: Int by rootProject.extra -android { - namespace = "com.svenjacobs.reveal" - compileSdk = androidCompileSdk - - defaultConfig { - minSdk = androidMinSdk +kotlin { + android { + namespace = "com.svenjacobs.reveal" + compileSdk { version = release(androidCompileSdk) } + minSdk { version = release(androidMinSdk) } aarMetadata { minCompileSdk = androidMinSdk } - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - consumerProguardFiles("consumer-rules.pro") } - buildTypes { - release { - isMinifyEnabled = false - proguardFiles( - getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro", - ) + sourceSets { + commonMain.dependencies { + api(project(":reveal-common")) + implementation(libs.compose.multiplatform.runtime) + implementation(libs.compose.multiplatform.foundation) + } + commonTest.dependencies { + implementation(kotlin("test")) } - } - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } - - buildFeatures { - compose = true } } diff --git a/reveal-shapes/build.gradle.kts b/reveal-shapes/build.gradle.kts index 904b6e0..0942b08 100644 --- a/reveal-shapes/build.gradle.kts +++ b/reveal-shapes/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - alias(libs.plugins.android.library) + alias(libs.plugins.android.multiplatform.library) id("convention.multiplatform") id("convention.publication") } @@ -7,52 +7,28 @@ plugins { val baseName by extra { "reveal-shapes" } val publicationName by extra { "Reveal (Shapes)" } -kotlin { - sourceSets { - commonMain.dependencies { - implementation(compose.runtime) - implementation(compose.foundation) - } - commonTest.dependencies { - implementation(kotlin("test")) - } - } -} - val androidMinSdk: Int by rootProject.extra val androidCompileSdk: Int by rootProject.extra -android { - namespace = "com.svenjacobs.reveal.shapes" - compileSdk = androidCompileSdk - - defaultConfig { - minSdk = androidMinSdk +kotlin { + android { + namespace = "com.svenjacobs.reveal.shapes" + compileSdk { version = release(androidCompileSdk) } + minSdk { version = release(androidMinSdk) } aarMetadata { minCompileSdk = androidMinSdk } - - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } - buildTypes { - release { - isMinifyEnabled = false - proguardFiles( - getDefaultProguardFile("proguard-android-optimize.txt"), - "proguard-rules.pro", - ) + sourceSets { + commonMain.dependencies { + implementation(libs.compose.multiplatform.runtime) + implementation(libs.compose.multiplatform.foundation) + } + commonTest.dependencies { + implementation(kotlin("test")) } - } - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } - - buildFeatures { - compose = true } }