-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sbt
140 lines (125 loc) · 4.03 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
138
139
140
import sbt._
import sbt.Keys._
import bintray.Keys._
import scala.concurrent.duration._
lazy val commonSettings = Seq(
scalacOptions ++= Seq(
"-deprecation",
"-encoding", "UTF-8",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-language:experimental.macros",
"-unchecked",
// "-Xfatal-warnings",
"-Xlint",
"-Yno-adapted-args",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-value-discard",
"-Xfuture"
)
)
lazy val buildSettings = Seq(
version := "0.1.0",
organization := "com.scalakata.metadoc",
homepage := Some(url("http://scalakata.com")),
licenses := Seq("MIT" -> url("http://www.opensource.org/licenses/mit-license.html")),
crossVersion := CrossVersion.full,
scalaVersion := "2.11.7",
resolvers += "scalaz-bintray" at "http://dl.bintray.com/scalaz/releases",
scalacOptions in Test ++= Seq("-Yrangepos")
)
lazy val bintrayMaven = Seq(
repository in bintray := "maven",
bintrayOrganization in bintray := None
)
lazy val bintrayPlugin = Seq(
repository in bintray := "sbt-plugins",
bintrayOrganization in bintray := None
)
lazy val loadSubmodules =
initialize := {
val run = initialize.value
"git submodule init" ! sLog.value
"git submodule update" ! sLog.value
}
val metaVersion = "0.1.0-SNAPSHOT"
def compiler(sv: String) = "org.scala-lang" % "scala-compiler" % sv % "optional"
val scalameta = "org.scalameta" % "scalameta" % metaVersion % "optional" cross CrossVersion.binary
val scalahost = "org.scalameta" % "scalahost" % metaVersion % "optional" cross CrossVersion.full
val scalaz = "org.scalaz" %% "scalaz-core" % "7.1.1"
val specs = "org.specs2" %% "specs2-core" % "3.1" % "test"
val pickle = "org.scala-lang.modules" %% "scala-pickling" % "0.10.0"
lazy val metadocSettings = buildSettings ++ commonSettings ++ bintraySettings
lazy val model = project
.settings(metadocSettings: _*)
.settings(bintrayMaven: _*)
.settings(
name := "metadoc-model",
libraryDependencies ++= Seq(
scalaz,
specs,
pickle,
"com.github.nscala-time" %% "nscala-time" % "2.0.0"
),
timeout in Backend := 240.seconds
).enablePlugins(ScalaKataPlugin)
lazy val compilerPlugin = project
.settings(metadocSettings: _*)
.settings(bintrayMaven: _*)
.settings(Merge.settings: _*)
.settings(seq(
name := "metadoc-compiler-plugin",
parallelExecution in Test := false, // hello, reflection sync!!
libraryDependencies ++= Seq(
compiler(scalaVersion.value),
scalameta,
scalahost,
specs
)
): _*)
.dependsOn(model)
lazy val metaSbtPlugin = project
.settings(metadocSettings: _*)
.settings(buildInfoSettings: _*)
.settings(bintrayPlugin: _*)
.settings(Seq(
name := "metadoc-sbt-plugin",
sbtPlugin := true,
sourceGenerators in Compile <+= buildInfo,
buildInfoKeys := Seq[BuildInfoKey](version),
buildInfoPackage := organization.value + ".build",
scalaVersion := "2.10.5"
): _*)
lazy val bintrayScape = project
.settings(loadSubmodules)
.settings(metadocSettings: _*)
.settings(Seq(
name := "bintray-scraper",
resolvers ++= Seq(
"Sonatype" at "https://oss.sonatype.org/content/repositories/releases",
"spray repo" at "http://repo.spray.io"
),
libraryDependencies ++= Seq(
"me.tongfei" % "progressbar" % "0.4.0",
"io.spray" %% "spray-client" % "1.3.2-20140909",
"com.typesafe.akka" %% "akka-slf4j" % "2.3.6",
"ch.qos.logback" % "logback-classic" % "1.0.0" % "runtime",
"com.typesafe.akka" %% "akka-actor" % "2.3.6",
"com.typesafe.play" %% "play-json" % "2.4.0-M3"
)
): _*) dependsOn(model)
def usePlugin(plugin: ProjectReference) = {
scalacOptions ++= {
val jar = (Keys.`package` in (plugin, Compile)).value
System.setProperty("sbt.paths.plugin.jar", jar.getAbsolutePath)
Seq("-Xplugin:" + jar.getAbsolutePath, "-Jdummy=" + jar.lastModified)
}
}
lazy val testBench = project
.settings(usePlugin(compilerPlugin))
.settings(
scalaVersion := "2.11.7"
)