Skip to content

Commit

Permalink
Support SBT 1.0 #5
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsacha committed Aug 16, 2017
1 parent b760c17 commit 5d594da
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Usage
Import `sbt-install4j` plugin to use `install4j` command.

```scala
addSbtPlugin("com.github.jpsacha" % "sbt-install4j" % "1.1.0")
addSbtPlugin("com.github.jpsacha" % "sbt-install4j" % "1.1.1")
```

### build.sbt
Expand Down
10 changes: 6 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name := "sbt-install4j"
organization := "com.github.jpsacha"
version := "1.1.0"
version := "1.1.1"

homepage := Some(url("http://github.com/jpsacha/sbt-install4j"))
organizationHomepage := Some(url("http://ij-plugins.sf.net"))
Expand All @@ -22,13 +22,13 @@ publishArtifact in(Test, packageSrc) := false

//publishMavenStyle := false

publishTo <<= version {
publishTo := version {
version: String =>
if (version.contains("-SNAPSHOT"))
Some("Sonatype Nexus Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots")
else
Some("Sonatype Nexus Releases" at "https://oss.sonatype.org/service/local/staging/deploy/maven2")
}
}.value

pomExtra :=
<scm>
Expand All @@ -41,4 +41,6 @@ pomExtra :=
<name>Jarek Sacha</name>
<url>https://github.com/jpsacha</url>
</developer>
</developers>
</developers>

shellPrompt in ThisBuild := { state => "sbt:"+Project.extract(state).currentRef.project + "> " }
4 changes: 2 additions & 2 deletions example/build.sbt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name := "sbt-install4j-example"
organization := "ij-plugins.sf.net"
version := "0.1.0"
version := "1.1.1"

scalaVersion := "2.11.8"
scalaVersion := "2.12.3"

// Set the prompt (for this build) to include the project id.
shellPrompt in ThisBuild := { state => "sbt:"+Project.extract(state).currentRef.project + "> " }
Expand Down
2 changes: 1 addition & 1 deletion example/project/build.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sbt.version=0.13.11
sbt.version=0.13.16

2 changes: 1 addition & 1 deletion example/project/plugin-install4j.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// [[https://github.com/jpsacha/sbt-install4j]]
addSbtPlugin("com.github.jpsacha" % "sbt-install4j" % "1.1.0-SNAPSHOT")
addSbtPlugin("com.github.jpsacha" % "sbt-install4j" % "1.1.1")
1 change: 1 addition & 0 deletions notes/1.1.1.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Support SBT 1.0 #5
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
sbt.version=0.13.11
sbt.version=0.13.16

42 changes: 29 additions & 13 deletions src/main/scala/net/ij_plugins/sf/sbt/install4j/SBTInstall4J.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,51 @@ import java.io.{File, IOException}
import sbt.Keys._
import sbt._

import scala.sys.process.Process

/** SBT plugin for building installers with Install4J. */
object SBTInstall4J extends sbt.AutoPlugin {

object autoImport {
lazy val install4j = TaskKey[Unit]("install4j",
lazy val install4j: TaskKey[Unit] = TaskKey[Unit](
"install4j",
"Builds Install4J project.")

lazy val install4jCopyDependedJars = TaskKey[File]("install4jCopyDependedJars",
lazy val install4jCopyDependedJars: TaskKey[File] = TaskKey[File](
"install4jCopyDependedJars",
"Copies project dependencies to directory `install4jDependedJarsDir`.")

lazy val install4jCopyDependedJarsExclusions = SettingKey[Seq[String]]("install4jCopyDependedJarsExclusions",
lazy val install4jCopyDependedJarsExclusions: SettingKey[Seq[String]] = SettingKey[Seq[String]](
"install4jCopyDependedJarsExclusions",
"List of regex expressions that match files that will be excluded from copying.")

lazy val install4jCopyDependedJarsEnabled = SettingKey[Boolean]("install4jCopyDependedJarsEnabled",
lazy val install4jCopyDependedJarsEnabled: SettingKey[Boolean] = SettingKey[Boolean](
"install4jCopyDependedJarsEnabled",
"if `true` dependent jars will be copies, if `false` they will be not.")

lazy val install4jHomeDir = SettingKey[File]("install4jHomeDir",
lazy val install4jHomeDir: SettingKey[File] = SettingKey[File](
"install4jHomeDir",
"Install4J installation directory. It assumes that Install4J compiler is in subdirectory `bin/install4jc.exe`.")

lazy val install4jProjectFile = SettingKey[String]("install4jProjectFile",
lazy val install4jProjectFile: SettingKey[String] = SettingKey[String](
"install4jProjectFile",
"The install4j project file that should be build.")

lazy val install4jDependedJarsDir = SettingKey[String]("install4jDependedJarsDir",
lazy val install4jDependedJarsDir: SettingKey[String] = SettingKey[String](
"install4jDependedJarsDir",
"Location where dependent jars will be copied.")

lazy val install4jVerbose = SettingKey[Boolean]("install4jVerbose",
lazy val install4jVerbose: SettingKey[Boolean] = SettingKey[Boolean](
"install4jVerbose",
"Enables verbose mode.")

lazy val install4jRelease = SettingKey[String]("install4jRelease",
lazy val install4jRelease: SettingKey[String] = SettingKey[String](
"install4jRelease",
"Override the application version. " +
"Version number components can be alphanumeric and should be separated by dots, dashes or underscores. ")

lazy val install4jCompilerVariables = SettingKey[Map[String, String]]("install4jCompilerVariables",
lazy val install4jCompilerVariables: SettingKey[Map[String, String]] = SettingKey[Map[String, String]](
"install4jCompilerVariables",
"Override a compiler variable with a different value. " +
"In the map, the `key` is variable's name, the `value` is variable's value.")
}
Expand Down Expand Up @@ -88,11 +100,15 @@ object SBTInstall4J extends sbt.AutoPlugin {

install4jCopyDependedJarsExclusions := Seq(
// Source archives
"""\S*-src\.\S*""", """\S*-sources\.\S*""", """\S*_src_\S*""",
"""\S*-src\.\S*""",
"""\S*-sources\.\S*""",
"""\S*_src_\S*""",
// Javadoc
"""\S*-javadoc\.\S*""", """\S*_javadoc_\S*""",
"""\S*-javadoc\.\S*""",
"""\S*_javadoc_\S*""",
// Scaladoc
"""\S*-scaladoc\.\S*""", """\S*_scaladoc_\S*"""
"""\S*-scaladoc\.\S*""",
"""\S*_scaladoc_\S*"""
),

install4jCopyDependedJarsEnabled := true,
Expand Down

0 comments on commit 5d594da

Please sign in to comment.