-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
67 lines (55 loc) · 2.4 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
import org.nlogo.build.{ ExtensionDocumentationPlugin, NetLogoExtension }
name := "Simple R Extension"
enablePlugins(ExtensionDocumentationPlugin)
lazy val rScriptFiles = settingKey[Seq[File]]("list of R scripts to include in package and testing")
lazy val commonSettings = Seq(
version := "2.0.4"
, isSnapshot := true
, rScriptFiles := Seq(baseDirectory.value / ".." / "src" / "rext.R", baseDirectory.value / ".." / "src" / "rlibs.R")
, netLogoVersion := "6.3.0"
, netLogoPackageExtras ++= rScriptFiles.value.map( (f) => (f, None) )
, netLogoZipExtras ++= Seq(baseDirectory.value / ".." / "demos", baseDirectory.value / ".." / "README.md")
, scalaVersion := "2.12.17"
, Test / scalaSource := baseDirectory.value / "test"
, Compile / scalaSource := baseDirectory.value / ".." / "src" / "main"
, scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature", "-Xfatal-warnings", "-Xlint", "-release", "11")
, Compile / packageBin / artifactPath := {
val oldPath = (Compile / packageBin / artifactPath).value.toPath
val newPath = oldPath.getParent / s"${netLogoExtName.value}.jar"
newPath.toFile
}
, (Test / testOptions) ++= Seq(
Tests.Setup( () => {
rScriptFiles.value.foreach( (file) => IO.copyFile(file, baseDirectory.value / ".." / file.getName) )
})
, Tests.Cleanup( () => {
rScriptFiles.value.foreach( (file) => IO.delete(baseDirectory.value / ".." / file.getName) )
})
)
, resolvers += "netlogo-lang-extension" at "https://dl.cloudsmith.io/public/netlogo/language-library/maven"
, libraryDependencies ++= Seq(
"org.nlogo.languagelibrary" %% "language-library" % "2.4.0"
, )
)
lazy val root = (project in file("."))
.settings(
Compile / skip := true
, Test / skip := true
)
lazy val simpleR = (project in file("root-simple-r"))
.settings(commonSettings: _*)
.settings(
name := "Simple R Extension"
, netLogoClassManager := "org.nlogo.extensions.simpler.SimpleRExtension"
, netLogoExtName := "sr"
)
.enablePlugins(NetLogoExtension)
lazy val deprecatedR = (project in file("root-deprecated-r"))
.settings(commonSettings: _*)
.settings(
name := "R Extension (Deprecated)"
, netLogoClassManager := "org.nlogo.extensions.simpler.DeprecatedRExtension"
, netLogoExtName := "r"
, netLogoLongDescription := "Deprecated! Please use Simple R extensions instead."
)
.enablePlugins(NetLogoExtension)