File tree Expand file tree Collapse file tree 5 files changed +34
-25
lines changed Expand file tree Collapse file tree 5 files changed +34
-25
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
2+ * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33 */
44
55plugins {
Original file line number Diff line number Diff line change @@ -32,25 +32,11 @@ fun KotlinCommonCompilerOptions.setProjectLanguageVersion() {
3232withKotlinJvmExtension {
3333 optInForRpcApi()
3434
35- target.compilations
36- .filter { it.isMain }
37- .forEach { compilation ->
38- compilation.compileJavaTaskProvider.configure {
39- compilerOptions.setProjectLanguageVersion()
40- }
41- }
35+ compilerOptions.setProjectLanguageVersion()
4236}
4337
4438withKotlinKmpExtension {
4539 optInForRpcApi()
4640
47- targets.flatMap { it.compilations }
48- .filter { it.isMain }
49- .forEach { compilation ->
50- compilation.compileTaskProvider.configure {
51- compilerOptions.setProjectLanguageVersion()
52- }
53- }
41+ compilerOptions.setProjectLanguageVersion()
5442}
55-
56- val KotlinCompilation <* >.isMain get() = name.lowercase().contains(" main" )
Original file line number Diff line number Diff line change 44
55import org.gradle.kotlin.dsl.registering
66import util.*
7+ import util.other.capitalized
78import util.other.getSensitiveProperty
89import util.other.isPublicModule
910import util.tasks.ValidatePublishedArtifactsTask
@@ -21,7 +22,23 @@ if (isPublicModule) {
2122 apply (plugin = " signing" )
2223 }
2324
24- the<PublishingExtension >().configurePublication()
25+ the<PublishingExtension >().apply {
26+ configurePublication()
27+
28+ project.withKotlinKmpExtension {
29+ // Remove then first Jvm Only public module is created
30+ val publishMavenPublication = " publishMavenPublication"
31+ repositories.all {
32+ val publishTaskName = " ${publishMavenPublication} To${name.capitalized()} Repository"
33+ if (tasks.findByName(publishTaskName) == null ) {
34+ tasks.register(publishTaskName) {
35+ group = PublishingPlugin .PUBLISH_TASK_GROUP
36+ }
37+ }
38+ }
39+ }
40+ }
41+
2542 logger.info(" Configured ${project.name} for publication" )
2643} else {
2744 logger.info(" Skipping ${project.name} publication configuration, not a public module" )
Original file line number Diff line number Diff line change 22 * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33 */
44
5+ import util.other.capitalized
56import util.other.isPublicModule
67import util.other.libs
78import util.other.maybeNamed
@@ -34,13 +35,6 @@ tasks.register<ValidatePublishedArtifactsTask>(ValidatePublishedArtifactsTask.NA
3435 dependsOn(subprojects.filter { it.isPublicModule })
3536}
3637
37- // Remove then first Jvm Only public module is created
38- val publishMavenPublicationToBuildRepoRepository = " publishMavenPublicationToBuildRepoRepository"
39- tasks.maybeNamed(publishMavenPublicationToBuildRepoRepository)
40- ? : tasks.register(publishMavenPublicationToBuildRepoRepository) {
41- group = PublishingPlugin .PUBLISH_TASK_GROUP
42- }
43-
4438dokka {
4539 val libVersion = libs.versions.kotlinx.rpc.get()
4640
Original file line number Diff line number Diff line change 22 * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
33 */
44
5+ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
6+
7+ /*
8+ * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
9+ */
510
611plugins {
712 `kotlin- dsl`
@@ -18,6 +23,13 @@ kotlin {
1823 explicitApi()
1924}
2025
26+ tasks.withType<KotlinCompile >().configureEach {
27+ compilerOptions {
28+ apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion .KOTLIN_2_0
29+ languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion .KOTLIN_2_0
30+ }
31+ }
32+
2133dependencies {
2234 compileOnly(libs.kotlin.gradle.plugin)
2335}
You can’t perform that action at this time.
0 commit comments