-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sbt
47 lines (36 loc) · 1.5 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
enablePlugins(org.nlogo.build.NetLogoExtension)
scalaSource in Compile := baseDirectory.value / "src" / "main"
scalaSource in Test := baseDirectory.value / "src" / "test"
netLogoClassManager := "org.nlogo.extensions.reflection.NetLogoReflectionScala"
netLogoVersion := "6.0.1-M1"
netLogoTarget := NetLogoExtension.directoryTarget(baseDirectory.value)
lazy val root = (project in file(".")).
settings(
inThisBuild(List(
scalaVersion := "2.12.1"
,version := "0.1.0-SNAPSHOT"
))
,name := "reflection"
,libraryDependencies ++= Seq(
"org.picocontainer" % "picocontainer" % "2.13.6" % "test",
"org.scalatest" %% "scalatest" % "3.0.0" % "test",
"org.ow2.asm" % "asm-all" % "5.0.3" % "test"
)
)
val moveToRefDir = taskKey[Unit]("add all resources to Reflection directory")
val refDirectory = settingKey[File]("directory that extension is moved to for testing")
refDirectory := baseDirectory.value / "extensions" / "reflection"
moveToRefDir := {
(packageBin in Compile).value
val testTarget = NetLogoExtension.directoryTarget(refDirectory.value)
testTarget.create(NetLogoExtension.netLogoPackagedFiles.value)
val testResources = (baseDirectory.value / "test" ***).filter(_.isFile)
for (file <- testResources.get)
IO.copyFile(file, refDirectory.value / "test" / IO.relativize(baseDirectory.value / "test", file).get)
}
test in Test := {
IO.createDirectory(refDirectory.value)
moveToRefDir.value
(test in Test).value
IO.delete(refDirectory.value)
}