From c9f72ee60dfeb4714a64f38430cacff51582a14c Mon Sep 17 00:00:00 2001 From: Anuraag Agrawal Date: Wed, 30 Jun 2021 19:22:30 +0900 Subject: [PATCH] Migrate bom-alpha build to kotlin (#3450) * Migrate bom-alpha build to kotlin * Remove sorting since doesn't make much difference --- bom-alpha/{build.gradle => build.gradle.kts} | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) rename bom-alpha/{build.gradle => build.gradle.kts} (57%) diff --git a/bom-alpha/build.gradle b/bom-alpha/build.gradle.kts similarity index 57% rename from bom-alpha/build.gradle rename to bom-alpha/build.gradle.kts index 46caa782de..8ef5257dd9 100644 --- a/bom-alpha/build.gradle +++ b/bom-alpha/build.gradle.kts @@ -6,9 +6,9 @@ plugins { description = "OpenTelemetry Instrumentation Bill of Materials (Alpha)" group = "io.opentelemetry.instrumentation" -archivesBaseName = "opentelemetry-instrumentation-bom-alpha" +base.archivesName.set("opentelemetry-instrumentation-bom-alpha") -rootProject.subprojects.forEach { subproject -> +for (subproject in rootProject.subprojects) { if (!subproject.name.startsWith("bom")) { evaluationDependsOn(subproject.path) } @@ -18,7 +18,7 @@ javaPlatform { allowDependencies() } -def otelVersion = findProperty("otelVersion") +val otelVersion: String by project dependencies { api(platform("io.opentelemetry:opentelemetry-bom:${otelVersion}")) @@ -27,14 +27,12 @@ dependencies { afterEvaluate { dependencies { - constraints { - rootProject.subprojects.sort { "$it.archivesBaseName" } - .collect { it } - .findAll { it.name != project.name && it.name != 'javaagent'} - .forEach { project -> - project.plugins.withId("maven-publish") { - api(project) + rootProject.subprojects + .filter { it.name != project.name && it.name != "javaagent" } + .forEach { proj -> + proj.plugins.withId("maven-publish") { + api(proj) } } }