-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathbuild.sbt
More file actions
53 lines (50 loc) · 1.99 KB
/
build.sbt
File metadata and controls
53 lines (50 loc) · 1.99 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
lazy val scala212 = "2.12.18"
lazy val scala3 = "3.8.2"
ThisBuild / scalaVersion := scala212
ThisBuild / crossScalaVersions := Seq(scala212, scala3)
lazy val sbtJavaFormatter = project.in(file(".")).aggregate(plugin).settings(publish / skip := true)
lazy val plugin = project
.in(file("plugin"))
.enablePlugins(SbtPlugin)
.enablePlugins(AutomateHeaderPlugin)
.settings(
name := "sbt-java-formatter",
homepage := scmInfo.value.map(_.browseUrl),
scmInfo := Some(
ScmInfo(url("https://github.com/sbt/sbt-java-formatter"), "scm:git:git@github.com:sbt/sbt-java-formatter.git")),
developers := List(
Developer("ktoso", "Konrad 'ktoso' Malawski", "<ktoso@project13.pl>", url("https://github.com/ktoso"))),
libraryDependencies ++= Seq("com.google.googlejavaformat" % "google-java-format" % "1.24.0"),
startYear := Some(2015),
description := "Formats Java code in your project.",
licenses += ("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0.html")),
(pluginCrossBuild / sbtVersion) := {
scalaBinaryVersion.value match {
case "2.12" => "1.9.0"
case _ => "2.0.0-RC10"
}
},
scalacOptions ++= {
Vector("-encoding", "UTF-8", "-unchecked", "-deprecation", "-feature") ++ (scalaBinaryVersion.value match {
case "2.12" => Vector("-Xsource:3", "-release:11")
case _ => Vector("-Wconf:error")
})
},
javacOptions ++= Seq("-encoding", "UTF-8"),
scriptedLaunchOpts := {
scriptedLaunchOpts.value ++
Seq("-Xmx1024M", "-Dplugin.version=" + version.value)
},
scriptedLaunchOpts ++= {
if (scala.util.Properties.isJavaAtLeast("17")) {
Seq("api", "file", "parser", "tree", "util").map { x =>
s"--add-opens=jdk.compiler/com.sun.tools.javac.${x}=ALL-UNNAMED"
}
} else {
Nil
}
},
scriptedBufferLog := false,
scalafmtOnCompile := true)
ThisBuild / organization := "com.github.sbt"
ThisBuild / organizationName := "sbt community"