Skip to content

Commit

Permalink
Publish sbom along with other artifacts
Browse files Browse the repository at this point in the history
I'd have liked to add a scripted test, but it seems scripted
doesn't allow referring to '$HOME' or '~' for checking files
have been created.

Implements #54
  • Loading branch information
raboof committed Oct 17, 2024
1 parent 218cc03 commit 8069deb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/scala/io/github/siculo/sbtbom/BomSbtPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package io.github.siculo.sbtbom

import io.github.siculo.sbtbom.PluginConstants._
import org.cyclonedx.model.Component
import sbt.Keys.{artifact, configuration, version}
import sbt.Keys.{artifact, configuration, packagedArtifacts, version}
import sbt.{Def, _}
import sbt.plugins.JvmPlugin

import scala.language.postfixOps

Expand All @@ -12,7 +13,7 @@ import scala.language.postfixOps
*/
object BomSbtPlugin extends AutoPlugin {

override def requires: Plugins = empty
override def requires: Plugins = JvmPlugin

override def trigger: PluginTrigger = allRequirements

Expand Down Expand Up @@ -44,7 +45,10 @@ object BomSbtPlugin extends AutoPlugin {
Test / listBom := Def.taskDyn(BomSbtSettings.listBomTask(Classpaths.updateTask.value, Test)).value,
IntegrationTest / makeBom := Def.taskDyn(BomSbtSettings.makeBomTask(Classpaths.updateTask.value, IntegrationTest)).value,
IntegrationTest / listBom := Def.taskDyn(BomSbtSettings.listBomTask(Classpaths.updateTask.value, IntegrationTest)).value,
bomConfigurations := Def.taskDyn(BomSbtSettings.bomConfigurationTask((configuration ?).value)).value
bomConfigurations := Def.taskDyn(BomSbtSettings.bomConfigurationTask((configuration ?).value)).value,
packagedArtifacts += {
Artifact(artifact.value.name, "cyclonedx", "cyclonedx.xml") -> makeBom.value
},
)
}
}

0 comments on commit 8069deb

Please sign in to comment.