-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sbt
126 lines (107 loc) · 4.67 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name := "atom"
ThisBuild / organization := "io.appthreat"
ThisBuild / version := "2.0.25"
ThisBuild / scalaVersion := "3.5.2"
val chenVersion = "2.2.3"
lazy val atom = Projects.atom
libraryDependencies ++= Seq(
"com.github.pathikrit" %% "better-files" % "3.9.2",
"com.github.scopt" %% "scopt" % "4.1.0",
"org.slf4j" % "slf4j-nop" % "2.0.16" % Optional,
("io.appthreat" %% "c2cpg" % Versions.chen).excludeAll(
ExclusionRule(organization = "com.ibm.icu", name = "icu4j"),
ExclusionRule(organization = "org.jline", name = "jline"),
ExclusionRule(organization = "org.eclipse.platform", name = "org.eclipse.jface"),
ExclusionRule(organization = "org.eclipse.platform", name = "org.eclipse.jface.text")
),
"io.appthreat" %% "dataflowengineoss" % Versions.chen,
"io.appthreat" %% "pysrc2cpg" % Versions.chen,
"io.appthreat" %% "javasrc2cpg" % Versions.chen,
"io.appthreat" %% "jssrc2cpg" % Versions.chen,
"io.appthreat" %% "jimple2cpg" % Versions.chen,
"io.appthreat" %% "php2atom" % Versions.chen,
("io.appthreat" %% "semanticcpg" % Versions.chen % Test).classifier("tests"),
("io.appthreat" %% "x2cpg" % Versions.chen % Test).classifier("tests"),
("io.appthreat" %% "pysrc2cpg" % Versions.chen % Test).classifier("tests"),
"org.scalatest" %% "scalatest" % "3.2.19" % Test
)
excludeDependencies ++= Seq(
ExclusionRule("dev.scalapy", "scalapy-core"),
ExclusionRule("org.scala-lang", "scala3-compiler"),
ExclusionRule("com.google.protobuf", "protobuf-java-util"),
ExclusionRule("com.github.tototoshi", "scala-csv_3"),
ExclusionRule("au.com.bytecode", "opencsv")
)
Compile / doc / scalacOptions ++= Seq("-doc-title", "atom apidocs", "-doc-version", version.value)
ThisBuild / scalacOptions ++= Seq(
"-deprecation", // Emit warning and location for usages of deprecated APIs.
"--release",
"21"
)
ThisBuild / compile / javacOptions ++= Seq(
"-Xlint",
"--release=21"
) ++ {
// fail early if users with JDK11 try to run this
val javaVersion = sys.props("java.specification.version").toFloat
assert(javaVersion.toInt >= 21, s"this build requires JDK21+ - you're using $javaVersion")
Nil
}
Universal / topLevelDirectory := None
Universal / mappings := (Universal / mappings).value.filter {
case (_, path) => !path.contains("org.scala-lang.scala3-compiler") && !path.contains(
"io.get-coursier"
) && !path.contains("com.michaelpollmeier.scala-repl-pp") && !path.contains(
"dev.scalapy.scalapy-core"
) && !path.contains(
"dev.scalapy.scalapy-macros"
)
}
enablePlugins(JavaAppPackaging, ClasspathJarPlugin, GraalVMNativeImagePlugin)
ThisBuild / licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0"))
Global / onChangedBuildSource := ReloadOnSourceChanges
maintainer := "Team AppThreat <[email protected]>"
packageSummary := "Create atom (⚛) representation"
packageDescription := """Create atom (⚛) representation for your application, packages and libraries."""
debianPackageDependencies := Seq("java17-runtime-headless")
rpmVendor := "AppThreat"
lazy val createDistribution = taskKey[File]("Create a complete atom distribution")
createDistribution := {
val distributionFile = file("target/atom.zip")
val zip = (atom / Universal / packageBin).value
IO.copyFile(zip, distributionFile)
println(s"created distribution - resulting files: $distributionFile")
distributionFile
}
ThisBuild / resolvers ++= Seq(
Resolver.mavenLocal,
Resolver.githubPackages("appthreat/chen"),
"Sonatype OSS".at("https://oss.sonatype.org/content/repositories/public"),
"Atlassian".at("https://packages.atlassian.com/mvn/maven-atlassian-external"),
"Gradle Releases".at("https://repo.gradle.org/gradle/libs-releases/")
)
ThisBuild / versionScheme := Some("semver-spec")
ThisBuild / Test / fork := true
Global / onChangedBuildSource := ReloadOnSourceChanges
Compile / doc / sources := Seq.empty
Compile / packageDoc / publishArtifact := false
wartremoverWarnings ++= Seq(
Wart.NoNeedImport,
Wart.ArrayEquals,
Wart.Any,
Wart.FinalCaseClass,
Wart.FinalVal,
Wart.ToString,
Wart.TryPartial
)
githubOwner := "appthreat"
githubRepository := "atom"
githubSuppressPublicationWarning := true
credentials +=
Credentials(
"GitHub Package Registry",
"maven.pkg.github.com",
"appthreat",
sys.env.getOrElse("GITHUB_TOKEN", "N/A")
)
graalVMNativeImageOptions := Seq("-H:+UnlockExperimentalVMOptions", "--no-fallback")