diff --git a/architecture-common-gradle-plugins/build.gradle.kts b/architecture-common-gradle-plugins/build.gradle.kts index 542816e..54f3e4c 100644 --- a/architecture-common-gradle-plugins/build.gradle.kts +++ b/architecture-common-gradle-plugins/build.gradle.kts @@ -46,8 +46,8 @@ gradlePlugin { "Kotlin Multiplatform app conventions with the JS browser target" ) scriptConventionsPlugin( - "kotlin-multiplatform-jvm-and-js-browser-app-conventions", - "Kotlin Multiplatform app conventions with the JVM target and the JS browser target" + "kotlin-multiplatform-app-conventions-with-conventional-targets", + "Kotlin Multiplatform app conventions with the conventional targets JVM, JS (browser), iOS (`iosX64`, `iosArm64`, and `iosSimulatorArm64`), and Wasm JS" ) scriptConventionsPlugin( diff --git a/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/default-web-frontend-conventions.gradle.kts b/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/default-web-frontend-conventions.gradle.kts index 198ab45..434931a 100644 --- a/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/default-web-frontend-conventions.gradle.kts +++ b/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/default-web-frontend-conventions.gradle.kts @@ -18,7 +18,7 @@ repositories { } kotlin { - js(IR) { + js { browser { commonWebpackConfig { outputFileName = "app.js" @@ -36,7 +36,7 @@ kotlin { sourceSets { jsMain { dependencies { - implementation(compose.web.core) + implementation(compose.html.core) implementation(compose.runtime) } } diff --git a/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-jvm-common-app-conventions.gradle.kts b/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-jvm-common-app-conventions.gradle.kts index 931bf49..07d2a4f 100644 --- a/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-jvm-common-app-conventions.gradle.kts +++ b/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-jvm-common-app-conventions.gradle.kts @@ -1,7 +1,7 @@ package com.huanshankeji plugins { - id("com.huanshankeji.kotlin-jvm-common-conventions") + kotlin("jvm") } dependencies { diff --git a/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-jvm-and-js-browser-app-conventions.gradle.kts b/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-app-conventions-with-conventional-targets.gradle.kts similarity index 56% rename from architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-jvm-and-js-browser-app-conventions.gradle.kts rename to architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-app-conventions-with-conventional-targets.gradle.kts index 228786e..682bb07 100644 --- a/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-jvm-and-js-browser-app-conventions.gradle.kts +++ b/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-app-conventions-with-conventional-targets.gradle.kts @@ -2,5 +2,5 @@ package com.huanshankeji plugins { id("com.huanshankeji.kotlin-multiplatform-app-conventions") - id("com.huanshankeji.kotlin-multiplatform-jvm-and-js-browser-conventions") + id("com.huanshankeji.kotlin-multiplatform-conventional-targets") } diff --git a/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-app-conventions.gradle.kts b/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-app-conventions.gradle.kts index f2a5693..4f4eefb 100644 --- a/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-app-conventions.gradle.kts +++ b/architecture-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-app-conventions.gradle.kts @@ -1,7 +1,7 @@ package com.huanshankeji plugins { - id("com.huanshankeji.kotlin-multiplatform-conventions") + kotlin("multiplatform") } kotlin { diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index aa66f6d..fc53b84 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -24,8 +24,8 @@ dependencies { implementation("org.jetbrains.kotlin:kotlin-sam-with-receiver:1.8.0") } */ - // for `KotlinCompilationTask` and the version is for Compose 1.6.1 - implementation(kotlin("gradle-plugin", "1.9.23")) + // for `KotlinCompilationTask` and the version is for Compose 1.6.1 and 1.6.2 + implementation(kotlin("gradle-plugin", "1.9.24")) implementation("org.gradle.kotlin:gradle-kotlin-dsl-plugins:4.2.1") // This version has to be used for Gradle 8.6. implementation("com.gradle.publish:plugin-publish-plugin:1.2.1") diff --git a/buildSrc/src/main/kotlin/VersionsAndDependencies.kt b/buildSrc/src/main/kotlin/VersionsAndDependencies.kt index 9abea6f..ef90e13 100644 --- a/buildSrc/src/main/kotlin/VersionsAndDependencies.kt +++ b/buildSrc/src/main/kotlin/VersionsAndDependencies.kt @@ -4,13 +4,13 @@ import com.huanshankeji.CommonVersions val commonVersions = CommonVersions() val commonGradleClasspathDependencies = CommonGradleClasspathDependencies(commonVersions) -val kotlinVersion = "1.9.23" // for Compose 1.6.1 +val kotlinVersion = "1.9.23" // for Compose 1.6.1 and 1.6.2 -val alignedPluginVersion = "0.5.1-SNAPSHOT" +val alignedPluginVersion = "0.6.0-SNAPSHOT" // "x.y.z" indicates the version of the way of organizing the code, // and the date indicates the version when the dependency versions are updated. -val commonGradleDependenciesVersion = "0.7.1-20240314" +val commonGradleDependenciesVersion = "0.7.1-20240516" // This is the source dependency version. There is another build source dependency in "buildSrc/build.gradle.kts". val pluginProjectSourceDependentStableCommonGradleDependenciesVersion = "0.7.1-20240314-boostrap".apply { diff --git a/common-gradle-dependencies/src/main/kotlin/com/huanshankeji/CommonVersions.kt b/common-gradle-dependencies/src/main/kotlin/com/huanshankeji/CommonVersions.kt index 2fc7053..1582894 100644 --- a/common-gradle-dependencies/src/main/kotlin/com/huanshankeji/CommonVersions.kt +++ b/common-gradle-dependencies/src/main/kotlin/com/huanshankeji/CommonVersions.kt @@ -7,20 +7,20 @@ class CommonVersions @JvmOverloads constructor( val kotlinCommon: String = "0.4.0", - val kotlinxCoroutines: String = "1.8.0", + val kotlinxCoroutines: String = "1.8.1", val kotlinxHtml: String = "0.11.0", val kotlinxSerialization: String = "1.6.3", - val kotlinxDatetime: String = "0.5.0", + val kotlinxDatetime: String = "0.6.0", val kotlinxBenchmark: String = "0.4.10", - val exposed: String = "0.48.0", - val ktor: String = "2.3.9", - val composeMultiplatform: String = "1.6.1", // this is usually only used in classpath dependencies + val exposed: String = "0.50.1", + val ktor: String = "2.3.11", + val composeMultiplatform: String = "1.6.2", // this is usually only used in classpath dependencies - val vertx: String = "4.5.5", - val arrow: String = "1.2.3", - val orgJunit: String = "5.10.2", - val kotest: String = "5.8.1", - val postgreSql: String = "42.7.2", + val vertx: String = "4.5.7", + val arrow: String = "1.2.4", + val orgJunit: String = "5.10.2", // JUnit 5 actually + val kotest: String = "5.9.0", + val postgreSql: String = "42.7.3", val slf4j: String = "1.7.36", // TODO: consider replacing with kotlin-logging (https://github.com/oshai/kotlin-logging) - val testContainers: String = "1.19.7" + val testContainers: String = "1.19.8" ) \ No newline at end of file diff --git a/kotlin-common-gradle-plugins/build.gradle.kts b/kotlin-common-gradle-plugins/build.gradle.kts index 95564ef..129cdcf 100644 --- a/kotlin-common-gradle-plugins/build.gradle.kts +++ b/kotlin-common-gradle-plugins/build.gradle.kts @@ -18,22 +18,13 @@ gradlePlugin { fun scriptConventionsPlugin(idSuffix: String, displayName: String, description: String = displayName) = scriptPlugin(`package`, idSuffix, displayName, description) - scriptConventionsPlugin( - "kotlin-jvm-common-conventions", - "Kotlin/JVM common conventions" - ) - - scriptConventionsPlugin( - "kotlin-multiplatform-conventions", - "Kotlin Multiplatform conventions" - ) scriptConventionsPlugin( "kotlin-multiplatform-js-browser-conventions", "Kotlin Multiplatform conventions with the JS browser target" ) scriptConventionsPlugin( - "kotlin-multiplatform-jvm-and-js-browser-conventions", - "Kotlin Multiplatform conventions with the JVM target and the JS browser target" + "kotlin-multiplatform-conventional-targets", + "Kotlin Multiplatform conventions with the conventional targets JVM, JS (browser), iOS (`iosX64`, `iosArm64`, and `iosSimulatorArm64`), and Wasm JS" ) create("maven-publish-conventions") { diff --git a/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/MavenPublishConventionsPlugin.kt b/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/MavenPublishConventionsPlugin.kt index b2070c8..e2bf3f7 100644 --- a/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/MavenPublishConventionsPlugin.kt +++ b/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/MavenPublishConventionsPlugin.kt @@ -9,6 +9,7 @@ import org.gradle.api.publish.maven.MavenPublication import org.gradle.kotlin.dsl.create import org.gradle.kotlin.dsl.withType +// TODO refactor into a script plugin class MavenPublishConventionsPlugin : Plugin { sealed class ArtifactIdConfig { // Use the default artifact ID, which is the subproject name unchanged. diff --git a/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-jvm-common-conventions.gradle.kts b/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-jvm-common-conventions.gradle.kts deleted file mode 100644 index ee33601..0000000 --- a/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-jvm-common-conventions.gradle.kts +++ /dev/null @@ -1,9 +0,0 @@ -package com.huanshankeji - -plugins { - kotlin("jvm") -} - -repositories { - mavenCentral() -} diff --git a/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-jvm-library-maven-publish-conventions.gradle.kts b/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-jvm-library-maven-publish-conventions.gradle.kts index b3ad03f..ea06789 100644 --- a/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-jvm-library-maven-publish-conventions.gradle.kts +++ b/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-jvm-library-maven-publish-conventions.gradle.kts @@ -1,7 +1,7 @@ package com.huanshankeji plugins { - id("com.huanshankeji.kotlin-jvm-common-conventions") + kotlin("jvm") `java-library` } apply() diff --git a/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-conventional-targets.gradle.kts b/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-conventional-targets.gradle.kts new file mode 100644 index 0000000..d7a2799 --- /dev/null +++ b/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-conventional-targets.gradle.kts @@ -0,0 +1,20 @@ +package com.huanshankeji + +plugins { + id("com.huanshankeji.kotlin-multiplatform-js-browser-conventions") +} + +kotlin { + jvm() + + //androidTarget() + + iosX64() + iosArm64() + iosSimulatorArm64() + + /* + @OptIn(ExperimentalWasmDsl::class) + wasmJs() + */ +} diff --git a/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-conventions.gradle.kts b/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-conventions.gradle.kts deleted file mode 100644 index f2d17a9..0000000 --- a/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-conventions.gradle.kts +++ /dev/null @@ -1,9 +0,0 @@ -package com.huanshankeji - -plugins { - kotlin("multiplatform") -} - -repositories { - mavenCentral() -} diff --git a/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-js-browser-conventions.gradle.kts b/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-js-browser-conventions.gradle.kts index 7e3783e..b3007e0 100644 --- a/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-js-browser-conventions.gradle.kts +++ b/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-js-browser-conventions.gradle.kts @@ -1,11 +1,11 @@ package com.huanshankeji plugins { - id("com.huanshankeji.kotlin-multiplatform-conventions") + kotlin("multiplatform") } kotlin { - js(IR) { + js { moduleName = fullNameWithRootProjectNameForFileSystem browser() } diff --git a/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-jvm-and-js-browser-conventions.gradle.kts b/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-jvm-and-js-browser-conventions.gradle.kts deleted file mode 100644 index 6557bd5..0000000 --- a/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-jvm-and-js-browser-conventions.gradle.kts +++ /dev/null @@ -1,9 +0,0 @@ -package com.huanshankeji - -plugins { - id("com.huanshankeji.kotlin-multiplatform-js-browser-conventions") -} - -kotlin { - jvm() -} diff --git a/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-maven-publish-conventions.gradle.kts b/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-maven-publish-conventions.gradle.kts index 8d5ba95..84def97 100644 --- a/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-maven-publish-conventions.gradle.kts +++ b/kotlin-common-gradle-plugins/src/main/kotlin/com/huanshankeji/kotlin-multiplatform-maven-publish-conventions.gradle.kts @@ -1,6 +1,6 @@ package com.huanshankeji plugins { - id("com.huanshankeji.kotlin-multiplatform-conventions") + kotlin("multiplatform") } apply()