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.isPublicModule
5
6
import util.other.libs
7
+ import util.other.maybeNamed
8
+ import util.tasks.ValidatePublishedArtifactsTask
6
9
import util.tasks.configureNpm
7
10
import util.tasks.registerChangelogTask
8
11
import util.tasks.registerDumpPlatformTableTask
@@ -27,6 +30,17 @@ allprojects {
27
30
plugins.apply (" project-report" )
28
31
}
29
32
33
+ tasks.register<ValidatePublishedArtifactsTask >(ValidatePublishedArtifactsTask .NAME ) {
34
+ dependsOn(subprojects.filter { it.isPublicModule })
35
+ }
36
+
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
+
30
44
dokka {
31
45
val libVersion = libs.versions.kotlinx.rpc.get()
32
46
@@ -84,7 +98,7 @@ registerDumpPlatformTableTask()
84
98
registerVerifyPlatformTableTask()
85
99
registerChangelogTask()
86
100
87
- fun Project.forEachSubproject (action : (String , Path , Path ) -> Unit ) {
101
+ fun Project.forEachIncludedProject (action : (String , Path , Path ) -> Unit ) {
88
102
val globalRootDir: String by extra
89
103
val root = Path .of(globalRootDir)
90
104
val rootProperties = root.resolve(" gradle.properties" ).readText()
@@ -100,7 +114,7 @@ fun Project.forEachSubproject(action: (String, Path, Path) -> Unit) {
100
114
}
101
115
102
116
val updateProperties = tasks.register(" updateProperties" ) {
103
- forEachSubproject { rootProperties, _, subProjectProperties ->
117
+ forEachIncludedProject { rootProperties, _, subProjectProperties ->
104
118
if (! subProjectProperties.exists()) {
105
119
subProjectProperties.createFile()
106
120
}
@@ -114,7 +128,7 @@ gradle.afterProject {
114
128
return @afterProject
115
129
}
116
130
117
- forEachSubproject { rootProperties, parent, subProjectProperties ->
131
+ forEachIncludedProject { rootProperties, parent, subProjectProperties ->
118
132
if (! subProjectProperties.exists() || subProjectProperties.readText() != rootProperties) {
119
133
throw GradleException (
120
134
" 'gradle.properties' file in ${parent.name} included project is not up-to-date with root. " +
0 commit comments