From b6e2ffb7180224191b0233b6af7e07031168a158 Mon Sep 17 00:00:00 2001 From: ndr_brt Date: Wed, 10 Jul 2024 09:40:42 +0200 Subject: [PATCH] build(fix): register downloadOpenapi for all subprojects --- DEPENDENCIES | 2 +- build.gradle.kts | 40 +++++++++++++++++++++------------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/DEPENDENCIES b/DEPENDENCIES index 2ea54dc9a..99a5dcba1 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -217,7 +217,7 @@ maven/mavencentral/io.prometheus/simpleclient_tracer_otel/0.16.0, Apache-2.0, ap maven/mavencentral/io.prometheus/simpleclient_tracer_otel_agent/0.16.0, Apache-2.0, approved, clearlydefined maven/mavencentral/io.rest-assured/json-path/5.5.0, Apache-2.0, approved, clearlydefined maven/mavencentral/io.rest-assured/rest-assured-common/5.5.0, Apache-2.0, approved, clearlydefined -maven/mavencentral/io.rest-assured/rest-assured/5.5.0, Apache-2.0, restricted, clearlydefined +maven/mavencentral/io.rest-assured/rest-assured/5.5.0, Apache-2.0, approved, #15676 maven/mavencentral/io.rest-assured/xml-path/5.5.0, Apache-2.0, approved, clearlydefined maven/mavencentral/io.setl/rdf-urdna/1.1, Apache-2.0, approved, clearlydefined maven/mavencentral/io.swagger.core.v3/swagger-annotations-jakarta/2.2.21, Apache-2.0, approved, #5947 diff --git a/build.gradle.kts b/build.gradle.kts index 7c21d4d28..2fec7596d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -204,6 +204,27 @@ subprojects { .dependsOn(copyLegalDocs) } } + + tasks.register("downloadOpenapi") { + outputs.dir(project.layout.buildDirectory.dir("docs/openapi")) + doLast { + val destinationDirectory = layout.buildDirectory.asFile.get().toPath() + .resolve("docs").resolve("openapi") + + configurations.asMap.values + .asSequence() + .filter { it.isCanBeResolved } + .map { it.resolvedConfiguration.firstLevelModuleDependencies }.flatten() + .map { childrenDependencies(it) }.flatten() + .distinct() + .forEach { dep -> + downloadYamlArtifact(dep, "management-api", destinationDirectory); + downloadYamlArtifact(dep, "observability-api", destinationDirectory); + downloadYamlArtifact(dep, "public-api", destinationDirectory); + } + } + } + } nexusPublishing { @@ -217,25 +238,6 @@ tasks.check { dependsOn(tasks.named("testCodeCoverageReport")) } -tasks.register("downloadOpenapi") { - outputs.dir(project.layout.buildDirectory.dir("docs/openapi")) - doLast { - val destinationDirectory = layout.buildDirectory.asFile.get().toPath() - .resolve("docs").resolve("openapi") - - configurations.asMap.values - .asSequence() - .filter { it.isCanBeResolved } - .map { it.resolvedConfiguration.firstLevelModuleDependencies }.flatten() - .map { childrenDependencies(it) }.flatten() - .distinct() - .forEach { dep -> - downloadYamlArtifact(dep, "management-api", destinationDirectory); - downloadYamlArtifact(dep, "observability-api", destinationDirectory); - downloadYamlArtifact(dep, "public-api", destinationDirectory); - } - } -} fun childrenDependencies(dependency: ResolvedDependency): List { return listOf(dependency) + dependency.children.map { child -> childrenDependencies(child) }.flatten()