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 1
1
/*
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.
3
3
*/
4
4
5
5
plugins {
Original file line number Diff line number Diff line change @@ -32,25 +32,11 @@ fun KotlinCommonCompilerOptions.setProjectLanguageVersion() {
32
32
withKotlinJvmExtension {
33
33
optInForRpcApi()
34
34
35
- target.compilations
36
- .filter { it.isMain }
37
- .forEach { compilation ->
38
- compilation.compileJavaTaskProvider.configure {
39
- compilerOptions.setProjectLanguageVersion()
40
- }
41
- }
35
+ compilerOptions.setProjectLanguageVersion()
42
36
}
43
37
44
38
withKotlinKmpExtension {
45
39
optInForRpcApi()
46
40
47
- targets.flatMap { it.compilations }
48
- .filter { it.isMain }
49
- .forEach { compilation ->
50
- compilation.compileTaskProvider.configure {
51
- compilerOptions.setProjectLanguageVersion()
52
- }
53
- }
41
+ compilerOptions.setProjectLanguageVersion()
54
42
}
55
-
56
- val KotlinCompilation <* >.isMain get() = name.lowercase().contains(" main" )
Original file line number Diff line number Diff line change 4
4
5
5
import org.gradle.kotlin.dsl.registering
6
6
import util.*
7
+ import util.other.capitalized
7
8
import util.other.getSensitiveProperty
8
9
import util.other.isPublicModule
9
10
import util.tasks.ValidatePublishedArtifactsTask
@@ -21,7 +22,23 @@ if (isPublicModule) {
21
22
apply (plugin = " signing" )
22
23
}
23
24
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
+
25
42
logger.info(" Configured ${project.name} for publication" )
26
43
} else {
27
44
logger.info(" Skipping ${project.name} publication configuration, not a public module" )
Original file line number Diff line number Diff line change 2
2
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3
3
*/
4
4
5
+ import util.other.capitalized
5
6
import util.other.isPublicModule
6
7
import util.other.libs
7
8
import util.other.maybeNamed
@@ -34,13 +35,6 @@ tasks.register<ValidatePublishedArtifactsTask>(ValidatePublishedArtifactsTask.NA
34
35
dependsOn(subprojects.filter { it.isPublicModule })
35
36
}
36
37
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
-
44
38
dokka {
45
39
val libVersion = libs.versions.kotlinx.rpc.get()
46
40
Original file line number Diff line number Diff line change 2
2
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
3
3
*/
4
4
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
+ */
5
10
6
11
plugins {
7
12
`kotlin- dsl`
@@ -18,6 +23,13 @@ kotlin {
18
23
explicitApi()
19
24
}
20
25
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
+
21
33
dependencies {
22
34
compileOnly(libs.kotlin.gradle.plugin)
23
35
}
You can’t perform that action at this time.
0 commit comments