-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild.sbt
More file actions
107 lines (103 loc) · 4.62 KB
/
build.sbt
File metadata and controls
107 lines (103 loc) · 4.62 KB
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
import org.jetbrains.sbtidea.Keys.*
import org.jetbrains.sbtidea.runIdea.CustomIntellijVMOptions
import org.jetbrains.sbtidea.verifier.FailureLevel
lazy val scala3Version = "3.8.2"
lazy val logbackVersion = "1.5.32"
lazy val graphvizVersion = "0.18.1"
lazy val joorVersion = "0.9.15"
lazy val scalatestVersion = "3.2.20"
lazy val pluginVerifierVersion = "1.398"
lazy val ktVersion = "2.1.0"
lazy val jbAnnotVersion = "26.0.2"
// https://youtrack.jetbrains.com/articles/IDEA-A-2100661679/IntelliJ-IDEA-2023.3-Latest-Builds
lazy val intellijVersion = "253.29346.240"
lazy val pluginVersion = "0.9.0-RC1"
ThisBuild / version := pluginVersion
inThisBuild(
List(
homepage := Some(url("https://github.com/bitlap/sbt-dependency-analyzer")),
developers := List(
Developer(
id = "jxnu-liguobin",
name = "梦境迷离",
email = "dreamylost@outlook.com",
url = url("https://blog.dreamylost.cn")
),
Developer(
id = "IceMimosa",
name = "IceMimosa",
email = "chk19940609@gmail.com",
url = url("http://patamon.me")
)
)
)
)
lazy val `sbt-dependency-analyzer` = (project in file("."))
.enablePlugins(SbtIdeaPlugin)
.settings(
scalaVersion := scala3Version,
organization := "org.bitlap",
scalacOptions ++= Seq(
"-deprecation",
// "-Xfatal-warnings",
"-Ybackend-parallelism:16" // https://github.com/scala/scala3/pull/15392
// "-nowarn", // during migration
// "-rewrite",
// "-source:3.7-migration"
),
version := (ThisBuild / version).value,
ThisBuild / intellijPluginName := "Sbt Dependency Analyzer",
ThisBuild / intellijBuild := intellijVersion,
ThisBuild / intellijPlatform := (Global / intellijPlatform).??(IntelliJPlatform.IdeaCommunity).value,
signPluginOptions := signPluginOptions.value.copy(
enabled = true,
certFile = Some(file(sys.env.getOrElse("PLUGIN_SIGN_KEY", "/Users/liguobin/chain.crt"))),
privateKeyFile = Some(file(sys.env.getOrElse("PLUGIN_SIGN_CERT", "/Users/liguobin/private.pem"))),
keyPassphrase = Some(sys.env.getOrElse("PLUGIN_SIGN_KEY_PWD", "123456"))
),
pluginVerifierOptions := pluginVerifierOptions.value.copy(
version = pluginVerifierVersion, // use a specific verifier version
offline = true, // forbid the verifier from reaching the internet
failureLevels = Set(FailureLevel.COMPATIBILITY_PROBLEMS, FailureLevel.COMPATIBILITY_WARNINGS)
),
ThisBuild / bundleScalaLibrary := true,
ThisBuild / autoRemoveOldCachedIntelliJSDK := true,
Global / intellijAttachSources := true,
buildIntellijOptionsIndex := {},
intellijPlugins ++= Seq("com.intellij.java", "org.intellij.scala").map(_.toPlugin),
useNewVmOptions := true,
customIntellijVMOptions := customIntellijVMOptions.value.copy(
xmx = Some(2048),
xms = Some(256),
extraOptions = customIntellijVMOptions.value.extraOptions ++ Seq(
"--add-exports=java.management/sun.management=ALL-UNNAMED",
"--add-opens=java.base/jdk.internal.ref=ALL-UNNAMED"
)
),
Compile / unmanagedResourceDirectories += baseDirectory.value / "src" / "main" / "resources",
Test / unmanagedResourceDirectories += baseDirectory.value / "src" / "test" / "resources",
patchPluginXml := pluginXmlOptions.apply { (x: org.jetbrains.sbtidea.pluginXmlOptions) =>
{
x.version = pluginVersion
// x.pluginDescription = IO.read(baseDirectory.value / "src" / "main" / "resources" / "patch" / "description.html")
// x.changeNotes = IO.read(baseDirectory.value / "src" / "main" / "resources" / "patch" / "change-notes.html")
}
},
publish / skip := true,
commands ++= Commands.value,
libraryDependencies ++= Seq(
"guru.nidi" % "graphviz-java-min-deps" % graphvizVersion,
"ch.qos.logback" % "logback-classic" % logbackVersion,
"org.jooq" % "joor" % joorVersion,
"org.scalatest" %% "scalatest" % scalatestVersion % Test,
"org.jetbrains" % "annotations" % jbAnnotVersion
),
kotlinVersion := ktVersion,
Compile / unmanagedSourceDirectories += baseDirectory.value / "src" / "main" / "kotlin",
packageLibraryMappings ++= Seq(
"org.jetbrains.kotlin" % ".*" % ".*" -> None,
"org.jetbrains" % ".*" % ".*" -> None,
"org.scala-lang" % "scala-.*" % ".*" -> None,
"org.scala-lang.modules" % "scala-.*" % ".*" -> None
)
)