Skip to content

Commit

Permalink
Merge pull request #57 from raboof/publish-bom
Browse files Browse the repository at this point in the history
Publish sbom along with other artifacts
  • Loading branch information
raboof authored Oct 18, 2024
2 parents 28bdfe0 + 66c0d8c commit da10d7d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ docstrings.style = Asterisk
# This also seems more idiomatic to include whitespace in import x.{ yyy }
spaces.inImportCurlyBraces = true

rewrite.trailingCommas.style = keep

align.tokens."+" = [
{
code = "%"
Expand Down
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 @@ -51,7 +52,10 @@ object BomSbtPlugin extends AutoPlugin {
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", "xml", "cyclonedx") -> makeBom.value
},
)
}
}

0 comments on commit da10d7d

Please sign in to comment.