I am working on a Scala extension for NetLogo (repo). I am following both the Extension API example and NetLogos Sample-Scala-Extension.
I am seeing:
[info] Done packaging.
To compare two paths outside a working tree:
usage: git diff [--no-index] <path> <path>
[warn] working tree not clean when packaging; target not created
[success] Total time: 6 s, completed Jan 29, 2019, 6:22:00 PM
The .jar that is generated does not contain modifications I made to the extension. I think it has something to do with "[warn] working tree not clean...".
Is this the case? What is the solution?
File hierarchy:
Scala-Plume-Model
build.sbt
src
PlumeModelExtension.scala
build.sbt
enablePlugins(org.nlogo.build.NetLogoExtension)
name := "plume-scala"
version := "0.1"
scalaVersion := "2.12.0"
netLogoExtName := "plume-scala"
netLogoClassManager := "PlumeModelExtension"
netLogoZipSources := false
scalaSource in Compile := baseDirectory.value / "src"
scalacOptions ++= Seq("-deprecation", "-unchecked", "-Xfatal-warnings", "-encoding", "us-ascii")
netLogoVersion := "6.0.4"
The short answer: add isSnapshot := true
to your build.sbt
and then the package
sbt task should start creating the output jar and zip files regardless of the current status of git.
Longer answer: The NetLogo Extension SBT plugin has some expectations about when packaging will occur. If isSnapshot
is false
or unset, the plugin assumes you're trying to do a "production" release. But for a production release you probably do not want to compile and package off of a dirty repository. So it warns you and does not create the artifacts.
The normal workflow would be to keep isSnapshot := true
while you're in development, then once you have all your commits done and are ready for a release, add a commit to set isSnapshot := false
(maybe along with a version bump for the extension), package and tag the release, then add a commit setting isSnapshot := true
right away.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With