-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
71 lines (61 loc) · 3.1 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
import sbt.Keys._
scalaVersion := "2.10.3"
val scalaMacroVersion = "2.0.0-M3"
lazy val plugin = project.settings(
name := "plugin",
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value,
publishArtifact in Compile := false
)
val commonSettings = Seq(
organization := "eu.swdev.playext",
version := "0.1-SNAPSHOT",
resolvers += Resolver.sonatypeRepo("snapshots"),
resolvers += Resolver.sonatypeRepo("releases"),
libraryDependencies += "org.scalatest" %% "scalatest" % "2.1.0" % "test",
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.11.3" % "test",
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value,
addCompilerPlugin("org.scalamacros" % "paradise" % scalaMacroVersion cross CrossVersion.full),
scalacOptions += "-feature",
scalacOptions += "-language:higherKinds"
/*
scalacOptions in Compile <++= (Keys.`package` in (plugin, Compile)) map { (jar: File) =>
val addPlugin = "-Xplugin:" + jar.getAbsolutePath
// add plugin timestamp to compiler options to trigger recompile of
// main after editing the plugin. (Otherwise a 'clean' is needed.)
val dummy = "-Jdummy=" + jar.lastModified
Seq(addPlugin, dummy)
}
*/
) ++ bintraySettings ++ Seq(
licenses += ("MIT", url("http://opensource.org/licenses/MIT")),
publishMavenStyle := true,
bintray.Keys.repository in bintray.Keys.bintray := "generic",
bintray.Keys.bintrayOrganization in bintray.Keys.bintray := None,
bintray.Keys.packageLabels in bintray.Keys.bintray := Seq("Scala", "Play")
)
val commonPlaySettings = commonSettings ++ play.Project.playScalaSettings
lazy val core = project.settings(commonSettings: _*).settings(
libraryDependencies += "org.scalamacros" % "quasiquotes" % scalaMacroVersion cross CrossVersion.full,
// macros that are executed when tests are compiled may need to access test resources
// -> add the test resource directory to the test dependency classpath
dependencyClasspath in Test ++= (unmanagedResourceDirectories in Test).value
)
lazy val playMod = Project("play-mod", file("play-mod")).dependsOn(core).settings(
name := "play-mod"
).settings(commonPlaySettings: _*).settings(
templatesImport += "eu.swdev.web.form._",
templatesImport += "eu.swdev.web.style._",
templatesImport += "eu.swdev.web.style.AttrDescs._",
templatesImport += "eu.swdev.play.form.MsgLookup",
templatesImport += "eu.swdev.play.form.bootstrap3._",
dependencyClasspath in Test ++= (unmanagedResourceDirectories in Test).value
)
lazy val playApp = Project("play-app", file("play-app")).dependsOn(core, playMod).settings(
name := "play-app"
).settings(commonPlaySettings: _*).settings(
// macros that are executed when the play application gets compiled may need to access resources
// -> add the resource directory to the dependency classpath
dependencyClasspath in Compile ++= (unmanagedResourceDirectories in Compile).value,
templatesImport += "eu.swdev.play.form.bootstrap3.Import._"
)
lazy val root = project.in(file(".")).aggregate(core, playMod, playApp)