-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.sbt
68 lines (61 loc) · 2.96 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
val cpgVersion = "1.7.3"
val joernVersion = "4.0.8"
val gitCommitString = SettingKey[String]("gitSha")
enablePlugins(JavaAppPackaging, BuildInfoPlugin)
lazy val Fast = config("fast").extend(Test)
configs(Fast)
inConfig(Fast)(Defaults.testTasks)
// run fast:test to exclude all tests tagged with @Slow:
Fast / testOptions += Tests.Argument("-l", "org.scalatest.tags.Slow")
Global / onChangedBuildSource := ReloadOnSourceChanges
Global / excludeLintKeys += Fast / configuration
Global / excludeLintKeys += gitCommitString
lazy val commonSettings = Seq(
scalaVersion := "3.4.2",
organization := "io.shiftleft",
scalacOptions ++= Seq("-Xtarget:8"),
resolvers ++= Seq(
Resolver.mavenLocal,
"Atlassian Maven Repository" at "https://maven.atlassian.com/repository/public"
),
libraryDependencies ++= Seq(
"io.shiftleft" %% "codepropertygraph" % cpgVersion,
"io.joern" %% "x2cpg" % joernVersion,
"com.github.scopt" %% "scopt" % "4.1.0",
"org.graalvm.js" % "js" % "22.3.4",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.15.3",
"com.atlassian.sourcemap" % "sourcemap" % "2.0.0",
"commons-io" % "commons-io" % "2.13.0",
"org.slf4j" % "slf4j-api" % "2.0.7",
"org.apache.logging.log4j" % "log4j-slf4j2-impl" % "2.20.0" % Optional,
"org.apache.logging.log4j" % "log4j-core" % "2.20.0" % Optional,
"io.joern" %% "x2cpg" % joernVersion % Test classifier "tests",
"org.scalatest" %% "scalatest" % "3.2.18" % Test
)
)
lazy val js2cpg = (project in file(".")).settings(
commonSettings,
name := "js2cpg",
Test / unmanagedResources ++= Seq(
baseDirectory.value / "src" / "test" / "resources" / "privatemodules" / ".npmrc",
baseDirectory.value / "src" / "test" / "resources" / "ignoreprivatemodules" / ".npmrc",
baseDirectory.value / "src" / "test" / "resources" / "enginecheck" / ".npmrc"
),
Test / javaOptions ++= Seq("-Dlog4j.configurationFile=file:src/test/resources/log4j2-test.xml"),
publishTo := sonatypePublishToBundle.value,
sonatypeTimeoutMillis := 7200000,
scmInfo := Some(
ScmInfo(url("https://github.com/ShiftLeftSecurity/js2cpg"), "scm:[email protected]:ShiftLeftSecurity/js2cpg.git")
),
homepage := Some(url("https://github.com/ShiftLeftSecurity/js2cpg/")),
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
developers := List(
Developer("max-leuthaeuser", "Max Leuthäuser", "[email protected]", url("https://github.com/max-leuthaeuser"))
),
publishMavenStyle := true,
gitCommitString := git.gitHeadCommit.value.getOrElse("n/a"),
buildInfoKeys := Seq[BuildInfoKey](version, gitCommitString),
buildInfoPackage := "io.shiftleft.js2cpg.core"
)
Universal / packageName := name.value
Universal / topLevelDirectory := None