From 786653baf2efb2ce1074291c1f677918d8d0c035 Mon Sep 17 00:00:00 2001 From: "Alexander.Likhachev" Date: Wed, 7 Jun 2023 16:35:32 +0200 Subject: [PATCH] [Build] Use separate sbom directories per publication Currently, `SpdxSbomTask` declares output file not as `@OutputFile`, but `@OutputDirectory` leading to overlapping outputs problem. This way the problem is worked around. #KTI-1221 In Progress --- buildSrc/src/main/kotlin/sbom.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/kotlin/sbom.kt b/buildSrc/src/main/kotlin/sbom.kt index 8bfbf8ea03b..137a74ee350 100644 --- a/buildSrc/src/main/kotlin/sbom.kt +++ b/buildSrc/src/main/kotlin/sbom.kt @@ -47,8 +47,11 @@ fun Project.configureSbom( } } - val spdxSbomTask = tasks.named("spdxSbomFor$targetName") - val sbomFile = layout.buildDirectory.file("spdx/$targetName.spdx.json") + val sbomOutputDirectory = layout.buildDirectory.dir("spdx/$targetName") + val spdxSbomTask = tasks.named("spdxSbomFor$targetName") { + outputDirectory.set(sbomOutputDirectory) + } + val sbomFile = sbomOutputDirectory.map { it.file("$targetName.spdx.json") } val sbomCfg = configurations.maybeCreate("sbomFor$targetName").apply { isCanBeResolved = false isCanBeConsumed = true