Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(fix): register downloadOpenapi for all subprojects #1413

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DEPENDENCIES
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
maven/mavencentral/com.apicatalog/carbon-did/0.3.0, Apache-2.0, approved, clearlydefined

Check warning on line 1 in DEPENDENCIES

View workflow job for this annotation

GitHub Actions / verify / verify-dependencies / Dash-Verify-Licenses

Restricted Dependencies found

Some dependencies are marked 'restricted' - please review them
maven/mavencentral/com.apicatalog/copper-multibase/0.5.0, Apache-2.0, approved, #14501
maven/mavencentral/com.apicatalog/copper-multicodec/0.1.1, Apache-2.0, approved, #14500
maven/mavencentral/com.apicatalog/iron-ed25519-cryptosuite-2020/0.14.0, Apache-2.0, approved, #14503
Expand Down Expand Up @@ -217,7 +217,7 @@
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
Expand Down
40 changes: 21 additions & 19 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -217,25 +238,6 @@ tasks.check {
dependsOn(tasks.named<JacocoReport>("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<ResolvedDependency> {
return listOf(dependency) + dependency.children.map { child -> childrenDependencies(child) }.flatten()
Expand Down
Loading