Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sbt 0.13.15. fix warnings #998

Merged
merged 1 commit into from
Jun 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ git.remoteRepo := "git@github.com:sbt/sbt-native-packager.git"

// scripted test settings
scriptedSettings
scriptedLaunchOpts <+= version apply { v =>
"-Dproject.version=" + v
}
scriptedLaunchOpts += "-Dproject.version=" + version.value

// Release configuration
releasePublishArtifactsAction := PgpKeys.publishSigned.value
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.11
sbt.version=0.13.15
4 changes: 1 addition & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.0.0")
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.0")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")

libraryDependencies <+= (sbtVersion) { sv =>
"org.scala-sbt" % "scripted-plugin" % sv
}
libraryDependencies += "org.scala-sbt" % "scripted-plugin" % sbtVersion.value

// Scripted plugin needs to declare this as a dependency
libraryDependencies += "jline" % "jline" % "2.11"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ object SettingsHelper {
packageTask: TaskKey[File],
extension: String,
classifier: Option[String] = None): Seq[Setting[_]] =
inConfig(config)(Classpaths.publishSettings) ++ inConfig(config)(
inConfig(config)(Classpaths.ivyPublishSettings ++ Classpaths.jvmPublishSettings) ++ inConfig(config)(
Seq(
artifacts := Seq.empty,
packagedArtifacts := Map.empty,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@ object JavaAppPackaging extends AutoPlugin {
}

private def findProjectDependencyArtifacts: Def.Initialize[Task[Seq[Attributed[File]]]] =
(buildDependencies, thisProjectRef, state).apply { (build, thisProject, stateTask) =>
val refs = thisProject +: dependencyProjectRefs(build, thisProject)
Def.task {
val stateTask = state.taskValue
val refs = thisProjectRef.value +: dependencyProjectRefs(buildDependencies.value, thisProjectRef.value)
// Dynamic lookup of dependencies...
val artTasks = refs map { ref =>
extractArtifacts(stateTask, ref)
Expand All @@ -134,7 +135,7 @@ object JavaAppPackaging extends AutoPlugin {
} yield p ++ n.filter(isRuntimeArtifact)
}
allArtifactsTask
}
}.flatMap(identity)

private def extractArtifacts(stateTask: Task[State], ref: ProjectRef): Task[Seq[Attributed[File]]] =
stateTask.flatMap { state =>
Expand Down
7 changes: 4 additions & 3 deletions src/sbt-test/cygwin/java-app-archetype/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@ name := "windows-test"

version := "0.1.0"

TaskKey[Unit]("check-cygwin-script") <<= (stagingDirectory in Universal, name, streams) map { (dir, name, streams) =>
TaskKey[Unit]("check-cygwin-script") := {
val dir = (stagingDirectory in Universal).value
// TODO - FIx our cygwin detection!
val cygwinBash = file("C:\\cygwin\\bin\\bash.exe")
if (!cygwinBash.exists)
sys.error("Unable to find the default cygwin (c:\\cygwin) install for testing.")
else {
val script = dir / "bin" / name
val script = dir / "bin" / name.value
val PathParts = "([\\w])+\\:\\\\(.+)".r
val PathParts(drive, path) = script.getAbsolutePath
val cygdriveScriptPath = "/cygdrive/" + drive.toLowerCase + "/" + path.replaceAll("\\\\", "/")
val pathEnv = "C:\\cygwin\\bin"
val cmd = Seq(cygwinBash.getAbsolutePath, cygdriveScriptPath, "-d")
val result =
Process(cmd, Some(dir), "PATH" -> pathEnv) ! streams.log match {
Process(cmd, Some(dir), "PATH" -> pathEnv) ! streams.value.log match {
case 0 => ()
case n =>
sys.error("Failed to run script: " + cygdriveScriptPath + " error code: " + n)
Expand Down
6 changes: 3 additions & 3 deletions src/sbt-test/debian/daemon-group-gid-deb/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ packageSummary := "Test debian package"
packageDescription := """A fun package description of our software,
with multiple lines."""

TaskKey[Unit]("check-control-files") <<= (target, streams) map { (target, out) =>
val debian = target / "debian-test-0.1.0" / "DEBIAN"
TaskKey[Unit]("check-control-files") := {
val debian = target.value / "debian-test-0.1.0" / "DEBIAN"
val postinst = IO.read(debian / "postinst")
val postrm = IO.read(debian / "postrm")
assert(postinst contains """addGroup daemongroup "25000"""", "postinst misses addgroup for daemongroup: " + postinst)
Expand All @@ -41,6 +41,6 @@ TaskKey[Unit]("check-control-files") <<= (target, streams) map { (target, out) =
!(postinst contains "chown daemonuser:daemongroup /usr/share/debian-test"),
"postinst contains chown /usr/share/app_name: \n" + postinst
)
out.log.success("Successfully tested upstart control files")
streams.value.log.success("Successfully tested upstart control files")
()
}
6 changes: 3 additions & 3 deletions src/sbt-test/debian/daemon-user-deb/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ packageSummary := "Test debian package"
packageDescription := """A fun package description of our software,
with multiple lines."""

TaskKey[Unit]("check-control-files") <<= (target, streams) map { (target, out) =>
val debian = target / "debian-test-0.1.0" / "DEBIAN"
TaskKey[Unit]("check-control-files") := {
val debian = target.value / "debian-test-0.1.0" / "DEBIAN"
val postinst = IO.read(debian / "postinst")
val postrm = IO.read(debian / "postrm")
assert(postinst contains """addGroup daemongroup """"", "postinst misses addgroup for daemongroup: " + postinst)
Expand All @@ -40,6 +40,6 @@ TaskKey[Unit]("check-control-files") <<= (target, streams) map { (target, out) =
!(postinst contains "chown daemonuser:daemongroup /usr/share/debian-test"),
"postinst contains chown /usr/share/app_name: \n" + postinst
)
out.log.success("Successfully tested upstart control files")
streams.value.log.success("Successfully tested upstart control files")
()
}
4 changes: 2 additions & 2 deletions src/sbt-test/debian/daemon-user-shell-deb/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ packageSummary := "Test debian package"
packageDescription := """A fun package description of our software,
with multiple lines."""

TaskKey[Unit]("check-control-files") <<= (target, streams) map { (target, out) =>
val debian = target / "debian-test-0.1.0" / "DEBIAN"
TaskKey[Unit]("check-control-files") := {
val debian = target.value / "debian-test-0.1.0" / "DEBIAN"
val postinst = IO.read(debian / "postinst")
val postrm = IO.read(debian / "postrm")
assert(
Expand Down
6 changes: 3 additions & 3 deletions src/sbt-test/debian/daemon-user-uid-deb/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ packageSummary := "Test debian package"
packageDescription := """A fun package description of our software,
with multiple lines."""

TaskKey[Unit]("check-control-files") <<= (target, streams) map { (target, out) =>
val debian = target / "debian-test-0.1.0" / "DEBIAN"
TaskKey[Unit]("check-control-files") := {
val debian = target.value / "debian-test-0.1.0" / "DEBIAN"
val postinst = IO.read(debian / "postinst")
val postrm = IO.read(debian / "postrm")
assert(postinst contains """addGroup daemongroup """"", "postinst misses addgroup for daemongroup: " + postinst)
Expand All @@ -41,6 +41,6 @@ TaskKey[Unit]("check-control-files") <<= (target, streams) map { (target, out) =
!(postinst contains "chown daemonuser:daemongroup /usr/share/debian-test"),
"postinst contains chown /usr/share/app_name: \n" + postinst
)
out.log.success("Successfully tested upstart control files")
streams.value.log.success("Successfully tested upstart control files")
()
}
7 changes: 4 additions & 3 deletions src/sbt-test/debian/java-app-archetype/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11)

debianPackageRecommends in Debian += "git"

TaskKey[Unit]("check-script") <<= (stagingDirectory in Universal, name, streams) map { (dir, name, streams) =>
val script = dir / "bin" / name
TaskKey[Unit]("check-script") := {
val dir = (stagingDirectory in Universal).value
val script = dir / "bin" / name.value
System.out.synchronized {
System.err.println("---SCRIPT---")
val scriptContents = IO.read(script)
Expand All @@ -27,7 +28,7 @@ TaskKey[Unit]("check-script") <<= (stagingDirectory in Universal, name, streams)
}
val cmd = "bash " + script.getAbsolutePath + " -d"
val result =
Process(cmd) ! streams.log match {
Process(cmd) ! streams.value.log match {
case 0 => ()
case n =>
sys.error("Failed to run script: " + script.getAbsolutePath + " error code: " + n)
Expand Down
8 changes: 4 additions & 4 deletions src/sbt-test/debian/jdeb-conflicts/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ packageDescription := """A fun package description of our software,

debianPackageConflicts in Debian := Seq("debian-test-package")

TaskKey[Unit]("check-conflicts") <<= (target, streams) map { (target, out) =>
val extracted = target / "extracted"
Seq("dpkg-deb", "-R", (target / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).!
TaskKey[Unit]("check-conflicts") := {
val extracted = target.value / "extracted"
Seq("dpkg-deb", "-R", (target.value / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).!

val control = IO.read(extracted / "DEBIAN" / "control")
assert(control.contains("Conflicts:"))

out.log.success("Successfully tested systemV control files")
streams.value.log.success("Successfully tested systemV control files")
()
}
8 changes: 4 additions & 4 deletions src/sbt-test/debian/jdeb-dependencies/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ packageDescription := """A fun package description of our software,

debianPackageDependencies in Debian := Seq()

TaskKey[Unit]("check-dependencies") <<= (target, streams) map { (target, out) =>
val extracted = target / "extracted"
Seq("dpkg-deb", "-R", (target / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).!
TaskKey[Unit]("check-dependencies") := {
val extracted = target.value / "extracted"
Seq("dpkg-deb", "-R", (target.value / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).!

val control = IO.read(extracted / "DEBIAN" / "control")
assert(!control.contains("Depends:"))

out.log.success("Successfully tested systemV control files")
streams.value.log.success("Successfully tested systemV control files")
()
}
6 changes: 3 additions & 3 deletions src/sbt-test/debian/jdeb-dir-mappings/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ linuxPackageMappings in Debian += packageDirectoryAndContentsMapping(
(baseDirectory.value / "src" / "resources" / "empty") -> "/var/empty"
)

TaskKey[Unit]("check-dir-mappings") <<= (target, streams) map { (target, out) =>
TaskKey[Unit]("check-dir-mappings") := {
// val tmpDir = java.nio.file.Files.createTempDirectory("jdeb")
val extracted = file("/tmp/jdeb" + System.currentTimeMillis().toString)
Seq("dpkg-deb", "-R", (target / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).!
Seq("dpkg-deb", "-R", (target.value / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).!
assert((extracted / "usr/share/conf/application.conf").exists(), "File application.conf not exists")
assert((extracted / "usr/share/conf/log4j.properties").exists(), "File log4j.properties not exists")
assert((extracted / "var/empty").exists(), "Empty dir not exists")
extracted.delete()
out.log.success("Successfully tested control script")
streams.value.log.success("Successfully tested control script")
()
}
8 changes: 4 additions & 4 deletions src/sbt-test/debian/jdeb-provides/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ packageDescription := """A fun package description of our software,

debianPackageProvides in Debian := Seq("debian-test-package")

TaskKey[Unit]("check-provides") <<= (target, streams) map { (target, out) =>
val extracted = target / "extracted"
Seq("dpkg-deb", "-R", (target / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).!
TaskKey[Unit]("check-provides") := {
val extracted = target.value / "extracted"
Seq("dpkg-deb", "-R", (target.value / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).!

val control = IO.read(extracted / "DEBIAN" / "control")
assert(control.contains("Provides:"))

out.log.success("Successfully tested systemV control files")
streams.value.log.success("Successfully tested systemV control files")
()
}
8 changes: 4 additions & 4 deletions src/sbt-test/debian/jdeb-script-replacements/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11)

debianPackageRecommends in Debian += "git"

TaskKey[Unit]("check-control-files") <<= (target, streams) map { (target, out) =>
TaskKey[Unit]("check-control-files") := {
val header = "#!/bin/sh"
val extracted = target / "extracted"
val extracted = target.value / "extracted"
println(extracted.getAbsolutePath)
Seq("dpkg-deb", "-R", (target / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).!
Seq("dpkg-deb", "-R", (target.value / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).!
val preinst = extracted / "DEBIAN/preinst"
val postinst = extracted / "DEBIAN/postinst"
val prerm = extracted / "DEBIAN/prerm"
Expand All @@ -32,6 +32,6 @@ TaskKey[Unit]("check-control-files") <<= (target, streams) map { (target, out) =
"script contains more than one header line:\n" + script + "\n" + content
)
}
out.log.success("Successfully tested systemV control files")
streams.value.log.success("Successfully tested systemV control files")
()
}
26 changes: 13 additions & 13 deletions src/sbt-test/debian/log-directory/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ packageDescription := """A fun package description of our software,

defaultLinuxLogsLocation := "/non-standard/log"

InputKey[Unit]("check-softlink") <<= inputTask { (argTask: TaskKey[Seq[String]]) =>
(argTask) map { (args: Seq[String]) =>
assert(args.size >= 2, "Usage: check-softlink link to target")
val link = args(0)
val target = args(args.size - 1)
val absolutePath = ("readlink -m " + link).!!.trim
assert(link != absolutePath, "Expected symbolic link '" + link + "' does not exist")
assert(
target == absolutePath,
"Expected symbolic link '" + link + "' to point to '" +
target + "', but instead it's '" + absolutePath + "'"
)
}
InputKey[Unit]("check-softlink") := {
import complete.DefaultParsers._
val args = spaceDelimited("<args>").parsed
assert(args.size >= 2, "Usage: check-softlink link to target")
val link = args(0)
val target = args(args.size - 1)
val absolutePath = ("readlink -m " + link).!!.trim
assert(link != absolutePath, "Expected symbolic link '" + link + "' does not exist")
assert(
target == absolutePath,
"Expected symbolic link '" + link + "' to point to '" +
target + "', but instead it's '" + absolutePath + "'"
)
}
4 changes: 2 additions & 2 deletions src/sbt-test/debian/override-control-files/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ maintainerScripts in Debian := maintainerScriptsFromDirectory(
Seq(Preinst, Postinst, Prerm, Postrm)
)

TaskKey[Unit]("check-control-files") <<= (target, streams) map { (target, out) =>
val debian = target / "debian-test-0.1.0" / "DEBIAN"
TaskKey[Unit]("check-control-files") := {
val debian = target.value / "debian-test-0.1.0" / "DEBIAN"
val postinst = IO.read(debian / "postinst")
val preinst = IO.read(debian / "preinst")
val postrm = IO.read(debian / "postrm")
Expand Down
6 changes: 3 additions & 3 deletions src/sbt-test/debian/override-etc-default/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ packageSummary := "Test debian package"
packageDescription := """A fun package description of our software,
with multiple lines."""

TaskKey[Unit]("check-etc-default") <<= (target, streams) map { (target, out) =>
val extracted = target / "tmp" / "extracted-package"
TaskKey[Unit]("check-etc-default") := {
val extracted = target.value / "tmp" / "extracted-package"
extracted.mkdirs()
Seq("dpkg-deb", "-R", (target / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).!
Seq("dpkg-deb", "-R", (target.value / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).!

val script = IO.read(extracted / "etc" / "default" / "debian-test")
assert(
Expand Down
6 changes: 3 additions & 3 deletions src/sbt-test/debian/override-loader-functions/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ packageSummary := "Test debian package"
packageDescription := """A fun package description of our software,
with multiple lines."""

TaskKey[Unit]("check-loader-functions") <<= (target, streams) map { (target, out) =>
val extracted = target / "tmp" / "extracted-package"
TaskKey[Unit]("check-loader-functions") := {
val extracted = target.value / "tmp" / "extracted-package"
extracted.mkdirs()
Seq("dpkg-deb", "-e", (target / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).!
Seq("dpkg-deb", "-e", (target.value / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).!

val script = IO.read(extracted / "postinst")

Expand Down
6 changes: 3 additions & 3 deletions src/sbt-test/debian/override-start-script-systemd/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ packageSummary := "Test debian package"
packageDescription := """A fun package description of our software,
with multiple lines."""

TaskKey[Unit]("check-startup-script") <<= (target, streams) map { (target, out) =>
val extracted = target / "tmp" / "extracted-package"
TaskKey[Unit]("check-startup-script") := {
val extracted = target.value / "tmp" / "extracted-package"
extracted.mkdirs()
Seq("dpkg-deb", "-R", (target / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).!
Seq("dpkg-deb", "-R", (target.value / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).!

val script = IO.read(extracted / "lib" / "systemd" / "system" / "debian-test.service")
assert(script.startsWith("# right systemd template"), s"override script wasn't picked, script is\n$script")
Expand Down
6 changes: 3 additions & 3 deletions src/sbt-test/debian/override-start-script-systemv/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ packageSummary := "Test debian package"
packageDescription := """A fun package description of our software,
with multiple lines."""

TaskKey[Unit]("check-startup-script") <<= (target, streams) map { (target, out) =>
val extracted = target / "tmp" / "extracted-package"
TaskKey[Unit]("check-startup-script") := {
val extracted = target.value / "tmp" / "extracted-package"
extracted.mkdirs()
Seq("dpkg-deb", "-R", (target / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).!
Seq("dpkg-deb", "-R", (target.value / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).!

val script = IO.read(extracted / "etc" / "init.d" / "debian-test")
assert(script.startsWith("# right systemv template"), s"override script wasn't picked, script is\n$script")
Expand Down
6 changes: 3 additions & 3 deletions src/sbt-test/debian/override-start-script-upstart/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ packageSummary := "Test debian package"
packageDescription := """A fun package description of our software,
with multiple lines."""

TaskKey[Unit]("check-startup-script") <<= (target, streams) map { (target, out) =>
val extracted = target / "tmp" / "extracted-package"
TaskKey[Unit]("check-startup-script") := {
val extracted = target.value / "tmp" / "extracted-package"
extracted.mkdirs()
Seq("dpkg-deb", "-R", (target / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).!
Seq("dpkg-deb", "-R", (target.value / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).!

val script = IO.read(extracted / "etc" / "init" / "debian-test.conf")
assert(script.startsWith("# right upstart template"), s"override script wasn't picked, script is\n$script")
Expand Down
Loading