Skip to content

Commit

Permalink
Enable plugin by default [#5].
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsacha committed Dec 12, 2018
1 parent a0a2cc1 commit 3442402
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@ Add `sbt-imagej` as a dependency in `project/imagej.sbt`:
addSbtPlugin("net.sf.ij-plugins" % "sbt-imagej" % "2.0.1")
```

To use `sbt-imagej` you need to enable it in your project configuration,
if you're using `build.sbt` add this:

```scala
enablePlugins(SbtImageJ)
```
Once added to the project the plugin will be enabled by default.

Now you'll have a new `ijRun` task which will compile your project,
pack your class files and resources in a jar, copy that jar and dependencies to local
Expand Down
3 changes: 1 addition & 2 deletions example/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ libraryDependencies += "net.imagej" % "ij" % "1.52i"

fork := true

// Enable and customize `sbt-imagej` plugin
enablePlugins(SbtImageJ)
// Customize `sbt-imagej` plugin
ijRuntimeSubDir := "sandbox"
ijPluginsSubDir := "ij-plugins"
ijCleanBeforePrepareRun := true
Expand Down
2 changes: 1 addition & 1 deletion example/project/plugin.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"

addSbtPlugin("net.sf.ij-plugins" % "sbt-imagej" % "2.0.1")
addSbtPlugin("net.sf.ij-plugins" % "sbt-imagej" % "2.0.2-SNAPSHOT")
5 changes: 5 additions & 0 deletions src/main/scala/net/ij_plugins/sf/sbt/imagej/SbtImageJ.scala
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ object SbtImageJ extends sbt.AutoPlugin {
)
)


override def trigger = allRequirements

/**
* Run ImageJ; pointing it to created plugins.
*/
Expand All @@ -147,6 +150,7 @@ object SbtImageJ extends sbt.AutoPlugin {
runtimeDir: String,
classpath: Classpath,
taskStreams: TaskStreams) {
// val logger = sbt.Keys.streams.value.log
val logger = taskStreams.log
val userDir = (base / runtimeDir).getCanonicalPath
logger.debug("Run ImageJ with -ijpath " + userDir)
Expand All @@ -165,6 +169,7 @@ object SbtImageJ extends sbt.AutoPlugin {
dependencies: Seq[Attributed[File]],
taskStreams: TaskStreams
): Seq[java.io.File] = {
// val logger = sbt.Keys.streams.value.log
val logger = taskStreams.log
val pluginsDir = base / runtimeDir / "plugins" / pluginsSubDir
logger.debug("Preparing ImageJ plugin directory: " + pluginsDir.getCanonicalPath)
Expand Down

0 comments on commit 3442402

Please sign in to comment.