diff --git a/xw/build.sbt b/xw/build.sbt index a309542..ce50473 100644 --- a/xw/build.sbt +++ b/xw/build.sbt @@ -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", @@ -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 diff --git a/xw/project/build.properties b/xw/project/build.properties new file mode 100644 index 0000000..654fe70 --- /dev/null +++ b/xw/project/build.properties @@ -0,0 +1 @@ +sbt.version=1.3.12 diff --git a/xw/project/plugins.sbt b/xw/project/plugins.sbt new file mode 100644 index 0000000..d1753d4 --- /dev/null +++ b/xw/project/plugins.sbt @@ -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")