Skip to content

Commit 69f34f4

Browse files
authored
import fuzzyc into the cpg build (#992)
* import fuzzyc into the cpg build resolves cyclic dependency between the two repos, and allows to modify the schema again (unlike with the old version that used a staged fuzzyc version) * adapt fuzzyc scalac options some antl-generated sources prompt compiler warnings :( * resolve scalatest deprecation warnings * bring back in-memory fuzzyc * gitignore * fwiw this is how it *should* look, but sbt claims there's a cyclic dependency * extract semanticcpg-tests as a separate project to resolve cyclic dependency * combine travis.yml * test rundir config * use slf4j in fuzzyc as well * fix fuzzyc tests * fmt * fetch submodules * try other submodule fetching config * test: empty cache * drop slack notification, doesn't work anyway * Revert "test: empty cache" This reverts commit 8521113. * fix gitmodules - i'm an idiot * empty cache, try again * redo gitmodules from scratch * add them back in * Revert "empty cache, try again" This reverts commit 7ea95f0. * use same versions of submodules as before
1 parent 158ad08 commit 69f34f4

263 files changed

Lines changed: 14360 additions & 81 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ travis_wait_*
1010
/protoc
1111
project/.bloop
1212
.bloop
13+
foo.c
14+
woo.c
15+
/CMakeCache.txt
16+
/CMakeFiles

.gitmodules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[submodule "fuzzypp/external/cxxopts"]
2+
path = fuzzypp/external/cxxopts
3+
url = https://github.com/jarro2783/cxxopts.git
4+
[submodule "fuzzypp/external/catch2"]
5+
path = fuzzypp/external/catch2
6+
url = https://github.com/catchorg/Catch2.git
7+
[submodule "fuzzypp/external/simplecpp"]
8+
path = fuzzypp/external/simplecpp
9+
url = https://github.com/ShiftLeftSecurity/simplecpp.git

.travis.yml

Lines changed: 70 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,89 @@ before_install:
1111
- if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_EVENT_TYPE" == "push" ]]; then openssl
1212
aes-256-cbc -K $encrypted_663dec309dc8_key -iv $encrypted_663dec309dc8_iv -in private-key.pem.enc
1313
-out private-key.pem -d; gpg --import --batch private-key.pem; fi
14-
-
1514
env:
1615
global:
1716
- secure: O33fw6sV6z2laegGMQ3qLPA0Eb+w9cHTXIC81q3Nw9G6nJLYGMAelexF0tx7h7zrfdz0HLDW6ZVqAWf44taqACzBu0JCPgBA/RCSlNxUKlINHNp/lapG26b4m2eNHt4KyfZ7QFcxRjRg6Y7z2XpKiNvUOxEWSh7cDxZcTY8fE9S33SDbefaBpIJsXj3tIxqBunu2ItTitE0p0B0pLfCtlC2YT9EG2FAaBxppYFmG0/TKw/tIAQAKdgiGmVCTk/ux/wEFjCqcrbqXfgRsRHe7o4TrRjEo4gFsj/mN5VLuQDH7sioMHfMI73rJAg5A7E1eFVz3iktKR4znFQxdW5JNoiHc3D6a8TA/o9IkHWOpNDHZgDvJecw5pCYS7odNNwoCa/U0THiyFonMEJEE6R+LZs0UPz1QpHc8VN+KEI+vOVdLT06w0mpUEpr1t3Q1hL4QZMg/Se2u9wmBnyBfOlOUW6h/j5N/E5hZG0lRKCSfmHtL5bdxCLC8C0xEjEz4oWf9ZdeA2JvgB6PLL+ipQ3yJ+XlNFPhIXrrb5Ea/ZPv/4BgGZ28tHGJfVeDUnGG0OPCmiwHYgIsgulPERz17MFRD7J3DTd3WnhryV0KXF/56soOUBuufJHEz/q6HxvNWWz4g1t3REPE2lAzhrmRN68CN9mJJ+AsQqXIwZQ3jL1k1hW4=
1817
- secure: WELN1ch6XMSPo96MvX26i0NziRh/4libPilj2JGUUXnPl7CXFBBTUDZDWR54+2eT35CaTboSIFFis5WywDB4eC6T6LaoM22GUXGdvmZVxlBrYkk3SQygqye7Cru6zjgWJt3Y0nC9eoT7Wsh9GeUPyJYJGjeW8ODNMTpwnuTEyfVBa/HfjwQdc0e6IDtZu0GzRbstt7k4/X6dQsUZQBnLfM39fOTk4QTHo4VMNgieavHFdg/EGTeDHz5UNuMN9Ep0HXFiyuM4+mS9z2UUT7h0NyJ352t/1GioJe3ry5pvSZnjKjpD07HKnBt3iL/7YB9POaWeb6NFysrQQByTZNrb4pKsXB3A9BjTSjc8oZRbamuxHd7ICjZMXukSKkxwqQtOl9lM5dTSSvsdkljlGCCxqbziP016xzx9RUiNHnYIiQFmjIExyMpo5QFs6NxjxAwsLrjnJiMFERmQmLLN5ubizzKPyVCYuEpyuBjPNhFANX083vax7uHp+PBGyP5Fd8HFpciD9tqo24E3kXsIV94p1P0l8Xqbf9jwfU9xKqGWU8A/1GZZmDtuh+HvvmNPe8L9JIqJthLbz+IjtX5a+PJQQbnlmSPBjEhZcqNCOQ/d4ljWiCYA8/ExcwbR9WH9XRmgGxY10gFDM75j1LjmZalGu/FmvQYPH53txWnZRw/IAJg=
1918
stages:
2019
- name: test
20+
- name: tag-release
21+
if: branch = master AND type = push
2122
- name: release
2223
if: branch = master AND type = push
23-
- name: make-release
2424
jobs:
2525
include:
2626
- stage: test
27+
name: Build and test cpg, FuzzyC2CPG JAR & preprocessor
28+
addons:
29+
apt:
30+
sources:
31+
- sourceline: ppa:ubuntu-toolchain-r/test
32+
packages:
33+
- cmake
34+
- g++-8
2735
script:
2836
- sbt scalafmtCheck test
29-
- stage: release
37+
- cmake -DCMAKE_CXX_COMPILER=/usr/bin/g++-8 ./fuzzypp
38+
- cmake --build . -- -j4
39+
- "./fuzzypp/bin/fuzzyppcli-tests"
40+
- stage: test
41+
name: Build and test Windows preprocessor
42+
os: windows
43+
env: YARN_GPG=no
44+
language: cpp
3045
script:
31-
- sbt ciReleaseTagNextVersion ciReleaseSonatype stage
46+
- cmake -G "Visual Studio 15 2017" -A "x64" ./fuzzypp
47+
- cmake --build . --config Release
48+
- "./fuzzypp/bin/Release/fuzzyppcli-tests.exe"
49+
after_script:
50+
- ps -ef
51+
- ps -Wla | sort
52+
- gpgconf --kill gpg-agent
53+
- ps -Wla | sort
54+
- echo $$
55+
- stage: tag-release
56+
name: Tag release
57+
script: sbt ciReleaseTagNextVersion
58+
- stage: release
59+
name: Release to shiftleft artifactory
60+
script: sbt 'set publishTo := Some("releases" at "https://shiftleft.jfrog.io/shiftleft/libs-release-local")'
61+
"set credentials += Credentials(\"Artifactory Realm\", \"shiftleft.jfrog.io\",
62+
\"$JFROG_USER\", \"$JFROG_PASS\")" ciRelease
63+
- stage: release
64+
name: Release to sonatype
65+
script: sbt ciReleaseSonatype
66+
- stage: release
67+
name: Release Unix preprocessor
68+
script: skip
69+
before_deploy: zip -j ./fuzzyppcli.zip ./fuzzypp/bin/fuzzyppcli
70+
deploy:
71+
edge: true
72+
provider: releases
73+
cleanup: false
74+
token: "$GITHUB_TOKEN"
75+
target_commitish: "$TRAVIS_COMMIT"
76+
file:
77+
- "./fuzzyppcli.zip"
78+
- stage: release
79+
name: Release Windows preprocessor
80+
os: windows
81+
env: YARN_GPG=no
82+
language: cpp
83+
script: skip
84+
before_deploy:
85+
- export TRAVIS_TAG=$(git describe --tags --abbrev=0)
86+
- 7z a -r -tzip ./fuzzyppcli-win.zip ./fuzzypp/bin/Release/fuzzyppcli.exe
87+
deploy:
88+
edge: true
89+
provider: releases
90+
cleanup: false
91+
token: "$GITHUB_TOKEN"
92+
tag_name: "$TRAVIS_TAG"
93+
target_commitish: "$TRAVIS_COMMIT"
94+
file:
95+
- "./fuzzyppcli-win.zip"
96+
after_deploy: gpgconf --kill gpg-agent
3297
before_cache:
3398
- find $HOME/.sbt -name "*.lock" -type f -delete
3499
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -type f -delete
@@ -41,8 +106,4 @@ cache:
41106
- $HOME/.ivy2/cache
42107
- $HOME/.cache/coursier
43108
- $HOME/.coursier
44-
notifications:
45-
slack:
46-
secure: HAZWVXDtRQiqSl0BiskghiLRMzi9+6q7DYhgBSmXTth8Ljex2n6ehsmxN7DdnL+OX8RqKWCIzSCURbPmVxJG77g4vQOi5a4FG//2NUAWMNBciLSwAJfyn6eC7tn4+iA9B1SKOSwdz7SCshnOL/9XupojYAwApjZgjvAFDGYOfFk9gv4Ezjrx3mX6Ge+VrkBVLIyFxTeBcMCsLYi/zsZWnzWpl7+ymqQIxhiburOU1ePDq/lHcFdvQSks3YWb1TlfsdNRt7hwkNrb60nfsZBxyt7pDk+GV4rdpgtZgolcZImqrVarnz7/UchOLn6Hl/bmkqFr3a+Aiaank7oph/fIWGBKqbTzoD8nY6mp1sLYtMbk8BZgKjr+DuqyIoJawMl7RvffJA2L149QPNdaR9uIkx+a2P5Wgs/DFiASOnyiX87S1Hfwok6ediO+NSrQJhGMyk87dRycDHywDaG0VuppHiFrDrqEo9kE/2iEL3/10xqVuoU1Yp/aLmeXSs2b0P7VZTLy23w8aCn6EEdyTgLkc0xRHPkA/c04UZ6vuQCK3JsBpEtT95Sot0y58vgbh1Er5DOlDXccOXL9qooBe9e84uJFj4qJx+/bIRBPKC0em1Dd3qtPP4MCfxY9+75r03ruwi1PPR/ifAjXbiBp9qfWu2XHXDmyHfoI73UJyClYLxI=
47-
on_success: change
48-
on_failure: always
109+
- "./fuzzypp/bin"

build.sbt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,18 @@ ThisBuild / Test / javaOptions += s"-Dlog4j2.configurationFile=file:${baseDirect
4848
ThisBuild / Test / javaOptions += s"-Duser.dir=${baseDirectory.in(ThisBuild).value}"
4949

5050
ThisBuild/libraryDependencies ++= Seq(
51-
"org.apache.logging.log4j" % "log4j-slf4j-impl" % "2.11.2" % Test
51+
"org.apache.logging.log4j" % "log4j-slf4j-impl" % "2.11.2" % Test
5252
)
5353

5454
Global / useGpg := false
5555

5656
name := "codepropertygraph"
5757
publish / skip := true
5858

59-
// parsed by project/Utils.scala
60-
val fuzzyc2cpgVersion = "1.1.84"
61-
6259
lazy val codepropertygraph = Projects.codepropertygraph
6360
lazy val protoBindings = Projects.protoBindings
6461
lazy val semanticcpg = Projects.semanticcpg
62+
lazy val semanticcpgtests = Projects.semanticcpgtests
6563
lazy val dataflowengineoss = Projects.dataflowengineoss
6664
lazy val cpgvalidator = Projects.cpgvalidator
6765
lazy val console = Projects.console

console/build.sbt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ val CirceVersion = "0.12.2"
5050
val AmmoniteVersion = "2.0.4"
5151
val ZeroturnaroundVersion = "1.13"
5252

53+
dependsOn(Projects.fuzzyc2cpg % Test)
54+
5355
libraryDependencies ++= Seq(
5456
"com.github.scopt" %% "scopt" % ScoptVersion,
5557
"com.github.pathikrit" %% "better-files" % BetterFilesVersion,
@@ -67,6 +69,3 @@ publishArtifact in (Test, packageBin) := true
6769

6870
// execute tests in root project so that they work in sbt *and* intellij
6971
Test / baseDirectory := (ThisBuild / Test / run / baseDirectory).value
70-
71-
// stage fuzzyc2cpg before test
72-
Test/compile := (Test/compile).dependsOn(Projects.fuzzyc2cpg/stage).value

console/src/test/scala/io/shiftleft/console/testing/ConsoleFixture.scala

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import better.files.File
77
import io.shiftleft.console.cpgcreation.{CpgGenerator, LanguageFrontend}
88
import io.shiftleft.console.{Console, ConsoleConfig, DefaultAmmoniteExecutor, InstallConfig}
99
import io.shiftleft.console.workspacehandling.{Project, ProjectFile, WorkspaceLoader}
10-
11-
import scala.sys.process.Process
10+
import io.shiftleft.fuzzyc2cpg.FuzzyC2Cpg
1211

1312
object ConsoleFixture {
1413
def apply[T <: Console[Project]](constructor: String => T = { x =>
@@ -56,16 +55,10 @@ class TestCpgGenerator(config: ConsoleConfig) extends CpgGenerator(config) {
5655
private class FuzzyCTestingFrontend extends LanguageFrontend {
5756

5857
override def generate(inputPath: String, outputPath: String, namespaces: List[String]): Option[String] = {
59-
val p = Process(
60-
List(
61-
"./fuzzyc2cpg.sh",
62-
inputPath,
63-
"--output",
64-
outputPath
65-
)
66-
).run()
67-
assert(p.exitValue() == 0, s"fuzzyc exited with code ${p.exitValue}")
68-
58+
val fuzzyc = new FuzzyC2Cpg()
59+
File(inputPath).list.foreach(println(_))
60+
val cpg = fuzzyc.runAndOutput(Set(inputPath), Set(".c"), Some(outputPath))
61+
cpg.close()
6962
Some(outputPath)
7063
}
7164

dataflowengineoss/build.sbt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
name := "dataflowengineoss"
22

3-
dependsOn(Projects.semanticcpg % "compile -> compile; test -> test")
4-
5-
val antlrVersion = "4.7.2"
3+
dependsOn(Projects.semanticcpg,
4+
Projects.semanticcpgtests % "test -> test")
65

76
libraryDependencies ++= Seq(
8-
"org.antlr" % "antlr4-runtime" % antlrVersion,
7+
"org.antlr" % "antlr4-runtime" % Versions.antlr,
98
"org.scalatest" %% "scalatest" % Versions.scalatest % Test,
109
)
1110

1211
enablePlugins(Antlr4Plugin)
1312

1413
Antlr4 / antlr4PackageName := Some("io.shiftleft.dataflowengineoss")
15-
Antlr4 / antlr4Version := antlrVersion
14+
Antlr4 / antlr4Version := Versions.antlr
1615
Antlr4 / javaSource := (sourceManaged in Compile).value
1716
sources in (Compile, doc) ~= (_ filter (_ => false))
1817

fuzzyc2cpg.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
SCRIPT_ABS_PATH=$(readlink -f "$0")
44
SCRIPT_ABS_DIR=$(dirname $SCRIPT_ABS_PATH)
55

6-
$SCRIPT_ABS_DIR/fuzzyc2cpg/target/universal/stage/bin/fuzzyc2cpg-wrapper $@
7-
6+
$SCRIPT_ABS_DIR/fuzzyc2cpg/target/universal/stage/bin/fuzzyc2cpg -J-XX:+UseG1GC -J-XX:CompressedClassSpaceSize=128m -J-XX:+UseStringDeduplication $@

fuzzyc2cpg/README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
[![Build Status](https://secure.travis-ci.org/ShiftLeftSecurity/fuzzyc2cpg.png?branch=master)](http://travis-ci.org/ShiftLeftSecurity/fuzzyc2cpg)
2+
[![bintray](https://api.bintray.com/packages/shiftleft/maven/fuzzyc2cpg/images/download.svg)](https://bintray.com/shiftleft/maven/fuzzyc2cpg/_latestVersion)
3+
4+
# fuzzyc2cpg
5+
6+
**Note: for first-time users, we recommend building "joern" at https://github.com/ShiftLeftSecurity/joern/ instead. It contains both fuzzyc2cpg and a component for querying code property graphs, as well as a few helpful examples to get started.**
7+
8+
A fuzzy parser for C/C++ that creates code property graphs according to the specification at https://github.com/ShiftLeftSecurity/codepropertygraph . This is a fork of the (now unmaintainted) version of Joern at https://github.com/octopus-platform/joern.
9+
10+
## Using as a dependency
11+
`build.sbt`:
12+
```
13+
libraryDependencies += "io.shiftleft" %% "fuzzyc2cpg" % "x.y.z"
14+
resolvers += Resolver.bintrayRepo("shiftleft", "maven")
15+
```
16+
Other build tools: see [bintray instructions](https://bintray.com/shiftleft/maven/fuzzyc2cpg/_latestVersion).
17+
18+
## Building the code
19+
20+
The build process has been verified on Linux and it should be possible
21+
to build on OS X and BSD systems as well. The build process requires
22+
the following prerequisites:
23+
24+
* Java runtime 8
25+
- Link: http://openjdk.java.net/install/
26+
* Scala build tool (sbt)
27+
- Link: https://www.scala-sbt.org/
28+
29+
Additional build-time dependencies are automatically downloaded as part
30+
of the build process. To build fuzzyc2cpg issue the command `sbt stage`.
31+
32+
Optionally, you may also build the preprocessor included with fuzzyc2cpg. This will enable you to specify any include
33+
files that your application uses for more complete CPG generation. Any defines and macros will also be fully processed.
34+
35+
To build the preprocessor, see the preprocessor [README](./fuzzypp/README.md)/
36+
37+
## Running
38+
39+
To produce a code property graph _*without preprocessing*_ issue the command:
40+
```shell script
41+
./fuzzyc2cpg.sh <path/to/sourceCodeDirectory> --output <path/to/outputCpg>
42+
`````
43+
44+
To produce a code property graph _*with preprocessing*_, ensure that you have the preprocessor binary available
45+
and issue the command:
46+
```shell script
47+
./fuzzyc2cpg.sh <path/to/sourceCodeDirectory> \
48+
--verbose
49+
--source-file-ext .cxx
50+
--output <path/to/outputCpg> \
51+
--include <path/to/include/file.h>
52+
-I <path/to/include/dir>
53+
--define DEF
54+
--define DEF_VAL=2
55+
--undefine UNDEF
56+
--preprocessor-executable <path/to/preprocessor/executable>
57+
```
58+
59+
All preprocessor options may be specified more than once, with the exception of `--output` and `--preprocessor-executable`.
60+
By default, fuzzyc2cpg will attempt to execute the preprocessor at `./fuzzypp/bin/fuzzyppcli`.
61+
62+
Run the following to see a complete list of available options:
63+
```shell script
64+
./fuzzyc2cpg.sh --help
65+
```

fuzzyc2cpg/build.sbt

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,70 @@
1-
name := "fuzzyc2cpg-wrapper"
1+
name := "fuzzyc2cpg"
22

3-
libraryDependencies += "io.shiftleft" %% "fuzzyc2cpg" % Versions.fuzzyc2cpg
3+
dependsOn(Projects.semanticcpg % "compile->compile; test->test")
4+
5+
libraryDependencies ++= Seq(
6+
"com.github.scopt" %% "scopt" % "3.7.1",
7+
"org.antlr" % "antlr4-runtime" % Versions.antlr,
8+
"org.apache.commons" % "commons-lang3" % "3.5",
9+
"commons-cli" % "commons-cli" % "1.4",
10+
"com.github.pathikrit" %% "better-files" % "3.8.0",
11+
"org.scala-lang.modules" %% "scala-parallel-collections" % "0.2.0",
12+
"com.novocode" % "junit-interface" % "0.11" % Test,
13+
"junit" % "junit" % "4.12" % Test,
14+
"org.scalatest" %% "scalatest" % Versions.scalatest % Test,
15+
)
16+
17+
scalacOptions -= "-Xfatal-warnings" // some antl-generated sources prompt compiler warnings :(
18+
19+
scalacOptions ++= Seq(
20+
"-deprecation", // Emit warning and location for usages of deprecated APIs.
21+
"-encoding", "utf-8", // Specify character encoding used by source files.
22+
"-explaintypes", // Explain type errors in more detail.
23+
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
24+
"-language:existentials", // Existential types (besides wildcard types) can be written and inferred
25+
"-language:experimental.macros", // Allow macro definition (besides implementation and application)
26+
"-language:higherKinds", // Allow higher-kinded types
27+
"-language:implicitConversions", // Allow definition of implicit functions called views
28+
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
29+
"-Xcheckinit", // Wrap field accessors to throw an exception on uninitialized access.
30+
// "-Xfatal-warnings", // Fail the compilation if there are any warnings.
31+
"-Xlint:adapted-args", // Warn if an argument list is modified to match the receiver.
32+
"-Xlint:constant", // Evaluation of a constant arithmetic expression results in an error.
33+
"-Xlint:delayedinit-select", // Selecting member of DelayedInit.
34+
"-Xlint:doc-detached", // A Scaladoc comment appears to be detached from its element.
35+
"-Xlint:inaccessible", // Warn about inaccessible types in method signatures.
36+
"-Xlint:infer-any", // Warn when a type argument is inferred to be `Any`.
37+
"-Xlint:missing-interpolator", // A string literal appears to be missing an interpolator id.
38+
"-Xlint:option-implicit", // Option.apply used implicit view.
39+
"-Xlint:package-object-classes", // Class or object defined in package object.
40+
"-Xlint:poly-implicit-overload", // Parameterized overloaded implicit methods are not visible as view bounds.
41+
"-Xlint:private-shadow", // A private field (or class parameter) shadows a superclass field.
42+
"-Xlint:stars-align", // Pattern sequence wildcard must align with sequence component.
43+
"-Xlint:type-parameter-shadow", // A local type parameter shadows a type already in scope.
44+
"-Ywarn-dead-code", // Warn when dead code is identified.
45+
"-Ywarn-extra-implicit", // Warn when more than one implicit parameter section is defined.
46+
"-Xlint:nullary-override", // Warn when non-nullary def f() overrides nullary def f.
47+
"-Xlint:nullary-unit", // Warn when nullary methods return Unit.
48+
"-Ywarn-numeric-widen", // Warn when numerics are widened.
49+
"-Ywarn-unused:implicits", // Warn if an implicit parameter is unused.
50+
"-Ywarn-unused:imports", // Warn if an import selector is not referenced.
51+
"-Ywarn-unused:locals", // Warn if a local definition is unused.
52+
"-Ywarn-unused:params", // Warn if a value parameter is unused.
53+
"-Ywarn-unused:patvars", // Warn if a variable bound in a pattern is unused.
54+
"-Ywarn-unused:privates", // Warn if a private member is unused.
55+
// "-Ywarn-value-discard" // Warn when non-Unit expression results are unused.
56+
)
57+
58+
compile / javacOptions ++= Seq("-Xlint:all", "-Xlint:-cast", "-g")
59+
Test / fork := true
60+
testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-v")
61+
62+
enablePlugins(Antlr4Plugin)
63+
Antlr4 / antlr4PackageName := Some("io.shiftleft.fuzzyc2cpg")
64+
Antlr4 / antlr4Version := Versions.antlr
65+
Antlr4 / javaSource := (sourceManaged in Compile).value
466

567
enablePlugins(JavaAppPackaging)
68+
69+
// execute tests in root project so that they work in sbt *and* intellij
70+
Test / baseDirectory := (ThisBuild / Test / run / baseDirectory).value

0 commit comments

Comments
 (0)