forked from machadoit/codacy-staticcheck
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.sbt
55 lines (44 loc) · 1.61 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
import com.typesafe.sbt.packager.docker.Cmd
import scala.io.Source
import scala.util.parsing.json.JSON
name := "codacy-staticcheck"
ThisBuild / scalaVersion := "2.13.16"
enablePlugins(NativeImagePlugin)
libraryDependencies ++= Seq(
"com.codacy" %% "codacy-engine-scala-seed" % "6.1.3",
"org.scala-lang.modules" %% "scala-xml" % "2.3.0",
"com.lihaoyi" %% "ujson" % "4.1.0",
"org.scalatest" %% "scalatest" % "3.2.19" % Test
)
val staticcheckVersion = "2025.1.1"
dependsOn(shared)
lazy val shared = project
.settings(libraryDependencies += "com.codacy" %% "codacy-analysis-cli-model" % "2.2.0")
lazy val `doc-generator` = project
.settings(
Compile / sourceGenerators += Def.task {
val file = (Compile / sourceManaged).value / "codacy" / "staticcheck" / "Versions.scala"
IO.write(file, s"""package com.codacy.staticcheck
|object Versions {
| val staticcheckVersion: String = "$staticcheckVersion"
|}
|""".stripMargin)
Seq(file)
}.taskValue,
libraryDependencies ++= Seq("com.github.pathikrit" %% "better-files" % "3.9.2", "com.lihaoyi" %% "ujson" % "4.1.0")
)
.dependsOn(shared)
assembly / assemblyMergeStrategy := {
case PathList("module-info.class") => MergeStrategy.discard
case PathList("META-INF", xs @ _*) => MergeStrategy.discard
case PathList("reference.conf") => MergeStrategy.concat
case _ => MergeStrategy.first
}
nativeImageOptions ++= Seq(
"-O1",
"-H:+ReportExceptionStackTraces",
"--no-fallback",
"--no-server",
"--report-unsupported-elements-at-runtime",
"--static"
)