forked from lihaoyi/Scalatex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
113 lines (103 loc) · 3.63 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
publishArtifact := false
publishTo := Some(Resolver.file("Unused transient repository", file("target/unusedrepo")))
val sharedSettings = Seq(
version := _root_.scalatex.Constants.version,
organization := "com.lihaoyi",
crossScalaVersions:= Seq("2.10.4", "2.11.6"),
scalaVersion := "2.11.6",
libraryDependencies += "com.lihaoyi" %% "acyclic" % "0.1.2" % "provided",
addCompilerPlugin("com.lihaoyi" %% "acyclic" % "0.1.2"),
autoCompilerPlugins := true,
publishTo := Some("releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2"),
pomExtra :=
<url>https://github.com/lihaoyi/Scalatex</url>
<licenses>
<license>
<name>MIT license</name>
<url>http://www.opensource.org/licenses/mit-license.php</url>
</license>
</licenses>
<scm>
<url>git://github.com/lihaoyi/Scalatex.git</url>
<connection>scm:git://github.com/lihaoyi/Scalatex.git</connection>
</scm>
<developers>
<developer>
<id>lihaoyi</id>
<name>Li Haoyi</name>
<url>https://github.com/lihaoyi</url>
</developer>
</developers>
)
lazy val api = project.settings(sharedSettings:_*)
.settings(
name := "scalatex-api",
libraryDependencies ++= Seq(
"com.lihaoyi" %% "utest" % "0.3.1" % "test",
"com.lihaoyi" %% "scalaparse" % "0.4.1",
"com.lihaoyi" %% "scalatags" % "0.6.0",
"org.scala-lang" % "scala-reflect" % scalaVersion.value
),
testFrameworks += new TestFramework("utest.runner.Framework")
)
lazy val scalatexSbtPlugin = project.settings(sharedSettings:_*)
.settings(
name := "scalatex-sbt-plugin",
scalaVersion := "2.10.4",
sbtPlugin := true,
(unmanagedSources in Compile) += baseDirectory.value/".."/"project"/"Constants.scala"
)
lazy val site =
project
.dependsOn(api)
.settings(scalatex.SbtPlugin.projectSettings:_*)
.settings(sharedSettings:_*)
.settings(
libraryDependencies := libraryDependencies.value.filter(!_.toString.contains("scalatex-api")),
name := "scalatex-site",
libraryDependencies ++= Seq(
"com.lihaoyi" %% "utest" % "0.3.1" % "test",
"com.lihaoyi" %% "ammonite-ops" % "0.4.8",
"org.webjars" % "highlightjs" % "8.2-1",
"org.webjars" % "font-awesome" % "4.2.0",
"com.lihaoyi" %% "scalatags" % "0.6.0",
"org.webjars" % "pure" % "0.5.0",
"com.lihaoyi" %% "upickle" % "0.3.6",
"org.scalaj" %% "scalaj-http" % "1.1.6"
),
testFrameworks += new TestFramework("utest.runner.Framework"),
(managedResources in Compile) += {
val file = (resourceManaged in Compile).value/"scalatex"/"scrollspy"/"scrollspy.js"
val js = (fullOptJS in (scrollspy, Compile)).value.data
sbt.IO.copyFile(js, file)
file
}
)
lazy val scrollspy = project
.enablePlugins(ScalaJSPlugin)
.settings(
scalaVersion := "2.11.6",
libraryDependencies ++= Seq(
"com.lihaoyi" %%% "upickle" % "0.3.6",
"org.scala-js" %%% "scalajs-dom" % "0.8.2",
"com.lihaoyi" %%% "scalatags" % "0.6.0"
),
emitSourceMaps := false,
publishArtifact := false,
publishTo := Some(Resolver.file("Unused transient repository", file("target/unusedrepo")))
)
lazy val readme = scalatex.ScalatexReadme(
projectId = "readme",
wd = file(""),
url = "https://github.com/lihaoyi/scalatex/tree/master",
source = "Readme"
)
.settings(
libraryDependencies := libraryDependencies.value.filter(_.name == "scalatex-site"),
(unmanagedSources in Compile) += baseDirectory.value/".."/"project"/"Constants.scala",
publishArtifact := false,
publishTo := Some(Resolver.file("Unused transient repository", file("target/unusedrepo")))
)
.dependsOn(
site
)