-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
110 lines (100 loc) · 3.15 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
name := "google-apps-script-scalajs-facade"
normalizedName := "google-apps-script-scalajs-facade"
ThisBuild / scalafixDependencies += "com.github.liancheng" %% "organize-imports" % "0.5.0"
lazy val commonSettings = Seq(
version := "0.6.3",
scalaVersion := "3.0.1",
crossScalaVersions := Seq("3.0.1", "2.13.6", "2.12.11"),
organization := "tech.ignission",
scalacOptions ++= List(
"-deprecation",
"-feature",
"-unchecked"
)
)
lazy val noPublishSettings = Seq(
publish := {},
publishLocal := {},
publishArtifact := false,
skip / publish := true
)
lazy val publishPackages = Seq(
isSnapshot := version.value endsWith "SNAPSHOT",
ThisBuild / publishTo := sonatypePublishToBundle.value,
publishMavenStyle := true,
Test / publishArtifact := false,
Compile / packageDoc / publishArtifact := true,
Compile / packageSrc / publishArtifact := true,
pomIncludeRepository := { _ => false },
sonatypeTimeoutMillis := 3 * 60 * 60 * 1000,
publishConfiguration := publishConfiguration.value.withOverwrite(true),
publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true),
homepage := Some(url("https://github.com/ignission")),
Compile / doc / sources := Seq.empty,
licenses := Seq("MIT" -> url("https://opensource.org/licenses/MIT")),
scmInfo := Some(
ScmInfo(
url("https://github.com/ignission/scalajs-google-apps-script-facade"),
"scm:git:[email protected]/ignission/scalajs-google-apps-script-facade.git"
)
),
developers := List(
Developer(
id = "shoma416",
name = "Shoma Nishitateno",
email = "[email protected]",
url = url("https://github.com/shomatan")
)
)
)
lazy val root = project
.in(file("."))
.enablePlugins(ScalaJSPlugin)
.settings(commonSettings)
.settings(publishPackages)
val push = taskKey[Unit]("Push sources")
val deploy = taskKey[Unit]("Deploy")
lazy val example = project
.in(file("example"))
.enablePlugins(ScalaJSPlugin)
.settings(commonSettings)
.settings(noPublishSettings)
.settings(
scalacOptions ++= List(
"-deprecation",
"-feature",
"-unchecked",
"-Yrangepos",
"-Ymacro-annotations",
"-Ywarn-unused",
"-Xlint",
"-Xfatal-warnings"
),
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest" % "3.2.7" % Test
)
)
.settings(
addCompilerPlugin(scalafixSemanticdb),
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision
)
.settings(
push := {
(Compile / fastOptJS).value
Clasp.dist(name.value, scalaBinaryVersion.value, "example")
Clasp.push("example")
},
deploy := {
push.value
Clasp.deploy("example")
}
)
.dependsOn(root)
addCommandAlias("fix", "all example/compile:scalafix; example/test:scalafix")
addCommandAlias("fixCheck", "; compile:scalafix --check; test:scalafix --check")
addCommandAlias("format", "; scalafmt; test:scalafmt; scalafmtSbt")
addCommandAlias("formatCheck", "; scalafmtCheck; test:scalafmtCheck; scalafmtSbtCheck")
addCommandAlias("fixAll", "fix; format")
addCommandAlias("checkAll", "fixCheck; formatCheck")
Global / onChangedBuildSource := ReloadOnSourceChanges