|
1 | | -name := "fuzzyc2cpg-wrapper" |
| 1 | +name := "fuzzyc2cpg" |
2 | 2 |
|
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 |
4 | 66 |
|
5 | 67 | 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