diff --git a/gradle/templates/addCompose.gradle b/gradle/templates/addCompose.gradle new file mode 100644 index 00000000000..bab421e7bab --- /dev/null +++ b/gradle/templates/addCompose.gradle @@ -0,0 +1,9 @@ +kotlin { + sourceSets { + commonMain { + dependencies { + implementation compose.runtime + } + } + } +} \ No newline at end of file diff --git a/gradle/templates/addComposeForAndroid.gradle b/gradle/templates/addComposeForAndroid.gradle new file mode 100644 index 00000000000..5dedc38ca31 --- /dev/null +++ b/gradle/templates/addComposeForAndroid.gradle @@ -0,0 +1,9 @@ +kotlin { + sourceSets { + androidUnitTest { + dependencies { + implementation compose.uiTest + } + } + } +} diff --git a/gradle/templates/addComposeForDesktop.gradle b/gradle/templates/addComposeForDesktop.gradle new file mode 100644 index 00000000000..06293f13343 --- /dev/null +++ b/gradle/templates/addComposeForDesktop.gradle @@ -0,0 +1,15 @@ +kotlin { + sourceSets { + jvmMain { + dependencies { + implementation compose.desktop.currentOs + } + } + jvmTest { + dependencies { + implementation kotlin('test-junit') + implementation compose.uiTest + } + } + } +} diff --git a/gradle/templates/addComposeForJs.gradle b/gradle/templates/addComposeForJs.gradle new file mode 100644 index 00000000000..c9936d9c62f --- /dev/null +++ b/gradle/templates/addComposeForJs.gradle @@ -0,0 +1,9 @@ +kotlin { + sourceSets { + jsMain { + dependencies { + implementation compose.web.core + } + } + } +} diff --git a/gradle/templates/defaultProject.gradle b/gradle/templates/defaultProject.gradle new file mode 100644 index 00000000000..810e5cce72b --- /dev/null +++ b/gradle/templates/defaultProject.gradle @@ -0,0 +1,24 @@ +project.version = "$version" +project.group = "$group" + +kotlin { + sourceSets { + commonMain { + dependencies { + implementation kotlin('stdlib') + } + } + commonTest { + dependencies { + implementation kotlin('test-common') + implementation kotlin('test-annotations-common') + implementation libs.kt.coroutines.test + } + } + } +} + +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 +} diff --git a/gradle/templates/defaultProjectWithSerialization.gradle b/gradle/templates/defaultProjectWithSerialization.gradle new file mode 100644 index 00000000000..ce506197bf9 --- /dev/null +++ b/gradle/templates/defaultProjectWithSerialization.gradle @@ -0,0 +1,25 @@ +project.version = "$version" +project.group = "$group" + +kotlin { + sourceSets { + commonMain { + dependencies { + implementation kotlin('stdlib') + api libs.kt.serialization + } + } + commonTest { + dependencies { + implementation kotlin('test-common') + implementation kotlin('test-annotations-common') + implementation libs.kt.coroutines.test + } + } + } +} + +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 +} diff --git a/gradle/templates/enableMPPAndroid.gradle b/gradle/templates/enableMPPAndroid.gradle new file mode 100644 index 00000000000..6e735f74752 --- /dev/null +++ b/gradle/templates/enableMPPAndroid.gradle @@ -0,0 +1,31 @@ +kotlin { + androidTarget { + publishAllLibraryVariants() + compilations.all { + kotlinOptions { + jvmTarget = "17" + } + } + } + + sourceSets { + androidUnitTest { + dependencies { + implementation kotlin('test-junit') + implementation libs.android.test.junit + implementation libs.android.espresso + } + } + androidInstrumentedTest { + dependencies { + implementation kotlin('test-junit') + implementation libs.android.test.junit + implementation libs.android.espresso + } + } + + androidMain.dependsOn jvmMain + } +} + +apply from: "$defaultAndroidSettings" diff --git a/gradle/templates/enableMPPJs.gradle b/gradle/templates/enableMPPJs.gradle new file mode 100644 index 00000000000..e376278fb6c --- /dev/null +++ b/gradle/templates/enableMPPJs.gradle @@ -0,0 +1,30 @@ +kotlin { + js (IR) { + browser { + testTask { + useMocha { + timeout = "240000" + } + } + } + nodejs { + testTask { + useMocha { + timeout = "240000" + } + } + } + } + + sourceSets { + jsMain { + dependencies { + } + } + jsTest { + dependencies { + implementation kotlin('test-js') + } + } + } +} diff --git a/gradle/templates/enableMPPJvm.gradle b/gradle/templates/enableMPPJvm.gradle new file mode 100644 index 00000000000..28abd02ecf2 --- /dev/null +++ b/gradle/templates/enableMPPJvm.gradle @@ -0,0 +1,21 @@ +kotlin { + jvm { + compilations.main { + kotlinOptions { + jvmTarget = "17" + } + } + } + + sourceSets { + jvmMain { + dependencies { + } + } + jvmTest { + dependencies { + implementation kotlin('test-junit') + } + } + } +} diff --git a/gradle/templates/enableMPPNativeArm64.gradle b/gradle/templates/enableMPPNativeArm64.gradle new file mode 100644 index 00000000000..191519d3f2c --- /dev/null +++ b/gradle/templates/enableMPPNativeArm64.gradle @@ -0,0 +1,8 @@ +kotlin { + linuxArm64() + + sourceSets { + nativeMain.dependsOn commonMain + linuxArm64Main.dependsOn nativeMain + } +} diff --git a/gradle/templates/enableMPPNativeX64.gradle b/gradle/templates/enableMPPNativeX64.gradle new file mode 100644 index 00000000000..e656b94b37e --- /dev/null +++ b/gradle/templates/enableMPPNativeX64.gradle @@ -0,0 +1,10 @@ +kotlin { + linuxX64() + mingwX64() + + sourceSets { + nativeMain.dependsOn commonMain + linuxX64Main.dependsOn nativeMain + mingwX64Main.dependsOn nativeMain + } +} diff --git a/gradle/templates/enableMPPWasmJs.gradle b/gradle/templates/enableMPPWasmJs.gradle new file mode 100644 index 00000000000..d670f42ebaf --- /dev/null +++ b/gradle/templates/enableMPPWasmJs.gradle @@ -0,0 +1,27 @@ +kotlin { + wasmJs { + browser { + testTask { + useKarma { + useChromeHeadless() + useConfigDirectory(rootProject.relativeProjectPath("gradle/karma.config.d")) + } + } + } + nodejs { + testTask { + timeout = Duration.ofSeconds(240) + nodeJsArgs.add("--unhandled-rejections=warn") + nodeJsArgs.add("--trace-warnings") + } + } + } + + sourceSets { + wasmJsTest { + dependencies { + implementation kotlin('test-wasm-js') + } + } + } +} diff --git a/gradle/templates/mppAndroidProject.gradle b/gradle/templates/mppAndroidProject.gradle index 3173408b142..4d4ece2fdf0 100644 --- a/gradle/templates/mppAndroidProject.gradle +++ b/gradle/templates/mppAndroidProject.gradle @@ -1,37 +1,6 @@ -project.version = "$version" -project.group = "$group" - +apply from: "$defaultProject" +apply from: "$enableMPPJvm" +apply from: "$enableMPPJs" +apply from: "$enableMPPWasmJs" +apply from: "$enableMPPAndroid" apply from: "$publish" - -kotlin { - androidTarget { - publishAllLibraryVariants() - compilations.all { - kotlinOptions { - jvmTarget = "17" - } - } - } - - sourceSets { - commonMain { - dependencies { - implementation kotlin('stdlib') - } - } - commonTest { - dependencies { - implementation kotlin('test-common') - implementation kotlin('test-annotations-common') - implementation libs.kt.coroutines.test - } - } - } -} - -apply from: "$defaultAndroidSettings" - -java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 -} diff --git a/gradle/templates/mppComposeJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project.gradle b/gradle/templates/mppComposeJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project.gradle index 9c7873cb00c..d3c1db07e7d 100644 --- a/gradle/templates/mppComposeJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project.gradle +++ b/gradle/templates/mppComposeJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project.gradle @@ -1,130 +1,12 @@ -project.version = "$version" -project.group = "$group" - +apply from: "$defaultProjectWithSerialization" +apply from: "$enableMPPJvm" +apply from: "$enableMPPJs" +apply from: "$enableMPPWasmJs" +apply from: "$enableMPPAndroid" +apply from: "$enableMPPNativeX64" +apply from: "$enableMPPNativeArm64" +apply from: "$addCompose" +apply from: "$addComposeForAndroid" +apply from: "$addComposeForDesktop" +apply from: "$addComposeForJs" apply from: "$publish" - -kotlin { - jvm { - compilations.main { - kotlinOptions { - jvmTarget = "17" - } - } - } - js (IR) { - browser { - testTask { - useMocha { - timeout = "240000" - } - } - } - nodejs { - testTask { - useMocha { - timeout = "240000" - } - } - } - } - wasmJs { - browser { - testTask { - useKarma { - useChromeHeadless() - useConfigDirectory(rootProject.relativeProjectPath("gradle/karma.config.d")) - } - } - } - nodejs { - testTask { - timeout = Duration.ofSeconds(240) - nodeJsArgs.add("--unhandled-rejections=warn") - nodeJsArgs.add("--trace-warnings") - } - } - } - androidTarget { - publishAllLibraryVariants() - compilations.all { - kotlinOptions { - jvmTarget = "17" - } - } - } - linuxX64() - mingwX64() - linuxArm64() - - sourceSets { - commonMain { - dependencies { - implementation kotlin('stdlib') - implementation compose.runtime - api libs.kt.serialization - } - } - commonTest { - dependencies { - implementation kotlin('test-common') - implementation kotlin('test-annotations-common') - implementation libs.kt.coroutines.test - } - } - - androidUnitTest { - dependencies { - implementation kotlin('test-junit') - implementation libs.android.test.junit - implementation libs.android.espresso - implementation compose.uiTest - } - } - androidInstrumentedTest { - dependencies { - implementation kotlin('test-junit') - implementation libs.android.test.junit - implementation libs.android.espresso - } - } - jvmMain { - dependencies { - implementation compose.desktop.currentOs - } - } - jvmTest { - dependencies { - implementation kotlin('test-junit') - implementation compose.uiTest - } - } - jsMain { - dependencies { - implementation compose.web.core - } - } - jsTest { - dependencies { - implementation kotlin('test-js') - } - } - wasmJsTest { - dependencies { - implementation kotlin('test-wasm-js') - } - } - nativeMain.dependsOn commonMain - linuxX64Main.dependsOn nativeMain - mingwX64Main.dependsOn nativeMain - linuxArm64Main.dependsOn nativeMain - - androidMain.dependsOn jvmMain - } -} - -apply from: "$defaultAndroidSettings" - -java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 -} diff --git a/gradle/templates/mppJavaProject.gradle b/gradle/templates/mppJavaProject.gradle index d4a050d1499..5b2e90f368f 100644 --- a/gradle/templates/mppJavaProject.gradle +++ b/gradle/templates/mppJavaProject.gradle @@ -1,40 +1,3 @@ -project.version = "$version" -project.group = "$group" - +apply from: "$defaultProject" +apply from: "$enableMPPJvm" apply from: "$publish" - -kotlin { - jvm { - compilations.main { - kotlinOptions { - jvmTarget = "17" - } - } - } - - sourceSets { - commonMain { - dependencies { - implementation kotlin('stdlib') - } - } - commonTest { - dependencies { - implementation kotlin('test-common') - implementation kotlin('test-annotations-common') - implementation libs.kt.coroutines.test - } - } - - jvmTest { - dependencies { - implementation kotlin('test-junit') - } - } - } -} - -java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 -} diff --git a/gradle/templates/mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project.gradle b/gradle/templates/mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project.gradle index 269241694d2..41bc490fc0b 100644 --- a/gradle/templates/mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project.gradle +++ b/gradle/templates/mppJvmJsWasmJsAndroidLinuxMingwLinuxArm64Project.gradle @@ -1,110 +1,8 @@ -project.version = "$version" -project.group = "$group" - +apply from: "$defaultProjectWithSerialization" +apply from: "$enableMPPJvm" +apply from: "$enableMPPJs" +apply from: "$enableMPPWasmJs" +apply from: "$enableMPPAndroid" +apply from: "$enableMPPNativeX64" +apply from: "$enableMPPNativeArm64" apply from: "$publish" - -kotlin { - jvm { - compilations.main { - kotlinOptions { - jvmTarget = "17" - } - } - } - js (IR) { - browser { - testTask { - useMocha { - timeout = "240000" - } - } - } - nodejs { - testTask { - useMocha { - timeout = "240000" - } - } - } - } - wasmJs { - browser { - testTask { - useKarma { - useChromeHeadless() - useConfigDirectory(rootProject.relativeProjectPath("gradle/karma.config.d")) - } - } - } - nodejs { - testTask { - timeout = Duration.ofSeconds(240) - nodeJsArgs.add("--unhandled-rejections=warn") - nodeJsArgs.add("--trace-warnings") - } - } - } - androidTarget { - publishAllLibraryVariants() - compilations.all { - kotlinOptions { - jvmTarget = "17" - } - } - } - linuxX64() - mingwX64() - linuxArm64() - - sourceSets { - commonMain { - dependencies { - implementation kotlin('stdlib') - api libs.kt.serialization - } - } - commonTest { - dependencies { - implementation kotlin('test') - implementation kotlin('test-annotations-common') - implementation libs.kt.coroutines.test - } - } - - androidUnitTest { - dependencies { - implementation kotlin('test-junit') - implementation libs.android.test.junit - implementation libs.android.espresso - } - } - jvmTest { - dependencies { - implementation kotlin('test-junit') - } - } - jsTest { - dependencies { - implementation kotlin('test-js') - } - } - wasmJsTest { - dependencies { - implementation kotlin('test-wasm-js') - } - } - nativeMain.dependsOn commonMain - linuxX64Main.dependsOn nativeMain - mingwX64Main.dependsOn nativeMain - linuxArm64Main.dependsOn nativeMain - - androidMain.dependsOn jvmMain - } -} - -apply from: "$defaultAndroidSettings" - -java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 -} diff --git a/gradle/templates/mppJvmJsWasmJsLinuxMingwProject.gradle b/gradle/templates/mppJvmJsWasmJsLinuxMingwProject.gradle index cfe86191061..d175019a855 100644 --- a/gradle/templates/mppJvmJsWasmJsLinuxMingwProject.gradle +++ b/gradle/templates/mppJvmJsWasmJsLinuxMingwProject.gradle @@ -1,92 +1,6 @@ -project.version = "$version" -project.group = "$group" - +apply from: "$defaultProjectWithSerialization" +apply from: "$enableMPPJvm" +apply from: "$enableMPPJs" +apply from: "$enableMPPWasmJs" +apply from: "$enableMPPNativeX64" apply from: "$publish" - -kotlin { - jvm { - compilations.main { - kotlinOptions { - jvmTarget = "17" - } - } - } - js (IR) { - browser { - testTask { - useMocha { - timeout = "240000" - } - } - } - nodejs { - testTask { - useMocha { - timeout = "240000" - } - } - } - } - wasmJs { - browser { - testTask { - useKarma { - useChromeHeadless() - useConfigDirectory(rootProject.relativeProjectPath("gradle/karma.config.d")) - } - } - } - nodejs { - testTask { - timeout = Duration.ofSeconds(240) - nodeJsArgs.add("--unhandled-rejections=warn") - nodeJsArgs.add("--trace-warnings") - } - } - } - linuxX64() - mingwX64() - - sourceSets { - commonMain { - dependencies { - implementation kotlin('stdlib') - api libs.kt.serialization - } - } - commonTest { - dependencies { - implementation kotlin('test-common') - implementation kotlin('test-annotations-common') - implementation libs.kt.coroutines.test - } - } - - jvmTest { - dependencies { - implementation kotlin('test-junit') - } - } - jsTest { - dependencies { - implementation kotlin('test-js') - } - } - wasmJsTest { - dependencies { - implementation kotlin('test-wasm-js') - } - } - - nativeMain.dependsOn commonMain - linuxX64Main.dependsOn nativeMain - mingwX64Main.dependsOn nativeMain - - androidMain.dependsOn jvmMain - } -} - -java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 -} diff --git a/gradle/templates/mppProjectWithSerializationAndCompose.gradle b/gradle/templates/mppProjectWithSerializationAndCompose.gradle index df9b6b3ccf7..e92ba3322f6 100644 --- a/gradle/templates/mppProjectWithSerializationAndCompose.gradle +++ b/gradle/templates/mppProjectWithSerializationAndCompose.gradle @@ -1,120 +1,10 @@ -project.version = "$version" -project.group = "$group" - +apply from: "$defaultProjectWithSerialization" +apply from: "$enableMPPJvm" +apply from: "$enableMPPJs" +apply from: "$enableMPPWasmJs" +apply from: "$enableMPPAndroid" +apply from: "$addCompose" +apply from: "$addComposeForAndroid" +apply from: "$addComposeForDesktop" +apply from: "$addComposeForJs" apply from: "$publish" - -kotlin { - jvm { - compilations.main { - kotlinOptions { - jvmTarget = "17" - } - } - } - js (IR) { - browser { - testTask { - useMocha { - timeout = "240000" - } - } - } - nodejs { - testTask { - useMocha { - timeout = "240000" - } - } - } - } - wasmJs { - browser { - testTask { - useKarma { - useChromeHeadless() - useConfigDirectory(rootProject.relativeProjectPath("gradle/karma.config.d")) - } - } - } - nodejs { - testTask { - timeout = Duration.ofSeconds(240) - nodeJsArgs.add("--unhandled-rejections=warn") - nodeJsArgs.add("--trace-warnings") - } - } - } - androidTarget { - publishAllLibraryVariants() - compilations.all { - kotlinOptions { - jvmTarget = "17" - } - } - } - - sourceSets { - commonMain { - dependencies { - implementation kotlin('stdlib') - implementation compose.runtime - api libs.kt.serialization - } - } - commonTest { - dependencies { - implementation kotlin('test-common') - implementation kotlin('test-annotations-common') - implementation libs.kt.coroutines.test - } - } - jvmMain { - dependencies { - implementation compose.desktop.currentOs - } - } - jvmTest { - dependencies { - implementation kotlin('test-junit') - implementation compose.uiTest - } - } - jsMain { - dependencies { - implementation compose.web.core - } - } - jsTest { - dependencies { - implementation kotlin('test-js') - } - } - wasmJsTest { - dependencies { - implementation kotlin('test-wasm-js') - } - } - androidUnitTest { - dependencies { - implementation kotlin('test-junit') - implementation libs.android.test.junit - implementation libs.android.espresso - implementation compose.uiTest - } - } - } -} - -apply from: "$defaultAndroidSettings" - -java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 -} - - -//compose { -// if (composePluginKotlinVersion != null && !composePluginKotlinVersion.isEmpty()) { -// kotlinCompilerPlugin.set(composePluginKotlinVersion) -// } -//} diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e382118b03d..2733ed5dc3c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists