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.isPublicModule
56import util.other.libs
7+ import util.other.maybeNamed
8+ import util.tasks.ValidatePublishedArtifactsTask
69import util.tasks.configureNpm
710import util.tasks.registerChangelogTask
811import util.tasks.registerDumpPlatformTableTask
@@ -27,6 +30,17 @@ allprojects {
2730 plugins.apply (" project-report" )
2831}
2932
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+
3044dokka {
3145 val libVersion = libs.versions.kotlinx.rpc.get()
3246
@@ -84,7 +98,7 @@ registerDumpPlatformTableTask()
8498registerVerifyPlatformTableTask()
8599registerChangelogTask()
86100
87- fun Project.forEachSubproject (action : (String , Path , Path ) -> Unit ) {
101+ fun Project.forEachIncludedProject (action : (String , Path , Path ) -> Unit ) {
88102 val globalRootDir: String by extra
89103 val root = Path .of(globalRootDir)
90104 val rootProperties = root.resolve(" gradle.properties" ).readText()
@@ -100,7 +114,7 @@ fun Project.forEachSubproject(action: (String, Path, Path) -> Unit) {
100114}
101115
102116val updateProperties = tasks.register(" updateProperties" ) {
103- forEachSubproject { rootProperties, _, subProjectProperties ->
117+ forEachIncludedProject { rootProperties, _, subProjectProperties ->
104118 if (! subProjectProperties.exists()) {
105119 subProjectProperties.createFile()
106120 }
@@ -114,7 +128,7 @@ gradle.afterProject {
114128 return @afterProject
115129 }
116130
117- forEachSubproject { rootProperties, parent, subProjectProperties ->
131+ forEachIncludedProject { rootProperties, parent, subProjectProperties ->
118132 if (! subProjectProperties.exists() || subProjectProperties.readText() != rootProperties) {
119133 throw GradleException (
120134 " 'gradle.properties' file in ${parent.name} included project is not up-to-date with root. " +
0 commit comments