Skip to content

Commit

Permalink
update to NetLogo 6.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaspayette committed Jun 24, 2020
1 parent f1a06aa commit 57977dc
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
33 changes: 16 additions & 17 deletions xw/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ netLogoZipSources := false
netLogoTarget :=
org.nlogo.build.NetLogoExtension.directoryTarget(baseDirectory.value)

netLogoVersion := "6.0.4"
netLogoVersion := "6.1.1"

libraryDependencies ++= Seq(
"org.ow2.asm" % "asm-all" % "5.0.4" % "test",
Expand All @@ -36,33 +36,32 @@ test in Test := {

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
packageBin in Compile := {
IO.copyFile((packageBin in Compile).value, baseDirectory.value / jarName)
val jarFiles = (dependencyClasspath in Runtime).value.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))
jarFiles.foreach(file => IO.copyFile(file, baseDirectory.value / 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")
IO.createDirectory(baseDirectory.value / "xw")
val fileNames = jarFiles.map(_.getName) :+ "xw.jar"
for (fn <- fileNames) IO.copyFile(base / fn, base / "xw" / fn)
IO.createDirectory(base / "xw" / "widgets")
for (fn <- fileNames) IO.copyFile(baseDirectory.value / fn, baseDirectory.value / "xw" / fn)
IO.createDirectory(baseDirectory.value / "xw" / "widgets")
for {
path <- (base / "widgets").listFiles
path <- (baseDirectory.value / "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.createDirectory(baseDirectory.value / "xw" / "widgets" / path.getName)
IO.copyFile(file, baseDirectory.value / "xw" / "widgets" / path.getName / file.getName)
}
IO.delete(base / "xw.zip")
Process(Seq("zip", "-r", "xw.zip", "xw"), base).!!
IO.delete(base / "xw")
jar
IO.delete(baseDirectory.value / "xw.zip")
scala.sys.process.Process(Seq("zip", "-r", "xw.zip", "xw"), baseDirectory.value).!!
IO.delete(baseDirectory.value / "xw")
(packageBin in Compile).value
}

cleanFiles <++= baseDirectory { base => Seq(base / jarName) }
cleanFiles += baseDirectory.value / jarName
1 change: 1 addition & 0 deletions xw/project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.3.12
6 changes: 6 additions & 0 deletions xw/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resolvers += Resolver.url(
"NetLogo-JVM",
url("https://dl.bintray.com/content/netlogo/NetLogo-JVM"))(
Resolver.ivyStylePatterns)

addSbtPlugin("org.nlogo" % "netlogo-extension-plugin" % "3.2")

0 comments on commit 57977dc

Please sign in to comment.