-
Notifications
You must be signed in to change notification settings - Fork 21
/
build.sbt
104 lines (97 loc) · 3.08 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
import xerial.sbt.Sonatype._
import sbtcrossproject.CrossPlugin.autoImport.crossProject
lazy val root = project
.in(file("."))
.aggregate(parserJS, parserJVM, facadeJS, facadeJVM)
.settings(sonatypeSettings)
lazy val fixResources =
taskKey[Unit]("Fix application.conf presence on first clean build.")
lazy val parser = crossProject(JSPlatform, JVMPlatform)
.in(file("."))
.settings(
name := "shocon-parser",
scalacOptions ++=
Seq(
"-feature",
"-unchecked",
"-language:implicitConversions",
"-deprecation",
),
publishTo := sonatypePublishTo.value
)
.settings(sonatypeSettings)
.settings(
fixResources := {
val compileConf = (resourceDirectory in Compile).value / "application.conf"
if (compileConf.exists)
IO.copyFile(
compileConf,
(classDirectory in Compile).value / "application.conf"
)
val testConf = (resourceDirectory in Test).value / "application.conf"
if (testConf.exists) {
IO.copyFile(
testConf,
(classDirectory in Test).value / "application.conf"
)
}
},
compile in Compile := (compile in Compile).dependsOn(fixResources).value,
libraryDependencies ++= Seq(
"org.scala-lang.modules" %%% "scala-collection-compat" % "2.1.4",
"com.lihaoyi" %%% "fastparse" % "2.2.4",
"org.scala-lang" % "scala-reflect" % scalaVersion.value % "provided"
)
)
.jsSettings(
libraryDependencies += "org.scala-js" %%% "scalajs-java-time" % "1.0.0",
parallelExecution in Test := true
)
lazy val parserJVM = parser.jvm
lazy val parserJS = parser.js
lazy val facade = crossProject(JSPlatform, JVMPlatform)
.in(file("facade"))
.dependsOn(parser)
.settings(
name := "shocon",
scalacOptions ++=
Seq(
"-feature",
"-unchecked",
"-language:implicitConversions",
"-deprecation",
),
publishTo := sonatypePublishTo.value
)
.settings(sonatypeSettings)
.settings(
fixResources := {
val compileConf = (resourceDirectory in Compile).value / "application.conf"
if (compileConf.exists)
IO.copyFile(
compileConf,
(classDirectory in Compile).value / "application.conf"
)
val testConf = (resourceDirectory in Test).value / "application.conf"
if (testConf.exists) {
IO.copyFile(
testConf,
(classDirectory in Test).value / "application.conf"
)
}
},
compile in Compile := (compile in Compile).dependsOn(fixResources).value,
testFrameworks += new TestFramework("utest.runner.Framework"),
libraryDependencies ++= Seq(
"org.scala-lang.modules" %%% "scala-collection-compat" % "2.1.4",
"com.lihaoyi" %%% "fastparse" % "2.2.4",
"com.lihaoyi" %%% "utest" % "0.7.4" % "test",
"org.scala-lang" % "scala-reflect" % scalaVersion.value % "provided"
)
)
.jsSettings(
libraryDependencies += "org.scala-js" %%% "scalajs-java-time" % "1.0.0",
parallelExecution in Test := true
)
lazy val facadeJVM = facade.jvm
lazy val facadeJS = facade.js