This repository has been archived by the owner on Mar 25, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.sbt
128 lines (113 loc) · 3.54 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
import sbt._
import sbt.Keys._
import bintray.Keys._
val currentScalaVersion = "2.11.7"
val moorkaVersion = "0.8.0-SNAPSHOT"
scalaVersion := currentScalaVersion
val dontPublish = Seq(
publish := { }
)
val commonSettings = Seq(
version := moorkaVersion,
organization := "org.reactivekittens",
licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.html")),
homepage := Some(url("http://github.com/tenderowls/moorka")),
scalaVersion := currentScalaVersion,
scalacOptions ++= Seq("-deprecation", "-feature")
)
val utestSetting = Seq(
testFrameworks += new TestFramework("utest.runner.Framework"),
libraryDependencies += "com.lihaoyi" %%% "utest" % "0.3.1" % "test"
)
val publishSettings = moorkaVersion.endsWith("SNAPSHOT") match {
case true => Seq(
publishTo := Some("Flexis Thirdparty Snapshots" at "https://nexus.flexis.ru/content/repositories/thirdparty-snapshots"),
credentials += {
val ivyHome = sys.props.get("sbt.ivy.home") match {
case Some(path) ⇒ file(path)
case None ⇒ Path.userHome / ".ivy2"
}
Credentials(ivyHome / ".credentials")
}
)
case false => bintraySettings ++ bintrayPublishSettings ++ Seq(
repository in bintray := "moorka",
bintrayOrganization in bintray := Some("tenderowls"),
publishMavenStyle := false
)
}
lazy val moorka = crossProject
.crossType(CrossType.Pure)
.jsSettings(utestSetting:_*)
.jvmSettings(utestSetting:_*)
.settings(publishSettings:_*)
.settings(commonSettings:_*)
.settings(
normalizedName := "moorka",
scalaVersion := currentScalaVersion
)
lazy val moorkaJS = moorka.js
lazy val moorkaJVM = moorka.jvm
lazy val vaska = crossProject
.crossType(CrossType.Full)
.settings(
unmanagedResourceDirectories in Compile += file("vaska") / "shared" / "src" / "main" / "resources"
)
.jsSettings(utestSetting:_*)
.jsSettings(
libraryDependencies ++= Seq(
"org.webjars" % "es6-shim" % "0.20.2" % "test"
),
jsDependencies in Test ++= Seq(
"org.webjars" % "es6-shim" % "0.20.2" / "es6-shim.js",
ProvidedJS / "localStorage.js",
ProvidedJS / "vaska.js" dependsOn "localStorage.js"
),
jsDependencies += ProvidedJS / "vaska.js"
)
.jvmSettings(utestSetting:_*)
.settings(publishSettings:_*)
.settings(commonSettings:_*)
.settings(normalizedName := "vaska")
val vaskaJS = vaska.js
val vaskaJVM = vaska.jvm
lazy val felix = crossProject
.crossType(CrossType.Full)
.settings(publishSettings:_*)
.settings(commonSettings:_*)
.settings(
normalizedName := "felix",
unmanagedResourceDirectories in Compile += file("felix") / "shared" / "src" / "main" / "resources"
)
.jsSettings(utestSetting:_*)
.jsConfigure(_.dependsOn(vaskaJS % "compile->compile;test->test", moorkaJS))
.jsSettings(
jsDependencies += ProvidedJS / "felix.js"
)
.jvmSettings(utestSetting:_*)
.jvmSettings(
libraryDependencies += "org.java-websocket" % "Java-WebSocket" % "1.3.0"
)
.jvmConfigure(_.dependsOn(vaskaJVM, moorkaJVM))
val felixJS = felix.js
val felixJVM = felix.jvm
//lazy val ui = (project in file("moorka-ui"))
// .enablePlugins(ScalaJSPlugin)
// .settings(publishSettings:_*)
// .settings(commonSettings:_*)
// .settings(
// normalizedName := "moorka-ui",
// scalaVersion := currentScalaVersion
// )
// .dependsOn(coreJS)
// .dependsOn(vaskaJS)
lazy val root = (project in file("."))
.settings(dontPublish:_*)
.settings(
scalaVersion := currentScalaVersion
)
.aggregate(
felixJS, felixJVM,
vaskaJS, vaskaJVM,
moorkaJS, moorkaJVM
)