Migrate bom project to kts. (#2638)

This commit is contained in:
Anuraag Agrawal 2021-02-02 09:10:46 +09:00 committed by GitHub
parent a92ad2a7a0
commit 94955b958f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 25 deletions

View File

@ -1,25 +0,0 @@
plugins {
id "java-platform"
id "maven-publish"
}
description = 'OpenTelemetry Bill of Materials'
group = "io.opentelemetry"
archivesBaseName = "opentelemetry-bom"
afterEvaluate {
dependencies {
constraints {
rootProject.subprojects.sort { "$it.archivesBaseName" }
.collect { it }
.findAll { it.name != project.name }
// We only include prod artifacts, which is the default when otel.release isn't set.
.findAll { it.findProperty("otel.release") == null }
.each { project ->
project.plugins.withId("maven-publish") {
api project
}
}
}
}
}

30
bom/build.gradle.kts Normal file
View File

@ -0,0 +1,30 @@
plugins {
id("java-platform")
id("maven-publish")
}
description = "OpenTelemetry Bill of Materials"
group = "io.opentelemetry"
base.archivesBaseName = "opentelemetry-bom"
rootProject.subprojects.forEach { subproject ->
if (project != subproject) {
evaluationDependsOn(subproject.path)
}
}
afterEvaluate {
dependencies {
constraints {
rootProject.subprojects
.sortedBy { it.findProperty("archivesBaseName") as String? }
.filter { it.name != project.name }
.filter { !it.hasProperty("otel.release") }
.forEach { project ->
project.plugins.withId("maven-publish") {
api(project)
}
}
}
}
}