forked from scalacenter/scalajs-bundler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
137 lines (128 loc) · 4.59 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
127
128
129
130
131
132
133
134
135
136
137
import sbtunidoc.Plugin.ScalaUnidoc
import sbtunidoc.Plugin.UnidocKeys.unidoc
val `sbt-scalajs-bundler` =
project.in(file("sbt-scalajs-bundler"))
.settings(commonSettings: _*)
.settings(
sbtPlugin := true,
name := "sbt-scalajs-bundler",
description := "Module bundler for Scala.js projects",
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.14")
)
val `sbt-web-scalajs-bundler` =
project.in(file("sbt-web-scalajs-bundler"))
.settings(commonSettings: _*)
.settings(
sbtPlugin := true,
scriptedDependencies := {
val () = scriptedDependencies.value
val () = publishLocal.value
val () = (publishLocal in `sbt-scalajs-bundler`).value
},
name := "sbt-web-scalajs-bundler",
description := "Module bundler for Scala.js projects (integration with sbt-web-scalajs)",
addSbtPlugin("com.vmunier" % "sbt-web-scalajs" % "1.0.2")
)
.dependsOn(`sbt-scalajs-bundler`)
// Dummy project that exists just for the purpose of aggregating the two sbt
// plugins. I can not do that in the `doc` project below because the
// scalaVersion is not compatible.
val apiDoc =
project.in(file("api-doc"))
.settings(noPublishSettings ++ unidocSettings: _*)
.settings(
scalacOptions in (ScalaUnidoc, unidoc) ++= Seq(
"-groups",
"-doc-source-url", s"https://github.com/scalacenter/scalajs-bundler/blob/v${version.value}€{FILE_PATH}.scala",
"-sourcepath", (baseDirectory in ThisBuild).value.absolutePath
)
)
.aggregate(`sbt-scalajs-bundler`, `sbt-web-scalajs-bundler`)
val ornateTarget = Def.setting(target.value / "ornate")
val manual =
project.in(file("manual"))
.enablePlugins(OrnatePlugin)
.settings(noPublishSettings ++ ghpages.settings: _*)
.settings(
scalaVersion := "2.11.8",
git.remoteRepo := "[email protected]:scalacenter/scalajs-bundler.git",
ornateSourceDir := Some(sourceDirectory.value / "ornate"),
ornateTargetDir := Some(ornateTarget.value),
siteSubdirName in ornate := "",
addMappingsToSiteDir(mappings in ornate, siteSubdirName in ornate),
mappings in ornate := {
val _ = ornate.value
val output = ornateTarget.value
output ** AllPassFilter --- output pair relativeTo(output)
},
siteSubdirName in packageDoc := "api/latest",
addMappingsToSiteDir(mappings in ScalaUnidoc in packageDoc in apiDoc, siteSubdirName in packageDoc)
)
import ReleaseTransformations._
val `scalajs-bundler` =
project.in(file("."))
.settings(ScriptedPlugin.scriptedSettings ++ noPublishSettings: _*)
.settings(
sbtPlugin := true,
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
releaseStepInputTask(scripted in `sbt-scalajs-bundler`),
releaseStepInputTask(scripted in `sbt-web-scalajs-bundler`),
releaseStepTask(ornate in manual),
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepTask(PgpKeys.publishSigned in `sbt-scalajs-bundler`),
releaseStepTask(PgpKeys.publishSigned in `sbt-web-scalajs-bundler`),
setNextVersion,
commitNextVersion,
pushChanges,
releaseStepTask(GhPagesKeys.pushSite in manual)
),
scriptedLaunchOpts += "-Dplugin.version=" + version.value,
scriptedBufferLog := false
)
.aggregate(`sbt-scalajs-bundler`, `sbt-web-scalajs-bundler`, manual, apiDoc)
lazy val commonSettings =
ScriptedPlugin.scriptedSettings ++ Seq(
scalacOptions ++= Seq(
"-feature",
"-deprecation",
"-encoding", "UTF-8",
"-unchecked",
"-Xlint",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard",
"-Xfuture"
),
organization := "ch.epfl.scala",
pomExtra :=
<developers>
<developer>
<id>julienrf</id>
<name>Julien Richard-Foy</name>
<url>http://julien.richard-foy.fr</url>
</developer>
</developers>,
homepage := Some(url(s"https://github.com/scalacenter/scalajs-bundler")),
licenses := Seq("MIT License" -> url("http://opensource.org/licenses/mit-license.php")),
scmInfo := Some(
ScmInfo(
url("https://github.com/scalacenter/scalajs-bundler"),
"scm:git:[email protected]:scalacenter/scalajs-bundler.git"
)
),
scriptedLaunchOpts += "-Dplugin.version=" + version.value,
scriptedBufferLog := false
)
lazy val noPublishSettings =
Seq(
publishArtifact := false,
publish := (),
publishLocal := ()
)