-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from siculo/projects/v0.2.0
Projects/v0.2.0 (to keep master in sync with all v0.2.0 changes)
- Loading branch information
Showing
18 changed files
with
766 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
ThisBuild / organization := "sbtBom" | ||
ThisBuild / organizationName := "SBT BOM" | ||
ThisBuild / version := "0.2.0-SNAPSHOT" | ||
ThisBuild / scalaVersion := "2.12.8" | ||
ThisBuild / homepage := Some(url("https://github.com/siculo/sbt-bom")) | ||
|
||
lazy val root = (project in file(".")) | ||
.enablePlugins(ScriptedPlugin) | ||
.settings( | ||
name := "sbt-bom", | ||
organization := "sbtBom", | ||
organizationName := "SBT BOM", | ||
version := "0.2.0-SNAPSHOT", | ||
sbtPlugin := true, | ||
scalaVersion := "2.12.8", | ||
libraryDependencies ++= Dependencies.library, | ||
scriptedLaunchOpts += ("-Dplugin.version=" + version.value), | ||
scriptedLaunchOpts := { | ||
scriptedLaunchOpts.value ++ Seq("-Xmx1024M", "-Dplugin.version=" + version.value) | ||
}, | ||
scriptedBufferLog := false, | ||
dependencyOverrides += "org.typelevel" %% "jawn-parser" % "0.14.1" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package sbtBom | ||
|
||
import org.cyclonedx.CycloneDxSchema | ||
import sbt.Configuration | ||
|
||
case class BomExtractorParams(schemaVersion: CycloneDxSchema.Version, | ||
configuration: Configuration) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,30 @@ | ||
package sbtBom | ||
|
||
import sbt.Keys.target | ||
import sbt._ | ||
|
||
/** | ||
* plugin object | ||
*/ | ||
object BomSbtPlugin extends AutoPlugin { | ||
|
||
override def requires: Plugins = empty | ||
|
||
override def trigger: PluginTrigger = allRequirements | ||
|
||
object autoImport extends BomSbtKeys | ||
object autoImport { | ||
lazy val targetBomFile: SettingKey[sbt.File] = settingKey[File]("target file to store the generated bom") | ||
lazy val makeBom: TaskKey[sbt.File] = taskKey[sbt.File]("Generates bom file which includes all project dependencies") | ||
lazy val listBom: TaskKey[String] = taskKey[String]("Returns a bom which includes all project dependencies") | ||
lazy val supportedConfigurations: Seq[Configuration] = Seq(Compile, Runtime, Test) | ||
} | ||
|
||
override lazy val projectSettings: Seq[Setting[_]] = BomSbtSettings.projectSettings | ||
import autoImport._ | ||
|
||
override lazy val projectSettings: Seq[Setting[_]] = | ||
Seq( | ||
targetBomFile := target.value / "bom.xml", | ||
makeBom := Def.taskDyn(BomSbtSettings.makeBomTask(Classpaths.updateTask.value)).value, | ||
listBom := Def.taskDyn(BomSbtSettings.listBomTask(Classpaths.updateTask.value)).value, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"name":"sbt","version":"1.5.2","bspVersion":"2.0.0-M5","languages":["scala"],"argv":["/home/fabrizio/Applications/java/jdk1.8.0_211/jre/bin/java","-Xms100m","-Xmx100m","-classpath","/home/fabrizio/Applications/sbt/sbt-1.5.2/bin/sbt-launch.jar","xsbt.boot.Boot","-bsp","--sbt-launch-jar=/home/fabrizio/Applications/sbt/sbt-1.5.2/bin/sbt-launch.jar"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import scala.xml.XML | ||
|
||
|
||
lazy val root = (project in file(".")) | ||
.settings( | ||
name := "dependencies", | ||
version := "0.1", | ||
libraryDependencies ++= Dependencies.library, | ||
scalaVersion := "2.12.8", | ||
check := checkTask.value | ||
) | ||
|
||
lazy val check = taskKey[Unit]("check") | ||
lazy val checkTask = Def.task { | ||
val context = thisProject.value | ||
val expected = XML.loadFile(file(s"${context.base}/etc/bom.xml")) | ||
val actual = XML.loadFile(file(s"${context.base}/target/bom.xml")) | ||
require(expected \ "components" == actual \ "components", s"${context.id} is failed.") | ||
} |
Oops, something went wrong.