Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle-conventions/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/

plugins {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,11 @@ fun KotlinCommonCompilerOptions.setProjectLanguageVersion() {
withKotlinJvmExtension {
optInForRpcApi()

target.compilations
.filter { it.isMain }
.forEach { compilation ->
compilation.compileJavaTaskProvider.configure {
compilerOptions.setProjectLanguageVersion()
}
}
compilerOptions.setProjectLanguageVersion()
}

withKotlinKmpExtension {
optInForRpcApi()

targets.flatMap { it.compilations }
.filter { it.isMain }
.forEach { compilation ->
compilation.compileTaskProvider.configure {
compilerOptions.setProjectLanguageVersion()
}
}
compilerOptions.setProjectLanguageVersion()
}

val KotlinCompilation<*>.isMain get() = name.lowercase().contains("main")
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import org.gradle.kotlin.dsl.registering
import util.*
import util.other.capitalized
import util.other.getSensitiveProperty
import util.other.isPublicModule
import util.tasks.ValidatePublishedArtifactsTask
Expand All @@ -21,7 +22,23 @@ if (isPublicModule) {
apply(plugin = "signing")
}

the<PublishingExtension>().configurePublication()
the<PublishingExtension>().apply {
configurePublication()

project.withKotlinKmpExtension {
// Remove then first Jvm Only public module is created
val publishMavenPublication = "publishMavenPublication"
repositories.all {
val publishTaskName = "${publishMavenPublication}To${name.capitalized()}Repository"
if (tasks.findByName(publishTaskName) == null) {
tasks.register(publishTaskName) {
group = PublishingPlugin.PUBLISH_TASK_GROUP
}
}
}
}
}

logger.info("Configured ${project.name} for publication")
} else {
logger.info("Skipping ${project.name} publication configuration, not a public module")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/

import util.other.capitalized
import util.other.isPublicModule
import util.other.libs
import util.other.maybeNamed
Expand Down Expand Up @@ -34,13 +35,6 @@ tasks.register<ValidatePublishedArtifactsTask>(ValidatePublishedArtifactsTask.NA
dependsOn(subprojects.filter { it.isPublicModule })
}

// Remove then first Jvm Only public module is created
val publishMavenPublicationToBuildRepoRepository = "publishMavenPublicationToBuildRepoRepository"
tasks.maybeNamed(publishMavenPublicationToBuildRepoRepository)
?: tasks.register(publishMavenPublicationToBuildRepoRepository) {
group = PublishingPlugin.PUBLISH_TASK_GROUP
}

dokka {
val libVersion = libs.versions.kotlinx.rpc.get()

Expand Down
12 changes: 12 additions & 0 deletions gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

/*
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/

plugins {
`kotlin-dsl`
Expand All @@ -18,6 +23,13 @@ kotlin {
explicitApi()
}

tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0
languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0
}
}

dependencies {
compileOnly(libs.kotlin.gradle.plugin)
}
Expand Down