Update SPDX gradle plugin
* fixes SPDX Gradle plugin to be used with configuration cache * allows removing output workaround for multimodule builds KTI-1427
This commit is contained in:
committed by
Space Team
parent
633e96b966
commit
c6aac835e5
@@ -81,16 +81,15 @@ fun Project.configureCommonPublicationSettingsForGradle(
|
||||
.configureEach {
|
||||
configureKotlinPomAttributes(project)
|
||||
if (sbom && project.name !in internalPlugins) {
|
||||
val buildDirectory = project.layout.buildDirectory
|
||||
if (name == "pluginMaven") {
|
||||
val sbomTask = configureSbom(target = "PluginMaven")
|
||||
artifact(buildDirectory.file("spdx/PluginMaven/PluginMaven.spdx.json")) {
|
||||
artifact(sbomTask) {
|
||||
extension = "spdx.json"
|
||||
builtBy(sbomTask)
|
||||
}
|
||||
} else if (name == "Main") {
|
||||
val sbomTask = configureSbom()
|
||||
artifact(buildDirectory.file("spdx/MainPublication/MainPublication.spdx.json")) {
|
||||
artifact(sbomTask) {
|
||||
extension = "spdx.json"
|
||||
builtBy(sbomTask)
|
||||
}
|
||||
|
||||
@@ -60,17 +60,14 @@ fun Project.configureSbom(
|
||||
})
|
||||
}
|
||||
|
||||
val sbomOutputDirectory = layout.buildDirectory.dir("spdx/$targetName")
|
||||
val spdxSbomTask = tasks.named<SpdxSbomTask>("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
|
||||
}
|
||||
|
||||
val sbomArtifact = artifacts.add(sbomCfg.name, sbomFile) {
|
||||
val sbomArtifact = artifacts.add(sbomCfg.name, spdxSbomTask) {
|
||||
type = "sbom"
|
||||
extension = "spdx.json"
|
||||
builtBy(spdxSbomTask)
|
||||
|
||||
Reference in New Issue
Block a user