-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #167 from CRESS-Surrey/6.4.0_update
Update the extension to work with NetLogo 6.4.0
- Loading branch information
Showing
19 changed files
with
74 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sbt.version=1.5.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,40 @@ | ||
ThisBuild / version := "2.0.0" | ||
ThisBuild / scalaVersion := "2.12.18" | ||
ThisBuild / scalacOptions ++= Seq( | ||
"-feature", | ||
"-deprecation", | ||
"-unchecked", | ||
"-Xfatal-warnings", | ||
"-encoding", "UTF8") | ||
|
||
lazy val root = (project in file(".")) | ||
.settings(version := "2.0.0") | ||
.aggregate(xw, core, api, note, checkbox, slider, chooser, multichooser, input, button) | ||
.aggregate(api, core, note, checkbox, slider, chooser, multichooser, input, button, xw) | ||
|
||
lazy val api = project | ||
.settings(version := "2.0.0") | ||
|
||
lazy val core = project | ||
.settings(version := "2.0.0") | ||
.dependsOn(api) | ||
|
||
lazy val note = (project in file("./xw/widgets/NoteWidget/")) | ||
.settings(version := "2.0.0") | ||
.dependsOn(api) | ||
|
||
lazy val checkbox = (project in file("./xw/widgets/CheckboxWidget/")) | ||
.settings(version := "2.0.0") | ||
.dependsOn(api) | ||
|
||
lazy val slider = (project in file("./xw/widgets/SliderWidget/")) | ||
.settings(version := "2.0.0") | ||
.dependsOn(api) | ||
|
||
lazy val chooser = (project in file("./xw/widgets/ChooserWidget/")) | ||
.settings(version := "2.0.0") | ||
.dependsOn(api) | ||
|
||
lazy val multichooser = (project in file("./xw/widgets/MultiChooserWidget/")) | ||
.settings(version := "2.0.0") | ||
.dependsOn(api) | ||
|
||
lazy val input = (project in file("./xw/widgets/InputWidgets/")) | ||
.settings(version := "2.0.0") | ||
.dependsOn(api) | ||
|
||
lazy val button = (project in file("./xw/widgets/ButtonWidget/")) | ||
.settings(version := "2.0.0") | ||
.dependsOn(api) | ||
|
||
lazy val xw = project.dependsOn(core) | ||
.settings( | ||
version := "2.0.0", | ||
(test in Test) := { | ||
val _ = Seq( | ||
(Keys.`package` in (note, Compile)).value, | ||
(Keys.`package` in (checkbox, Compile)).value, | ||
(Keys.`package` in (slider, Compile)).value, | ||
(Keys.`package` in (chooser, Compile)).value, | ||
(Keys.`package` in (multichooser, Compile)).value, | ||
(Keys.`package` in (input, Compile)).value, | ||
(Keys.`package` in (button, Compile)).value | ||
) | ||
(test in Test).value | ||
} | ||
) | ||
.dependsOn(api) | ||
|
||
lazy val core = project | ||
.dependsOn(api) | ||
|
||
lazy val xw = project | ||
.dependsOn(core) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sbt.version=1.5.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=0.13.12 | ||
sbt.version=1.5.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.4") | ||
resolvers += "netlogo-extension-plugin" at "https://dl.cloudsmith.io/public/netlogo/netlogo-extension-plugin/maven/" | ||
|
||
resolvers += Resolver.url( | ||
"NetLogo-JVM", | ||
url("http://dl.bintray.com/content/netlogo/NetLogo-JVM"))( | ||
Resolver.ivyStylePatterns) | ||
|
||
addSbtPlugin("org.nlogo" % "netlogo-extension-plugin" % "3.0") | ||
addSbtPlugin("org.nlogo" % "netlogo-extension-plugin" % "5.2.3") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,23 @@ | ||
scalaVersion := "2.12.2" | ||
|
||
enablePlugins(org.nlogo.build.NetLogoExtension) | ||
|
||
scalacOptions ++= Seq( | ||
"-feature", | ||
"-deprecation", | ||
"-unchecked", | ||
"-Xfatal-warnings", | ||
"-encoding", "UTF8") | ||
|
||
name := "eXtraWidgets-Extension" | ||
|
||
netLogoExtName := "xw" | ||
|
||
netLogoClassManager := "uk.ac.surrey.xw.extension.ExtraWidgetsExtension" | ||
|
||
netLogoZipSources := false | ||
|
||
netLogoTarget := | ||
org.nlogo.build.NetLogoExtension.directoryTarget(baseDirectory.value) | ||
|
||
netLogoVersion := "6.0.4" | ||
|
||
libraryDependencies ++= Seq( | ||
"org.ow2.asm" % "asm-all" % "5.0.4" % "test", | ||
"org.picocontainer" % "picocontainer" % "2.13.6" % "test", | ||
"org.scalatest" %% "scalatest" % "3.0.0" % "test", | ||
"commons-codec" % "commons-codec" % "1.10" % "test" | ||
) | ||
|
||
test in Test := { | ||
val _ = (packageBin in Compile).value | ||
(test in Test).value | ||
} | ||
|
||
val jarName = "xw.jar" | ||
|
||
packageBin in Compile <<= (packageBin in Compile, baseDirectory, dependencyClasspath in Runtime) map { | ||
(jar, base, classPath) => | ||
IO.copyFile(jar, base / jarName) | ||
val jarFiles = classPath.files | ||
.filter { _.getName matches "(.*).jar" } | ||
.filterNot { _.getName matches "netlogo(.*).jar" } | ||
.filterNot { _.getName matches "scala-library(.*).jar" } | ||
jarFiles.foreach(file => IO.copyFile(file, base / file.getName)) | ||
// copy everything thing we need for distribution in a | ||
// temp "xw" directory, which we will zip before deleting it. | ||
IO.createDirectory(base / "xw") | ||
val fileNames = jarFiles.map(_.getName) :+ "xw.jar" | ||
for (fn <- fileNames) IO.copyFile(base / fn, base / "xw" / fn) | ||
IO.createDirectory(base / "xw" / "widgets") | ||
for { | ||
path <- (base / "widgets").listFiles | ||
if path.isDirectory | ||
file <- path.listFiles | ||
if file.getName.endsWith(".jar") | ||
} { | ||
IO.createDirectory(base / "xw" / "widgets" / path.getName) | ||
IO.copyFile(file, base / "xw" / "widgets" / path.getName / file.getName) | ||
} | ||
IO.delete(base / "xw.zip") | ||
Process(Seq("zip", "-r", "xw.zip", "xw"), base).!! | ||
IO.delete(base / "xw") | ||
jar | ||
} | ||
|
||
cleanFiles <++= baseDirectory { base => Seq(base / jarName) } | ||
name := "eXtraWidgets Extension" | ||
netLogoExtName := "xw" | ||
netLogoClassManager := "uk.ac.surrey.xw.extension.ExtraWidgetsExtension" | ||
netLogoVersion := "6.4.0" | ||
netLogoShortDescription := "An extension for creating additional interface tabs in the NetLogo GUI and putting custom widgets on them." | ||
netLogoLongDescription := netLogoShortDescription.value | ||
netLogoHomepage := "https://github.com/NetLogo/NetLogo-Extension-Plugin" | ||
|
||
netLogoPackageExtras ++= | ||
Seq("api", "core") | ||
.map(x => | ||
(baseDirectory.value / ".." / x / "target" / "scala-2.12" / s"extrawidgets-$x.jar", None) | ||
) ++ | ||
(baseDirectory.value / "widgets") | ||
.listFiles | ||
.filter(_.isDirectory) | ||
.map(widgetFolder => { | ||
val name = widgetFolder.getName | ||
val jar = widgetFolder / "target" / "scala-2.12" / (name + ".jar") | ||
(jar, Option("widgets/" + name + "/" + jar.getName)) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,3 @@ | ||
name := "ButtonWidget" | ||
|
||
scalaVersion := "2.12.2" | ||
|
||
scalacOptions ++= Seq( | ||
"-feature", | ||
"-deprecation", | ||
"-unchecked", | ||
"-Xfatal-warnings", | ||
"-encoding", "UTF8") | ||
|
||
val jarName = "ButtonWidget.jar" | ||
|
||
artifactName := { (_, _, _) => jarName } | ||
|
||
packageBin in Compile <<= (packageBin in Compile, baseDirectory) map { | ||
(jar, base) => | ||
IO.copyFile(jar, base / jarName) | ||
jar | ||
} | ||
|
||
cleanFiles <++= baseDirectory { base => Seq(base / jarName) } | ||
artifactName := { (_, _, _) => name.value + ".jar" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,3 @@ | ||
name := "CheckboxWidget" | ||
|
||
scalaVersion := "2.12.2" | ||
|
||
scalacOptions ++= Seq( | ||
"-feature", | ||
"-deprecation", | ||
"-unchecked", | ||
"-Xfatal-warnings", | ||
"-encoding", "UTF8") | ||
|
||
val jarName = "CheckboxWidget.jar" | ||
|
||
artifactName := { (_, _, _) => jarName } | ||
|
||
packageBin in Compile <<= (packageBin in Compile, baseDirectory) map { | ||
(jar, base) => | ||
IO.copyFile(jar, base / jarName) | ||
jar | ||
} | ||
|
||
cleanFiles <++= baseDirectory { base => Seq(base / jarName) } | ||
artifactName := { (_, _, _) => name.value + ".jar" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,3 @@ | ||
name := "ChooserWidget" | ||
|
||
scalaVersion := "2.12.2" | ||
|
||
scalacOptions ++= Seq( | ||
"-feature", | ||
"-deprecation", | ||
"-unchecked", | ||
"-Xfatal-warnings", | ||
"-encoding", "UTF8") | ||
|
||
val jarName = "ChooserWidget.jar" | ||
|
||
artifactName := { (_, _, _) => jarName } | ||
|
||
packageBin in Compile <<= (packageBin in Compile, baseDirectory) map { | ||
(jar, base) => | ||
IO.copyFile(jar, base / jarName) | ||
jar | ||
} | ||
|
||
cleanFiles <++= baseDirectory { base => Seq(base / jarName) } | ||
artifactName := { (_, _, _) => name.value + ".jar" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,3 @@ | ||
name := "InputWidgets" | ||
|
||
scalaVersion := "2.12.2" | ||
|
||
scalacOptions ++= Seq( | ||
"-feature", | ||
"-deprecation", | ||
"-unchecked", | ||
"-Xfatal-warnings", | ||
"-encoding", "UTF8") | ||
|
||
val jarName = "InputWidgets.jar" | ||
|
||
artifactName := { (_, _, _) => jarName } | ||
|
||
packageBin in Compile <<= (packageBin in Compile, baseDirectory) map { | ||
(jar, base) => | ||
IO.copyFile(jar, base / jarName) | ||
jar | ||
} | ||
|
||
cleanFiles <++= baseDirectory { base => Seq(base / jarName) } | ||
artifactName := { (_, _, _) => name.value + ".jar" } |
Oops, something went wrong.