This repository has been archived by the owner on Oct 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.sbt
93 lines (80 loc) · 3.38 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name := "batteries"
ThisBuild/organization := "io.joern"
ThisBuild/scalaVersion := "2.13.5"
// don't upgrade to 2.13.6 until https://github.com/com-lihaoyi/Ammonite/issues/1182 is resolved
val cpgVersion = "1.3.379"
val ghidra2cpgVersion = "0.0.43"
enablePlugins(JavaAppPackaging)
libraryDependencies ++= Seq(
"com.lihaoyi" %% "sourcecode" % "0.1.9",
"com.lihaoyi" %% "upickle" % "1.2.2",
"com.github.pathikrit" %% "better-files" % "3.8.0",
"com.github.scopt" %% "scopt" % "3.7.1",
"org.apache.logging.log4j" % "log4j-slf4j-impl" % "2.13.3" % Runtime,
"io.joern" %% "ghidra2cpg" % ghidra2cpgVersion,
"io.shiftleft" %% "semanticcpg" % cpgVersion,
"io.shiftleft" %% "console" % cpgVersion,
"io.shiftleft" %% "dataflowengineoss" % cpgVersion,
"io.shiftleft" %% "fuzzyc2cpg-tests" % cpgVersion % Test classifier "tests",
"io.shiftleft" %% "c2cpg-tests" % cpgVersion % Test classifier "tests",
"io.shiftleft" %% "semanticcpg-tests" % cpgVersion % Test classifier "tests",
"io.shiftleft" %% "fuzzyc2cpg" % cpgVersion % Test,
"io.shiftleft" %% "c2cpg" % cpgVersion % Test,
"org.scalatest" %% "scalatest" % "3.1.1" % Test,
"io.joern" %% "ghidra2cpg-tests" % ghidra2cpgVersion % Test classifier "tests"
)
Compile/doc/sources := Seq.empty
Compile/packageDoc/publishArtifact := false
lazy val createDistribution = taskKey[Unit]("Create binary distribution of extension")
createDistribution := {
val pkgBin = (Universal/packageBin).value
val tmpDstArchive = "/tmp/querydb.zip"
val dstArchive = "querydb.zip"
IO.copy(
List((pkgBin, file(tmpDstArchive))),
CopyOptions(overwrite = true, preserveLastModified = true, preserveExecutable = true)
)
val f = better.files.File(dstArchive)
better.files.File.usingTemporaryDirectory("querydb") { dir =>
better.files.File(tmpDstArchive).unzipTo(dir)
dir.listRecursively.filter{ x => val name = x.toString
name.contains("org.scala") ||
name.contains("net.sf.trove4") ||
name.contains("com.google.guava") ||
name.contains("org.apache.logging") ||
name.contains("com.google.protobuf") ||
name.contains("com.lihaoyi") ||
name.contains("io.shiftleft") ||
name.contains("org.typelevel") ||
name.contains("io.undertow") ||
name.contains("com.chuusai") ||
name.contains("io.get-coursier") ||
name.contains("io.circe") ||
name.contains("net.java.dev") ||
name.contains("com.github.javaparser") ||
name.contains("org.javassist") ||
name.contains("com.lihaoyi.ammonite") ||
name.contains("io.joern.ghidra2cpg") ||
name.contains("net.oneandone")
}.foreach(x => x.delete())
dir.zipTo(f)
better.files.File(tmpDstArchive).delete()
}
println(s"created distribution - resulting files: $dstArchive")
}
ThisBuild/Compile/scalacOptions ++= Seq(
"-Xfatal-warnings",
"-feature",
"-deprecation",
"-language:implicitConversions",
"-target:jvm-1.8",
)
ThisBuild/javacOptions ++= Seq("-source", "1.8")
ThisBuild/Test/compile/javacOptions ++= Seq("-g", "-target", "1.8")
ThisBuild/licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0"))
Global/onChangedBuildSource := ReloadOnSourceChanges
fork := true
ThisBuild/resolvers ++= Seq(
Resolver.mavenLocal,
Resolver.bintrayRepo("shiftleft", "maven"),
"Sonatype OSS" at "https://oss.sonatype.org/content/repositories/public")