-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sbt
66 lines (56 loc) · 2.35 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
name := "joern-sample-extension"
ThisBuild/organization := "io.joern"
ThisBuild/scalaVersion := "2.13.4"
enablePlugins(JavaAppPackaging)
lazy val schema = project.in(file("schema"))
lazy val domainClasses = project.in(file("domain-classes"))
lazy val schemaExtender = project.in(file("schema-extender"))
dependsOn(domainClasses)
libraryDependencies ++= Seq(
"io.shiftleft" %% "semanticcpg" % Versions.cpg,
"io.shiftleft" %% "fuzzyc2cpg-tests" % Versions.cpg % Test classifier "tests",
"org.scalatest" %% "scalatest" % "3.1.1" % Test,
// The eclipse.jgit dependency is specific to this example
"org.eclipse.jgit" % "org.eclipse.jgit" % "5.7.0.202003110725-r"
)
// We exclude a few jars that the main joern distribution already includes
Universal / mappings := (Universal / mappings).value.filterNot {
case (_, path) => path.contains("org.scala") ||
path.contains("net.sf.trove4") ||
path.contains("com.google.guava") ||
path.contains("org.apache.logging") ||
path.contains("com.google.protobuf") ||
path.contains("com.lihaoyi.u") ||
path.contains("io.shiftleft") ||
path.contains("org.typelevel") ||
path.contains("io.undertow") ||
path.contains("org.json4s") ||
path.contains("com.chuusai") ||
path.contains("io.get-coursier") ||
path.contains("io.circe") ||
path.contains("net.java.dev") ||
path.contains("com.github.javaparser") ||
path.contains("org.javassist") ||
// Also include the classes generated from the custom schema
// We will add these via the schema-extender so that multiple
// plugins can modify the schema used in a joern installation
path.contains("io.joern.schema")
}
lazy val createDistribution = taskKey[Unit]("Create binary distribution of extension")
createDistribution := {
val pkgBin = (Universal/packageBin).value
val dstArchive = file("./plugin.zip")
IO.copyFile(pkgBin, dstArchive,
CopyOptions(overwrite = true, preserveLastModified = true, preserveExecutable = true))
println(s"created distribution - resulting files: $dstArchive")
}
ThisBuild/Compile/scalacOptions ++= Seq(
"-feature",
"-deprecation",
"-language:implicitConversions",
)
Global/onChangedBuildSource := ReloadOnSourceChanges
ThisBuild/resolvers ++= Seq(
Resolver.mavenLocal,
"Sonatype OSS" at "https://oss.sonatype.org/content/repositories/public")
maintainer := "[email protected]"