plugins {
    id 'java-platform'
}

def name = project.name

dependencies {
    constraints {
        rootProject.subprojects.each {
            if (it.name == name) return
            if (!it.plugins.hasPlugin('maven-publish')) return
            evaluationDependsOn(it.path)
            it.publishing.publications.all {
                if (it.artifactId.endsWith("-kotlinMultiplatform")) return
                if (it.artifactId.endsWith("-metadata")) return
                // Skip platform artifacts (like *-linuxx64, *-macosx64)
                // It leads to inconsistent bom when publishing from different platforms
                // (e.g. on linux it will include only linuxx64 artifacts and no macosx64)
                // It shouldn't be a problem as usually consumers need to use generic *-native artifact
                // Gradle will choose correct variant by using metadata attributes
                if (it.artifacts.any { it.extension == 'klib' }) return
                api("${it.groupId}:${it.artifactId}:${it.version}")
            }
        }
    }
}

publishing {
    publications {
        mavenBom(MavenPublication) {
            from components.javaPlatform
        }
        // Disable metadata publication, no need to
        it.each { pub ->
            pub.moduleDescriptorGenerator = null
            tasks.matching { it.name == "generateMetadataFileFor${pub.name.capitalize()}Publication" }.all {
                onlyIf { false }
            }
        }
    }
}
