-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.sbt
103 lines (88 loc) · 4.31 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
val copyJs = (resourceGenerators in Compile) += task {
val jsSrcDir = sourceDirectory.value / "main" / "js"
val jsDstDir = (resourceManaged in Compile).value
val jsSrcs = IO.listFiles(jsSrcDir).filter(_.getName.endsWith(".js"))
val srcRelNames = jsSrcs.map(_.getPath.substring(jsSrcDir.getPath.length+1))
val withVer = srcRelNames.map(n => n.substring(0, n.length-3)+"-"+version.value+".js")
val dstRelNames = withVer.map("toserve/net/liftmodules/ng/js/" + _)
val jsDsts = dstRelNames.map(new File(jsDstDir, _))
(jsSrcs zip jsDsts) map { case (src, dst) => IO.copyFile(src, dst) }
jsDsts.toSeq
}
name := "ng"
organization := "net.liftmodules"
homepage := Some(url("https://github.com/joescii/lift-ng"))
version := "0.12.1"
val liftVersion = SettingKey[String]("liftVersion", "Full version number of the Lift Web Framework")
val liftEdition = SettingKey[String]("liftEdition", "Lift Edition (short version number to append to artifact name)")
liftVersion := (liftVersion ?? "3.2.0").value
liftEdition := liftVersion.value.substring(0,3)
name := name.value + "_" + liftEdition.value
// Necessary beginning with sbt 0.13, otherwise Lift editions get messed up.
// E.g. "2.5" gets converted to "2-5"
moduleName := name.value
crossScalaVersions := Seq("2.12.4", "2.11.12")
scalaVersion := crossScalaVersions.value.head
resolvers += "CB Central Mirror" at "http://repo.cloudbees.com/content/groups/public"
resolvers += "Sonatype snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/"
libraryDependencies := {
// Ideally, keep this in sync with https://github.com/lift/framework/blob/master/project/Dependencies.scala#L32
Seq(
"net.liftweb" %% "lift-webkit" % liftVersion.value % "provided",
"com.joescii" % "j2js-i18n" % "0.1.1" % "compile",
"org.scalatest" %% "scalatest" % "3.0.4" % "test"
)
}
scalacOptions :=
"-deprecation" :: "-unchecked" :: "-feature" :: "-language:postfixOps" :: "-language:implicitConversions" :: Nil
excludeFilter in unmanagedSources := {
HiddenFileFilter ||
// (if(scalaVersion.value.startsWith("2.9")) "*2.10*" else "*2.9*") ||
(if(liftEdition.value.startsWith("3")) "*2.x*" else "*3.x*")
}
buildInfoSettings
sourceGenerators in Compile += buildInfo
buildInfoKeys := Seq[BuildInfoKey](version, liftVersion, liftEdition)
buildInfoPackage := "net.liftmodules.ng"
publishTo := (
if(version.value.endsWith("SNAPSHOT")) Some("snapshots" at "https://oss.sonatype.org/content/repositories/snapshots")
else Some("releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2")
)
credentials += Credentials( file("sonatype.credentials") )
credentials += Credentials( file("/private/liftmodules/sonatype.credentials") )
publishMavenStyle := true
publishArtifact in Test := false
pomIncludeRepository := { _ => false }
pomExtra := (
<scm>
<url>[email protected]:joescii/lift-ng.git</url>
<connection>scm:git:[email protected]:joescii/lift-ng.git</connection>
</scm>
<developers>
<developer>
<id>htmldoug</id>
<name>Doug Roper</name>
<url>https://github.com/htmldoug</url>
</developer>
<developer>
<id>joescii</id>
<name>Joe Barnes</name>
<url>https://github.com/joescii</url>
</developer>
</developers>
)
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0.html"))
Seq(com.untyped.sbtjs.Plugin.jsSettings : _*)
(sourceDirectory in (Compile, JsKeys.js)) := (sourceDirectory in Compile).value / "js"
(resourceManaged in (Compile, JsKeys.js)) := (resourceManaged in Compile).value / "toserve" / "net" / "liftmodules" / "ng" / "js"
(JsKeys.filenameSuffix in Compile) := "-" + version.value + ".min"
(resourceGenerators in Compile) += (JsKeys.js in Compile)
copyJs
// Jasmine stuff
Seq(jasmineSettings : _*)
appJsDir += sourceDirectory.value / "main" / "js"
appJsLibDir += sourceDirectory.value / "test" / "js" / "3rdlib"
jasmineTestDir += sourceDirectory.value / "test" / "js"
jasmineConfFile += sourceDirectory.value / "test" / "js" / "3rdlib" / "test.dependencies.js"
jasmineRequireJsFile += sourceDirectory.value / "test" / "js" / "3rdlib" / "require" / "require-2.0.6.js"
jasmineRequireConfFile += sourceDirectory.value / "test" / "js" / "3rdlib" / "require.conf.js"