From 2853b986498dd7db1bfe12ea277802fbf11bed99 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Sat, 17 Jun 2017 12:33:42 +0200 Subject: [PATCH 01/47] Cross build with sbt 1.0 --- .travis.yml | 25 +-- build.sbt | 88 ++++++++- project/build.properties | 2 +- .../com/typesafe/sbt/packager/Compat.scala | 38 ++++ .../sbt/packager/MappingsHelper.scala | 14 +- .../sbt/packager/SettingsHelper.scala | 61 ++++++ .../com/typesafe/sbt/packager/Compat.scala | 35 ++++ .../sbt/packager/MappingsHelper.scala | 84 +++++++++ .../sbt/packager/SettingsHelper.scala | 62 ++++++ .../sbt/packager/SettingsHelper.scala | 62 ------ .../com/typesafe/sbt/packager/Stager.scala | 2 + .../archetypes/JavaAppPackaging.scala | 35 ++-- .../debian/DebianNativePackaging.scala | 9 +- .../sbt/packager/debian/DebianPlugin.scala | 50 ++--- .../sbt/packager/docker/DockerPlugin.scala | 178 +++++++++--------- .../jdkpackager/JDKPackagerAntHelper.scala | 2 +- .../sbt/packager/linux/LinuxMappingDSL.scala | 4 +- .../packager/linux/LinuxPackageMapping.scala | 8 +- .../sbt/packager/linux/LinuxPlugin.scala | 2 +- .../typesafe/sbt/packager/rpm/RpmHelper.scala | 14 +- .../typesafe/sbt/packager/rpm/RpmPlugin.scala | 5 +- .../sbt/packager/universal/Archives.scala | 24 ++- .../packager/universal/UniversalPlugin.scala | 34 ++-- .../sbt/packager/universal/ZipHelper.scala | 2 +- .../sbt/packager/windows/WindowsPlugin.scala | 29 +-- 25 files changed, 585 insertions(+), 284 deletions(-) create mode 100644 src/main/scala-sbt-0.13/com/typesafe/sbt/packager/Compat.scala rename src/main/{scala => scala-sbt-0.13}/com/typesafe/sbt/packager/MappingsHelper.scala (90%) create mode 100644 src/main/scala-sbt-0.13/com/typesafe/sbt/packager/SettingsHelper.scala create mode 100644 src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/Compat.scala create mode 100644 src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/MappingsHelper.scala create mode 100644 src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/SettingsHelper.scala delete mode 100644 src/main/scala/com/typesafe/sbt/packager/SettingsHelper.scala diff --git a/.travis.yml b/.travis.yml index b37d38b68..800f6e835 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,35 +1,28 @@ language: java os: + - linux - osx env: - - SCALA_VERSION=2.10.5 + - SBT_VERSION_CMD="++2.10.6" + - SBT_VERSION_CMD="++2.12.2 ^^1.0.0-M6" +jdk: oraclejdk8 before_install: - if [[ "$TRAVIS_OS_NAME" = "osx" ]]; then brew update; brew install xz; fi script: - - ./sbt ++$SCALA_VERSION --warn update compile test:compile - - ./sbt ++$SCALA_VERSION test "scripted universal/* jar/* bash/* ash/*" - - if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then - ./sbt ++$SCALA_VERSION "scripted rpm/* debian/* docker/staging docker/entrypoint docker/ports docker/volumes"; + - if [[ "$TRAVIS_OS_NAME" = "osx" ]]; then + ./sbt "SBT_VERSION_CMD validateOSX" ; fi - - if [[ "$TRAVIS_JDK_VERSION" = "oraclejdk8" ]]; then - ./sbt ++$SCALA_VERSION "scripted jdkpackager/test-package-minimal jdkpackager/test-package-mappings"; + - if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then + ./sbt "SBT_VERSION_CMD validateLinux" ; fi -notifications: - email: - - qbranch@typesafe.com + addons: apt: packages: - rpm -matrix: - include: - - os: linux - jdk: openjdk7 - - os: linux - jdk: oraclejdk8 sudo: false cache: diff --git a/build.sbt b/build.sbt index 5f18cdf59..4c201e4c7 100644 --- a/build.sbt +++ b/build.sbt @@ -3,8 +3,13 @@ sbtPlugin := true name := "sbt-native-packager" organization := "com.typesafe.sbt" -scalaVersion in Global := "2.10.5" -scalacOptions in Compile ++= Seq("-deprecation", "-target:jvm-1.7") +scalaVersion in Global := "2.10.6" + +// crossBuildingSettings +crossSbtVersions := Vector("0.13.15", "1.0.0-M6") + +scalacOptions in Compile ++= Seq("-deprecation") +javacOptions ++= Seq("-source", "1.8", "-target", "1.8") libraryDependencies ++= Seq( "org.apache.commons" % "commons-compress" % "1.4.1", @@ -16,6 +21,27 @@ libraryDependencies ++= Seq( "org.scalatest" %% "scalatest" % "3.0.3" % "test" ) +// sbt dependend libraries +libraryDependencies ++= { + sbtVersion.value match { + case v if v.startsWith("1.") => Seq("org.scala-sbt" %% "io" % "1.0.0-M11") + case _ => Nil + } +} + +// scala version depended libraries +libraryDependencies ++= { + scalaBinaryVersion.value match { + case "2.10" => Nil + case _ => + Seq( + "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.6", + "org.scala-lang.modules" %% "scala-xml" % "1.0.6" + ) + } + +} + // configure github page enablePlugins(SphinxPlugin, SiteScaladocPlugin) @@ -26,7 +52,52 @@ git.remoteRepo := "git@github.com:sbt/sbt-native-packager.git" scriptedSettings scriptedLaunchOpts += "-Dproject.version=" + version.value -// Release configuration +// Temporary fix for issue sbt/sbt/issues/3245 +scripted := { + val args = ScriptedPlugin + .asInstanceOf[{ + def scriptedParser(f: File): complete.Parser[Seq[String]] + } + ] + .scriptedParser(sbtTestDirectory.value) + .parsed + val prereq: Unit = scriptedDependencies.value + try { + if ((sbtVersion in pluginCrossBuild).value == "1.0.0-M6") { + ScriptedPlugin.scriptedTests.value + .asInstanceOf[{ + def run(x1: File, x2: Boolean, x3: Array[String], x4: File, x5: Array[String], x6: java.util.List[File]) + : Unit + } + ] + .run( + sbtTestDirectory.value, + scriptedBufferLog.value, + args.toArray, + sbtLauncher.value, + scriptedLaunchOpts.value.toArray, + new java.util.ArrayList() + ) + } else { + ScriptedPlugin.scriptedTests.value + .asInstanceOf[{ + def run(x1: File, x2: Boolean, x3: Array[String], x4: File, x5: Array[String]): Unit + } + ] + .run( + sbtTestDirectory.value, + scriptedBufferLog.value, + args.toArray, + sbtLauncher.value, + scriptedLaunchOpts.value.toArray + ) + } + } catch { + case e: java.lang.reflect.InvocationTargetException => throw e.getCause + } +} + +// Release configurationr releasePublishArtifactsAction := PgpKeys.publishSigned.value publishMavenStyle := false @@ -54,4 +125,15 @@ bintrayRepository := "sbt-plugin-releases" scalafmtConfig := Some(file(".scalafmt.conf")) // ci commands +addCommandAlias( + "validate", + "; update ; test ; scripted jdkpackager/test-package-minimal jdkpackager/test-package-mappings" +) +addCommandAlias("validateUnix", "scripted universal/* jar/* bash/* ash/*") + +addCommandAlias("validateOSX", "; validate ; validateUnix") +addCommandAlias( + "validateLinux", + "; validate ; validateUnix ; scripted rpm/* debian/* docker/staging docker/entrypoint docker/ports docker/volumes" +) addCommandAlias("validateWindows", ";test-only * -- -n windows;scripted universal/dist universal/stage windows/*") diff --git a/project/build.properties b/project/build.properties index 64317fdae..d9654cdc2 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.15 +sbt.version=0.13.16-M1 diff --git a/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/Compat.scala b/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/Compat.scala new file mode 100644 index 000000000..9660334c3 --- /dev/null +++ b/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/Compat.scala @@ -0,0 +1,38 @@ +package com.typesafe.sbt.packager + +import sbt.{BufferedLogger, FullLogger, Logger} + +import scala.sys.process.ProcessLogger + +object Compat { + object io + + /** + * Used in: + * + * - [[com.typesafe.sbt.packager.windows.WindowsPlugin]] + * - [[com.typesafe.sbt.packager.rpm.RpmHelper]] + * - [[com.typesafe.sbt.packager.docker.DockerPlugin]] + * - [[com.typesafe.sbt.packager.debian.DebianNativePackaging]] + * - [[com.typesafe.sbt.packager.rpm.RpmPlugin]] + * + * @param log + * @return turns a Logger into a ProcessLogger + */ + implicit def log2ProcessLogger(log: Logger): sys.process.ProcessLogger = + new BufferedLogger(new FullLogger(log)) with sys.process.ProcessLogger { + def err(s: => String): Unit = error(s) + def out(s: => String): Unit = info(s) + } + + /** + * Used in + * + * - [[com.typesafe.sbt.packager.docker.DockerPlugin]] + * + * @param logger The sbt.ProcessLogger that should be wrapped + * @return A scala ProcessLogger + */ + implicit def sbtProcessLogger2ScalaProcessLogger(logger: sbt.ProcessLogger): sys.process.ProcessLogger = + ProcessLogger(msg => logger.info(msg), err => logger.error(err)) +} diff --git a/src/main/scala/com/typesafe/sbt/packager/MappingsHelper.scala b/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/MappingsHelper.scala similarity index 90% rename from src/main/scala/com/typesafe/sbt/packager/MappingsHelper.scala rename to src/main/scala-sbt-0.13/com/typesafe/sbt/packager/MappingsHelper.scala index ca5b69d6c..fd38a91ba 100644 --- a/src/main/scala/com/typesafe/sbt/packager/MappingsHelper.scala +++ b/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/MappingsHelper.scala @@ -1,8 +1,6 @@ -package com.typesafe.sbt -package packager +package com.typesafe.sbt.packager import sbt._ -import com.typesafe.sbt.packager.archetypes.JavaAppPackaging /** A set of helper methods to simplify the writing of mappings */ object MappingsHelper { @@ -104,13 +102,13 @@ object MappingsHelper { * @param includeOnNoArtifact default is false. When there's no Artifact meta data remove it */ def fromClasspath(entries: Seq[Attributed[File]], - target: String, - includeArtifact: Artifact => Boolean, - includeOnNoArtifact: Boolean = false): Seq[(File, String)] = + target: String, + includeArtifact: Artifact => Boolean, + includeOnNoArtifact: Boolean = false): Seq[(File, String)] = entries.filter(attr => attr.get(sbt.Keys.artifact.key) map includeArtifact getOrElse includeOnNoArtifact).map { attribute => - val file = attribute.data - file -> s"$target/${file.getName}" + val file = attribute.data + file -> s"$target/${file.getName}" } } diff --git a/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/SettingsHelper.scala b/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/SettingsHelper.scala new file mode 100644 index 000000000..7043caefb --- /dev/null +++ b/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/SettingsHelper.scala @@ -0,0 +1,61 @@ +package com.typesafe.sbt.packager + +import sbt.Keys._ +import sbt._ + +object SettingsHelper { + + def addPackage(config: Configuration, + packageTask: TaskKey[File], + extension: String, + classifier: Option[String] = None): Seq[Setting[_]] = + inConfig(config)( + addArtifact( + name apply (Artifact( + _, + extension, + extension, + classifier = classifier, + configurations = Iterable.empty, + url = None, + extraAttributes = Map.empty + )), + packageTask + ) + ) + + def makeDeploymentSettings(config: Configuration, + packageTask: TaskKey[File], + extension: String, + classifier: Option[String] = None): Seq[Setting[_]] = + inConfig(config)(Classpaths.ivyPublishSettings ++ Classpaths.jvmPublishSettings) ++ inConfig(config)( + Seq( + artifacts := Seq.empty, + packagedArtifacts := Map.empty, + projectID := ModuleID(organization.value, name.value, version.value), + moduleSettings := InlineConfiguration(projectID.value, projectInfo.value, Seq.empty), + ivyModule := { + val ivy = ivySbt.value + new ivy.Module(moduleSettings.value) + }, + deliverLocalConfiguration := Classpaths.deliverConfig(crossTarget.value, logging = ivyLoggingLevel.value), + deliverConfiguration := deliverLocalConfiguration.value, + publishConfiguration := new PublishConfiguration( + ivyFile = None, + resolverName = Classpaths.getPublishTo(publishTo.value).name, + artifacts = packagedArtifacts.value, + checksums = checksums.value, + logging = UpdateLogging.DownloadOnly, + overwrite = isSnapshot.value + ), + publishLocalConfiguration := new PublishConfiguration( + ivyFile = None, + resolverName = "local", + artifacts = packagedArtifacts.value, + checksums = checksums.value, + logging = UpdateLogging.DownloadOnly, + overwrite = isSnapshot.value + ) + ) + ) ++ addPackage(config, packageTask, extension, classifier) +} diff --git a/src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/Compat.scala b/src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/Compat.scala new file mode 100644 index 000000000..cb7cb5bfa --- /dev/null +++ b/src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/Compat.scala @@ -0,0 +1,35 @@ +package com.typesafe.sbt.packager + +import sbt.{PathFinder, librarymanagement => lm} +import sbt.internal.{librarymanagement => ilm, BuildDependencies => InternalBuildDependencies} +import sbt.util.CacheStore + +object Compat { + val IvyActions = ilm.IvyActions + type PublishConfiguration = ilm.PublishConfiguration + type IvySbt = ilm.IvySbt + type IvyScala = lm.IvyScala + type UpdateConfiguration = lm.UpdateConfiguration + type InlineConfiguration = ilm.InlineConfiguration + val InlineConfiguration = ilm.InlineConfiguration + + /** + * Used in + * - [[com.typesafe.sbt.packager.archetypes.JavaAppPackaging]] + */ + type BuildDependencies = InternalBuildDependencies + + /** + * Used in + * - [[com.typesafe.sbt.packager.docker.DockerPlugin]] + */ + type ProcessLogger = sys.process.ProcessLogger + + /** + * Used in + * - [[com.typesafe.sbt.packager.Stager]] + * @param file + * @return a CacheStore + */ + implicit def fileToCacheStore(file: java.io.File): CacheStore = CacheStore(file) +} diff --git a/src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/MappingsHelper.scala b/src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/MappingsHelper.scala new file mode 100644 index 000000000..afb0ee012 --- /dev/null +++ b/src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/MappingsHelper.scala @@ -0,0 +1,84 @@ +package com.typesafe.sbt.packager + +import sbt._ +import sbt.io._ + +/** A set of helper methods to simplify the writing of mappings */ +object MappingsHelper extends Mapper { + + /** + * It lightens the build file if one wants to give a string instead of file. + * + * @example + * {{{ + * mappings in Universal ++= directory("extra") + * }}} + * + * @param sourceDir + * @return mappings + */ + def directory(sourceDir: String): Seq[(File, String)] = + directory(file(sourceDir)) + + /** + * It lightens the build file if one wants to give a string instead of file. + * + * @example + * {{{ + * mappings in Universal ++= sourceDir("extra") + * }}} + * + * @param sourceDir as string representation + * @return mappings + */ + def contentOf(sourceDir: String): Seq[(File, String)] = + contentOf(file(sourceDir)) + + /** + * Create mappings from your classpath. For example if you want to add additional + * dependencies, like test or model. + * + * + * @example Add all test artifacts to a separated test folder + * {{{ + * mappings in Universal ++= fromClasspath((managedClasspath in Test).value, target = "test") + * }}} + * + * @param entries + * @param target + * @return a list of mappings + */ + def fromClasspath(entries: Seq[Attributed[File]], target: String): Seq[(File, String)] = + fromClasspath(entries, target, _ => true) + + /** + * Create mappings from your classpath. For example if you want to add additional + * dependencies, like test or model. You can also filter the artifacts that should + * be mapped to mappings. + * + * @example Filter all osgi bundles + * {{{ + * mappings in Universal ++= fromClasspath( + * (managedClasspath in Runtime).value, + * "osgi", + * artifact => artifact.`type` == "bundle" + * ) + * }}} + * + * + * @param entries from where mappings should be created from + * @param target folder, e.g. `model`. Must not end with a slash + * @param includeArtifact function to determine if an artifact should result in a mapping + * @param includeOnNoArtifact default is false. When there's no Artifact meta data remove it + */ + def fromClasspath(entries: Seq[Attributed[File]], + target: String, + includeArtifact: Artifact => Boolean, + includeOnNoArtifact: Boolean = false): Seq[(File, String)] = + entries.filter(attr => attr.get(sbt.Keys.artifact.key) map includeArtifact getOrElse includeOnNoArtifact).map { + attribute => + val file = attribute.data + file -> s"$target/${file.getName}" + } + +} diff --git a/src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/SettingsHelper.scala b/src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/SettingsHelper.scala new file mode 100644 index 000000000..469b045e2 --- /dev/null +++ b/src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/SettingsHelper.scala @@ -0,0 +1,62 @@ +package com.typesafe.sbt.packager + +import sbt.Keys._ +import sbt._ +import com.typesafe.sbt.packager.Compat._ + +object SettingsHelper { + + def addPackage(config: Configuration, + packageTask: TaskKey[File], + extension: String, + classifier: Option[String] = None): Seq[Setting[_]] = + inConfig(config)( + addArtifact( + name apply (Artifact( + _, + extension, + extension, + classifier = classifier, + configurations = Vector.empty, + url = None + )), + packageTask + ) + ) + + def makeDeploymentSettings(config: Configuration, + packageTask: TaskKey[File], + extension: String, + classifier: Option[String] = None): Seq[Setting[_]] = + inConfig(config)(Classpaths.ivyPublishSettings ++ Classpaths.jvmPublishSettings) ++ inConfig(config)( + Seq( + artifacts := Seq.empty, + packagedArtifacts := Map.empty, + projectID := ModuleID(organization.value, name.value, version.value), + // TODO find out why we have this InlineConfiguration here + moduleSettings := InlineConfiguration(true, ivyScala.value, projectID.value, projectInfo.value, Vector.empty), + ivyModule := { + val ivy = ivySbt.value + new ivy.Module(moduleSettings.value) + }, + deliverLocalConfiguration := Classpaths.deliverConfig(crossTarget.value, logging = ivyLoggingLevel.value), + deliverConfiguration := deliverLocalConfiguration.value, + publishConfiguration := new PublishConfiguration( + ivyFile = None, + resolverName = Classpaths.getPublishTo(publishTo.value).name, + artifacts = packagedArtifacts.value, + checksums = checksums.value.toVector, + logging = UpdateLogging.DownloadOnly, + overwrite = isSnapshot.value + ), + publishLocalConfiguration := new PublishConfiguration( + ivyFile = None, + resolverName = "local", + artifacts = packagedArtifacts.value, + checksums = checksums.value.toVector, + logging = UpdateLogging.DownloadOnly, + overwrite = isSnapshot.value + ) + ) + ) ++ addPackage(config, packageTask, extension, classifier) +} diff --git a/src/main/scala/com/typesafe/sbt/packager/SettingsHelper.scala b/src/main/scala/com/typesafe/sbt/packager/SettingsHelper.scala deleted file mode 100644 index ba15bc15d..000000000 --- a/src/main/scala/com/typesafe/sbt/packager/SettingsHelper.scala +++ /dev/null @@ -1,62 +0,0 @@ -package com.typesafe.sbt -package packager - -import sbt._ -import sbt.Keys._ - -object SettingsHelper { - - def addPackage(config: Configuration, - packageTask: TaskKey[File], - extension: String, - classifier: Option[String] = None): Seq[Setting[_]] = - inConfig(config)( - addArtifact( - name apply (Artifact( - _, - extension, - extension, - classifier = classifier, - configurations = Iterable.empty, - url = None, - extraAttributes = Map.empty - )), - packageTask - ) - ) - - def makeDeploymentSettings(config: Configuration, - packageTask: TaskKey[File], - extension: String, - classifier: Option[String] = None): Seq[Setting[_]] = - inConfig(config)(Classpaths.ivyPublishSettings ++ Classpaths.jvmPublishSettings) ++ inConfig(config)( - Seq( - artifacts := Seq.empty, - packagedArtifacts := Map.empty, - projectID := ModuleID(organization.value, name.value, version.value), - moduleSettings := InlineConfiguration(projectID.value, projectInfo.value, Seq.empty), - ivyModule := { - val ivy = ivySbt.value - new ivy.Module(moduleSettings.value) - }, - deliverLocalConfiguration := Classpaths.deliverConfig(crossTarget.value, logging = ivyLoggingLevel.value), - deliverConfiguration := deliverLocalConfiguration.value, - publishConfiguration := new PublishConfiguration( - ivyFile = None, - resolverName = Classpaths.getPublishTo(publishTo.value).name, - artifacts = packagedArtifacts.value, - checksums = checksums.value, - logging = UpdateLogging.DownloadOnly, - overwrite = isSnapshot.value - ), - publishLocalConfiguration := new PublishConfiguration( - ivyFile = None, - resolverName = "local", - artifacts = packagedArtifacts.value, - checksums = checksums.value, - logging = UpdateLogging.DownloadOnly, - overwrite = isSnapshot.value - ) - ) - ) ++ addPackage(config, packageTask, extension, classifier) -} diff --git a/src/main/scala/com/typesafe/sbt/packager/Stager.scala b/src/main/scala/com/typesafe/sbt/packager/Stager.scala index c4fbd2c67..b909951cc 100644 --- a/src/main/scala/com/typesafe/sbt/packager/Stager.scala +++ b/src/main/scala/com/typesafe/sbt/packager/Stager.scala @@ -4,6 +4,8 @@ import sbt._ import sbt.Keys.TaskStreams import java.io.File +import com.typesafe.sbt.packager.Compat._ + object Stager { /** diff --git a/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaAppPackaging.scala b/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaAppPackaging.scala index db716d3c1..1cc134e35 100644 --- a/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaAppPackaging.scala +++ b/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaAppPackaging.scala @@ -7,6 +7,7 @@ import com.typesafe.sbt.packager._ import com.typesafe.sbt.packager.Keys.packageName import com.typesafe.sbt.packager.linux.{LinuxFileMetaData, LinuxPackageMapping} import com.typesafe.sbt.packager.linux.LinuxPlugin.autoImport.{defaultLinuxInstallLocation, linuxPackageMappings} +import com.typesafe.sbt.packager.Compat._ /** * == Java Application == @@ -109,7 +110,7 @@ object JavaAppPackaging extends AutoPlugin { } // Here we grab the dependencies... - private def dependencyProjectRefs(build: sbt.BuildDependencies, thisProject: ProjectRef): Seq[ProjectRef] = + private def dependencyProjectRefs(build: BuildDependencies, thisProject: ProjectRef): Seq[ProjectRef] = build.classpathTransitive.getOrElse(thisProject, Nil) // TODO - Should we pull in more than just JARs? How do native packages come in? @@ -120,22 +121,24 @@ object JavaAppPackaging extends AutoPlugin { } private def findProjectDependencyArtifacts: Def.Initialize[Task[Seq[Attributed[File]]]] = - 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) - } - val allArtifactsTask: Task[Seq[Attributed[File]]] = - artTasks.fold[Task[Seq[Attributed[File]]]](task(Nil)) { (previous, next) => - for { - p <- previous - n <- next - } yield p ++ n.filter(isRuntimeArtifact) + 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) } - allArtifactsTask - }.flatMap(identity) + val allArtifactsTask: Task[Seq[Attributed[File]]] = + artTasks.fold[Task[Seq[Attributed[File]]]](task(Nil)) { (previous, next) => + for { + p <- previous + n <- next + } yield p ++ n.filter(isRuntimeArtifact) + } + allArtifactsTask + } + .flatMap(identity) private def extractArtifacts(stateTask: Task[State], ref: ProjectRef): Task[Seq[Attributed[File]]] = stateTask.flatMap { state => diff --git a/src/main/scala/com/typesafe/sbt/packager/debian/DebianNativePackaging.scala b/src/main/scala/com/typesafe/sbt/packager/debian/DebianNativePackaging.scala index 39b013f9c..222338e1e 100644 --- a/src/main/scala/com/typesafe/sbt/packager/debian/DebianNativePackaging.scala +++ b/src/main/scala/com/typesafe/sbt/packager/debian/DebianNativePackaging.scala @@ -3,6 +3,7 @@ package com.typesafe.sbt.packager.debian import com.typesafe.sbt.SbtNativePackager.Debian import com.typesafe.sbt.packager.Keys._ import com.typesafe.sbt.packager.linux.LinuxFileMetaData +import com.typesafe.sbt.packager.Compat._ import sbt.Keys._ import sbt._ @@ -49,7 +50,7 @@ trait DebianNativePackaging extends DebianPluginLike { val deb = packageBin.value val role = debianSignRole.value val log = streams.value.log - Process(Seq("dpkg-sig", "-s", role, deb.getAbsolutePath), Some(deb.getParentFile)) ! log match { + sys.process.Process(Seq("dpkg-sig", "-s", role, deb.getAbsolutePath), Some(deb.getParentFile)) ! log match { case 0 => () case x => sys.error("Failed to sign debian package! exit code: " + x) @@ -58,7 +59,7 @@ trait DebianNativePackaging extends DebianPluginLike { }, lintian := { val file = packageBin.value - Process(Seq("lintian", "-c", "-v", file.getName), Some(file.getParentFile)).! + sys.process.Process(Seq("lintian", "-c", "-v", file.getName), Some(file.getParentFile)).! }, /** Implementation of the actual packaging */ packageBin := buildPackage( @@ -88,7 +89,7 @@ trait DebianNativePackaging extends DebianPluginLike { val changesFileName = debFile.getName.replaceAll("deb$", "changes") val changesFile: File = targetDir / ".." / changesFileName try { - val changes = Process(Seq("dpkg-genchanges", "-b"), Some(targetDir / "../tmp")).!! + val changes = sys.process.Process(Seq("dpkg-genchanges", "-b"), Some(targetDir / "../tmp")).!! val allChanges = List(changes) IO.writeLines(changesFile, allChanges) } catch { @@ -108,7 +109,7 @@ trait DebianNativePackaging extends DebianPluginLike { log.info("Building debian package with native implementation") // Make the package. We put this in fakeroot, so we can build the package with root owning files. val archive = archiveFilename(name, version, arch) - Process( + sys.process.Process( Seq("fakeroot", "--", "dpkg-deb", "--build") ++ buildOptions ++ Seq(stageDir.getAbsolutePath, "../" + archive), Some(stageDir) ) ! log match { diff --git a/src/main/scala/com/typesafe/sbt/packager/debian/DebianPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/debian/DebianPlugin.scala index e9a2d7c2a..7c111fec1 100644 --- a/src/main/scala/com/typesafe/sbt/packager/debian/DebianPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/debian/DebianPlugin.scala @@ -134,13 +134,13 @@ object DebianPlugin extends AutoPlugin with DebianNativePackaging { // override and merge with the user defined scripts. Will change in the future val controlScriptsDir = debianControlScriptsDirectory.value val overridenScripts = scripts ++ readContent( - Seq( - scriptMapping(Names.Prerm, debianMakePrermScript.value, controlScriptsDir), - scriptMapping(Names.Preinst, debianMakePreinstScript.value, controlScriptsDir), - scriptMapping(Names.Postinst, debianMakePostinstScript.value, controlScriptsDir), - scriptMapping(Names.Postrm, debianMakePostrmScript.value, controlScriptsDir) - ).flatten - ) + Seq( + scriptMapping(Names.Prerm, debianMakePrermScript.value, controlScriptsDir), + scriptMapping(Names.Preinst, debianMakePreinstScript.value, controlScriptsDir), + scriptMapping(Names.Postinst, debianMakePostinstScript.value, controlScriptsDir), + scriptMapping(Names.Postrm, debianMakePostrmScript.value, controlScriptsDir) + ).flatten + ) // --- legacy ends // TODO remove the overridenScripts @@ -236,7 +236,7 @@ object DebianPlugin extends AutoPlugin with DebianNativePackaging { private[this] def createMD5SumFile(stageDir: File): File = { val md5file = stageDir / Names.DebianMaintainerScripts / "md5sums" val md5sums = for { - (file, name) <- stageDir.*** --- stageDir pair relativeTo(stageDir) + (file, name) <- (stageDir ** AllPassFilter) --- stageDir pair (file => IO.relativize(stageDir, file)) if file.isFile if !(name startsWith Names.DebianMaintainerScripts) if !(name contains "debian-binary") @@ -426,21 +426,25 @@ trait DebianPluginLike { val header = "# Chown definitions created by SBT Native Packager\n" // Check for non root user/group and create chown commands // filter all root mappings, map to (user,group) key, group by, append everything - val chowns = mappings.filter { - case LinuxPackageMapping(_, LinuxFileMetaData(Users.Root, Users.Root, _, _, _), _) => - false - case _ => true - }.map { - case LinuxPackageMapping(paths, meta, _) => - (meta.user, meta.group) -> paths - }.groupBy(_._1).map { - case ((user, group), pathList) => - validateUserGroupNames(user, streams) - validateUserGroupNames(group, streams) - val chown = chownCmd(user, group) _ - // remove key, flatten it and then use mapping path (_.2) to create chown command - pathList.flatMap(_._2).map(m => chown(m._2)) - } + val chowns = mappings + .filter { + case LinuxPackageMapping(_, LinuxFileMetaData(Users.Root, Users.Root, _, _, _), _) => + false + case _ => true + } + .map { + case LinuxPackageMapping(paths, meta, _) => + (meta.user, meta.group) -> paths + } + .groupBy(_._1) + .map { + case ((user, group), pathList) => + validateUserGroupNames(user, streams) + validateUserGroupNames(group, streams) + val chown = chownCmd(user, group) _ + // remove key, flatten it and then use mapping path (_.2) to create chown command + pathList.flatMap(_._2).map(m => chown(m._2)) + } val replacement = header :: chowns.flatten.toList mkString "\n" DebianPlugin.CHOWN_REPLACEMENT -> replacement } diff --git a/src/main/scala/com/typesafe/sbt/packager/docker/DockerPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/docker/DockerPlugin.scala index 83795f51a..8551efc50 100644 --- a/src/main/scala/com/typesafe/sbt/packager/docker/DockerPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/docker/DockerPlugin.scala @@ -1,27 +1,17 @@ -package com.typesafe.sbt -package packager -package docker +package com.typesafe.sbt.packager.docker import java.io.File import java.util.concurrent.atomic.AtomicBoolean + import sbt._ -import sbt.Keys.{ - cacheDirectory, - clean, - mappings, - name, - publish, - publishArtifact, - publishLocal, - sourceDirectory, - streams, - target, - version -} -import packager.Keys._ -import linux.LinuxPlugin.autoImport.{daemonUser, defaultLinuxInstallLocation} -import universal.UniversalPlugin.autoImport.stage -import SbtNativePackager.{Linux, Universal} +import sbt.Keys.{clean, mappings, name, publish, publishLocal, sourceDirectory, streams, target, version} +import com.typesafe.sbt.packager.Keys._ +import com.typesafe.sbt.packager.linux.LinuxPlugin.autoImport.{daemonUser, defaultLinuxInstallLocation} +import com.typesafe.sbt.packager.universal.UniversalPlugin +import com.typesafe.sbt.packager.universal.UniversalPlugin.autoImport.stage +import com.typesafe.sbt.SbtNativePackager.Universal +import com.typesafe.sbt.packager.Compat._ +import com.typesafe.sbt.packager.{MappingsHelper, Stager} /** * == Docker Plugin == @@ -68,37 +58,37 @@ object DockerPlugin extends AutoPlugin { */ val UnixSeparatorChar = '/' - override def requires = universal.UniversalPlugin + override def requires = UniversalPlugin override def projectConfigurations: Seq[Configuration] = Seq(Docker) override lazy val projectSettings: Seq[Setting[_]] = Seq( - dockerBaseImage := "openjdk:latest", - dockerExposedPorts := Seq(), - dockerExposedUdpPorts := Seq(), - dockerExposedVolumes := Seq(), - dockerLabels := Map(), - dockerRepository := None, - dockerUsername := None, - dockerAlias := DockerAlias( - dockerRepository.value, - dockerUsername.value, - (packageName in Docker).value, - Some((version in Docker).value) - ), - dockerUpdateLatest := false, - dockerEntrypoint := Seq("bin/%s" format executableScriptName.value), - dockerCmd := Seq(), - dockerExecCommand := Seq("docker"), - dockerBuildOptions := Seq("--force-rm") ++ Seq("-t", dockerAlias.value.versioned) ++ ( - if (dockerUpdateLatest.value) - Seq("-t", dockerAlias.value.latest) - else - Seq() - ), - dockerRmiCommand := dockerExecCommand.value ++ Seq("rmi"), - dockerBuildCommand := dockerExecCommand.value ++ Seq("build") ++ dockerBuildOptions.value ++ Seq("."), - dockerCommands := { + dockerBaseImage := "openjdk:latest", + dockerExposedPorts := Seq(), + dockerExposedUdpPorts := Seq(), + dockerExposedVolumes := Seq(), + dockerLabels := Map(), + dockerRepository := None, + dockerUsername := None, + dockerAlias := DockerAlias( + dockerRepository.value, + dockerUsername.value, + (packageName in Docker).value, + Some((version in Docker).value) + ), + dockerUpdateLatest := false, + dockerEntrypoint := Seq("bin/%s" format executableScriptName.value), + dockerCmd := Seq(), + dockerExecCommand := Seq("docker"), + dockerBuildOptions := Seq("--force-rm") ++ Seq("-t", dockerAlias.value.versioned) ++ ( + if (dockerUpdateLatest.value) + Seq("-t", dockerAlias.value.latest) + else + Seq() + ), + dockerRmiCommand := dockerExecCommand.value ++ Seq("rmi"), + dockerBuildCommand := dockerExecCommand.value ++ Seq("build") ++ dockerBuildOptions.value ++ Seq("."), + dockerCommands := { val dockerBaseDirectory = (defaultLinuxInstallLocation in Docker).value val user = (daemonUser in Docker).value val group = (daemonGroup in Docker).value @@ -112,46 +102,52 @@ object DockerPlugin extends AutoPlugin { makeVolumes(dockerExposedVolumes.value, user, group) ++ Seq(makeUser(user), makeEntrypoint(dockerEntrypoint.value), makeCmd(dockerCmd.value)) } - ) ++ mapGenericFilesToDocker ++ inConfig(Docker)( - Seq( - executableScriptName := executableScriptName.value, - mappings ++= dockerPackageMappings.value, - mappings ++= Seq(dockerGenerateConfig.value) pair relativeTo(target.value), - name := name.value, - packageName := packageName.value, - publishLocal := { + ) ++ mapGenericFilesToDocker ++ inConfig(Docker)( + Seq( + executableScriptName := executableScriptName.value, + mappings ++= dockerPackageMappings.value, + mappings ++= { + val baseDir = target.value + Seq(dockerGenerateConfig.value) pair (file => IO.relativize(baseDir, file)) + }, + name := name.value, + packageName := packageName.value, + publishLocal := { val log = streams.value.log publishLocalDocker(stage.value, dockerBuildCommand.value, log) log.info(s"Built image ${dockerAlias.value.versioned}") }, - publish := { + publish := { val _ = publishLocal.value val alias = dockerAlias.value val log = streams.value.log - publishDocker(dockerExecCommand.value, alias.versioned, log) + val execCommand = dockerExecCommand.value + publishDocker(execCommand, alias.versioned, log) if (dockerUpdateLatest.value) { - publishDocker(dockerExecCommand.value, alias.latest, log) + publishDocker(execCommand, alias.latest, log) } }, - clean := { + clean := { val alias = dockerAlias.value val log = streams.value.log - rmiDocker(dockerRmiCommand.value, alias.versioned, log) + val rmiCommand = dockerRmiCommand.value + // clean up images + rmiDocker(rmiCommand, alias.versioned, log) if (dockerUpdateLatest.value) { - rmiDocker(dockerRmiCommand.value, alias.latest, log) + rmiDocker(rmiCommand, alias.latest, log) } }, - sourceDirectory := sourceDirectory.value / "docker", - stage := Stager.stage(Docker.name)(streams.value, stagingDirectory.value, mappings.value), - stagingDirectory := (target in Docker).value / "stage", - target := target.value / "docker", - daemonUser := "daemon", - daemonGroup := daemonUser.value, - defaultLinuxInstallLocation := "/opt/docker", - dockerPackageMappings := MappingsHelper.contentOf(sourceDirectory.value), - dockerGenerateConfig := generateDockerConfig(dockerCommands.value, target.value) - ) + sourceDirectory := sourceDirectory.value / "docker", + stage := Stager.stage(Docker.name)(streams.value, stagingDirectory.value, mappings.value), + stagingDirectory := (target in Docker).value / "stage", + target := target.value / "docker", + daemonUser := "daemon", + daemonGroup := daemonUser.value, + defaultLinuxInstallLocation := "/opt/docker", + dockerPackageMappings := MappingsHelper.contentOf(sourceDirectory.value), + dockerGenerateConfig := generateDockerConfig(dockerCommands.value, target.value) ) + ) /** * @param maintainer (optional) @@ -296,51 +292,51 @@ object DockerPlugin extends AutoPlugin { } private[docker] def publishLocalLogger(log: Logger) = - new ProcessLogger { - def error(err: => String): Unit = + new sys.process.ProcessLogger { + override def err(err: => String): Unit = err match { case s if s.startsWith("Uploading context") => log.debug(s) // pre-1.0 case s if s.startsWith("Sending build context") => log.debug(s) // 1.0 case s if !s.trim.isEmpty => log.error(s) - case s => + case s => } - def info(inf: => String): Unit = inf match { + override def out(inf: => String): Unit = inf match { case s if !s.trim.isEmpty => log.info(s) - case s => + case s => } - def buffer[T](f: => T): T = f + override def buffer[T](f: => T): T = f } def publishLocalDocker(context: File, buildCommand: Seq[String], log: Logger): Unit = { log.debug("Executing Native " + buildCommand.mkString(" ")) log.debug("Working directory " + context.toString) - val ret = Process(buildCommand, context) ! publishLocalLogger(log) + val ret = sys.process.Process(buildCommand, context) ! publishLocalLogger(log) if (ret != 0) throw new RuntimeException("Nonzero exit value: " + ret) } def rmiDocker(execCommand: Seq[String], tag: String, log: Logger): Unit = { - def rmiDockerLogger(log: Logger) = new ProcessLogger { - def error(err: => String): Unit = err match { + def rmiDockerLogger(log: Logger) = new sys.process.ProcessLogger { + override def err(err: => String): Unit = err match { case s if !s.trim.isEmpty => log.error(s) - case s => + case s => } - def info(inf: => String): Unit = log.info(inf) + override def out(inf: => String): Unit = log.info(inf) - def buffer[T](f: => T): T = f + override def buffer[T](f: => T): T = f } log.debug(s"Removing ${tag}") val cmd = execCommand :+ tag - val ret = Process(cmd) ! rmiDockerLogger(log) + val ret = sys.process.Process(cmd) ! rmiDockerLogger(log) if (ret != 0) sys.error(s"Nonzero exit value: ${ret}") @@ -352,29 +348,29 @@ object DockerPlugin extends AutoPlugin { val loginRequired = new AtomicBoolean(false) def publishLogger(log: Logger) = - new ProcessLogger { + new sys.process.ProcessLogger { - def error(err: => String): Unit = err match { + override def err(err: => String): Unit = err match { case s if !s.trim.isEmpty => log.error(s) - case s => + case s => } - def info(inf: => String): Unit = + override def out(inf: => String): Unit = inf match { case s if s.startsWith("Please login") => loginRequired.compareAndSet(false, true) case s if !loginRequired.get && !s.trim.isEmpty => log.info(s) - case s => + case s => } - def buffer[T](f: => T): T = f + override def buffer[T](f: => T): T = f } val cmd = execCommand ++ Seq("push", tag) log.debug("Executing " + cmd.mkString(" ")) - val ret = Process(cmd) ! publishLogger(log) + val ret = sys.process.Process(cmd) ! publishLogger(log) if (loginRequired.get) sys.error("""No credentials for repository, please run "docker login"""") diff --git a/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerAntHelper.scala b/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerAntHelper.scala index 736eca1d7..9ef90b516 100644 --- a/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerAntHelper.scala +++ b/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerAntHelper.scala @@ -31,7 +31,7 @@ object JDKPackagerAntHelper { sys.env.get("JDK_HOME").map(file), sys.env.get("JAVA_HOME").map(file), // MacOS X - Try("/usr/libexec/java_home".!!.trim).toOption.map(file), + Try(sys.process.Process("/usr/libexec/java_home").!!.trim).toOption.map(file), // From system properties sys.props.get("java.home").map(file) ) diff --git a/src/main/scala/com/typesafe/sbt/packager/linux/LinuxMappingDSL.scala b/src/main/scala/com/typesafe/sbt/packager/linux/LinuxMappingDSL.scala index 39d974be2..cf7f5cda2 100644 --- a/src/main/scala/com/typesafe/sbt/packager/linux/LinuxMappingDSL.scala +++ b/src/main/scala/com/typesafe/sbt/packager/linux/LinuxMappingDSL.scala @@ -30,7 +30,7 @@ trait LinuxMappingDSL { def mapDirectoryAndContents(dirs: (File, String)*): Seq[(File, String)] = for { (src, dest) <- dirs - path <- (src ***).get + path <- (src ** AllPassFilter).get } yield path -> path.toString.replaceFirst(src.toString, dest) /** @@ -45,7 +45,7 @@ trait LinuxMappingDSL { def configWithNoReplace(mappings: Seq[LinuxPackageMapping]): Seq[LinuxPackageMapping] = mappings.map { case mapping if mapping.fileData.config != "false" => mapping.withConfig("noreplace") - case mapping => mapping + case mapping => mapping } } diff --git a/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPackageMapping.scala b/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPackageMapping.scala index 7e3354243..380906dd9 100644 --- a/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPackageMapping.scala +++ b/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPackageMapping.scala @@ -44,9 +44,9 @@ object LinuxSymlink { val partsTo: Seq[String] = to split "/" filterNot (_.isEmpty) val prefixAndOne = (1 to partsFrom.length) - .map(partsFrom.take) - .dropWhile(seq => partsTo.startsWith(seq)) - .headOption getOrElse sys.error("Cannot symlink to yourself!") + .map(partsFrom.take) + .dropWhile(seq => partsTo.startsWith(seq)) + .headOption getOrElse sys.error("Cannot symlink to yourself!") val prefix = prefixAndOne dropRight 1 if (prefix.length > 0) { val escapeCount = (partsTo.length - 1) - prefix.length @@ -77,7 +77,7 @@ object LinuxSymlink { // from ln man page // -f --force remove existing destination files if (!to.exists) - Process(Seq("ln", "-sf", linkFinal, name), linkDir).! match { + sys.process.Process(Seq("ln", "-sf", linkFinal, name), linkDir).! match { case 0 => () case n => sys.error("Failed to symlink " + link.destination + " to " + to) diff --git a/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPlugin.scala index 0d9b35ed7..7638ff9a7 100644 --- a/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPlugin.scala @@ -192,7 +192,7 @@ object LinuxPlugin extends AutoPlugin { /** Create a ascii friendly string for a man page. */ final def makeMan(file: File): String = - Process("groff -man -Tascii " + file.getAbsolutePath).!! + sys.process.Process("groff -man -Tascii " + file.getAbsolutePath).!! // This method wires a lot of hand-coded generalities about how to map directories // into linux, and the conventions we expect. diff --git a/src/main/scala/com/typesafe/sbt/packager/rpm/RpmHelper.scala b/src/main/scala/com/typesafe/sbt/packager/rpm/RpmHelper.scala index 8bfc35d63..27a5268fb 100644 --- a/src/main/scala/com/typesafe/sbt/packager/rpm/RpmHelper.scala +++ b/src/main/scala/com/typesafe/sbt/packager/rpm/RpmHelper.scala @@ -1,15 +1,13 @@ -package com.typesafe.sbt -package packager -package rpm +package com.typesafe.sbt.packager.rpm import sbt._ -import com.typesafe.sbt.packager.linux.LinuxSymlink +import com.typesafe.sbt.packager.Compat._ object RpmHelper { /** Returns the host vendor for an rpm. */ def hostVendor = - Process(Seq("rpm", "-E", "%{_host_vendor}")) !! + sys.process.Process(Seq("rpm", "-E", "%{_host_vendor}")) !! /** * Prepares the staging directory for the rpm build command. @@ -87,7 +85,7 @@ object RpmHelper { IO.withTemporaryDirectory { tmpRpmBuildDir => val args: Seq[String] = (spec.setarch match { case Some(arch) => Seq("setarch", arch) - case None => Seq() + case None => Seq() }) ++ Seq( "rpmbuild", "-bb", @@ -104,7 +102,7 @@ object RpmHelper { else Seq.empty ) ++ Seq(spec.meta.name + ".spec") log.debug("Executing rpmbuild with: " + args.mkString(" ")) - (Process(args, Some(specsDir)) ! log) match { + (sys.process.Process(args, Some(specsDir)) ! log) match { case 0 => () case code => sys.error("Unable to run rpmbuild, check output for details. Errorcode " + code) @@ -126,5 +124,5 @@ object RpmHelper { } def evalMacro(mcro: String): String = - Process(Seq("rpm", "--eval", '%' + mcro)).!! + sys.process.Process(Seq("rpm", "--eval", '%' + mcro)).!! } diff --git a/src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala index 21d233530..c15fbd8a3 100644 --- a/src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala @@ -1,13 +1,14 @@ package com.typesafe.sbt.packager.rpm import sbt._ -import sbt.Keys.{name, packageBin, sourceDirectory, streams, target, version, isSnapshot} +import sbt.Keys.{isSnapshot, name, packageBin, sourceDirectory, streams, target, version} import java.nio.charset.Charset import com.typesafe.sbt.SbtNativePackager.Linux import com.typesafe.sbt.packager.SettingsHelper import com.typesafe.sbt.packager.Keys._ import com.typesafe.sbt.packager.linux._ +import com.typesafe.sbt.packager.Compat._ /** * Plugin containing all generic values used for packaging rpms. @@ -157,7 +158,7 @@ object RpmPlugin extends AutoPlugin { stage in Rpm := RpmHelper.stage(rpmSpecConfig.value, (target in Rpm).value, streams.value.log), packageBin in Rpm := RpmHelper.buildRpm(rpmSpecConfig.value, (stage in Rpm).value, streams.value.log), rpmLint := { - Process(Seq("rpmlint", "-v", (packageBin in Rpm).value.getAbsolutePath)) ! streams.value.log match { + sys.process.Process(Seq("rpmlint", "-v", (packageBin in Rpm).value.getAbsolutePath)) ! streams.value.log match { case 0 => () case x => sys.error("Failed to run rpmlint, exit status: " + x) } diff --git a/src/main/scala/com/typesafe/sbt/packager/universal/Archives.scala b/src/main/scala/com/typesafe/sbt/packager/universal/Archives.scala index 52fa86708..deefa924a 100644 --- a/src/main/scala/com/typesafe/sbt/packager/universal/Archives.scala +++ b/src/main/scala/com/typesafe/sbt/packager/universal/Archives.scala @@ -134,10 +134,12 @@ object Archives { val neededMegabytes = math.ceil((sizeBytes * 1.05) / (1024 * 1024)).toLong // Create the DMG file: - Process( - Seq("hdiutil", "create", "-megabytes", "%d" format neededMegabytes, "-fs", "HFS+", "-volname", name, name), - Some(target) - ).! match { + sys.process + .Process( + Seq("hdiutil", "create", "-megabytes", "%d" format neededMegabytes, "-fs", "HFS+", "-volname", name, name), + Some(target) + ) + .! match { case 0 => () case n => sys.error("Error creating dmg: " + dmg + ". Exit code " + n) } @@ -146,7 +148,9 @@ object Archives { val mountPoint = (t / name) if (!mountPoint.isDirectory) IO.createDirectory(mountPoint) val mountedPath = mountPoint.getAbsolutePath - Process(Seq("hdiutil", "attach", dmg.getAbsolutePath, "-readwrite", "-mountpoint", mountedPath), Some(target)).! match { + sys.process + .Process(Seq("hdiutil", "attach", dmg.getAbsolutePath, "-readwrite", "-mountpoint", mountedPath), Some(target)) + .! match { case 0 => () case n => sys.error("Unable to mount dmg: " + dmg + ". Exit code " + n) } @@ -161,7 +165,7 @@ object Archives { } to.setExecutable(true, true) // Now unmount - Process(Seq("hdiutil", "detach", mountedPath), Some(target)).! match { + sys.process.Process(Seq("hdiutil", "detach", mountedPath), Some(target)).! match { case 0 => () case n => sys.error("Unable to dismount dmg: " + dmg + ". Exit code " + n) @@ -177,7 +181,7 @@ object Archives { */ def gzip(f: File): File = { val par = f.getParentFile - Process(Seq("gzip", "-9", f.getAbsolutePath), Some(par)).! match { + sys.process.Process(Seq("gzip", "-9", f.getAbsolutePath), Some(par)).! match { case 0 => () case n => sys.error("Error gziping " + f + ". Exit code: " + n) } @@ -190,7 +194,7 @@ object Archives { */ def xz(f: File): File = { val par = f.getParentFile - Process(Seq("xz", "-9e", "-S", ".xz", f.getAbsolutePath), Some(par)).! match { + sys.process.Process(Seq("xz", "-9e", "-S", ".xz", f.getAbsolutePath), Some(par)).! match { case 0 => () case n => sys.error("Error xz-ing " + f + ". Exit code: " + n) } @@ -240,7 +244,7 @@ object Archives { IO.copy(m2) // TODO - Is this enough? - for ( (from, to) <- m2 if (to.getAbsolutePath contains "/bin/") || from.canExecute ) { + for ((from, to) <- m2 if (to.getAbsolutePath contains "/bin/") || from.canExecute) { println("Making " + to.getAbsolutePath + " executable") to.setExecutable(true, false) } @@ -256,7 +260,7 @@ object Archives { val cmd = Seq("tar") ++ options ++ Seq(tmptar.getAbsolutePath) ++ distdirs println("Running with " + cmd.mkString(" ")) - Process(cmd, Some(rdir)).! match { + sys.process.Process(cmd, Some(rdir)).! match { case 0 => () case n => sys.error("Error tarballing " + tarball + ". Exit code: " + n) diff --git a/src/main/scala/com/typesafe/sbt/packager/universal/UniversalPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/universal/UniversalPlugin.scala index 9e821297f..e37bc6b6e 100644 --- a/src/main/scala/com/typesafe/sbt/packager/universal/UniversalPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/universal/UniversalPlugin.scala @@ -47,22 +47,22 @@ object UniversalPlugin extends AutoPlugin { /** The basic settings for the various packaging types. */ override lazy val projectSettings: Seq[Setting[_]] = Seq[Setting[_]]( - // For now, we provide delegates from dist/stage to universal... - dist := (dist in Universal).value, - stage := (stage in Universal).value, - // TODO - New default to naming, is this right? - // TODO - We may need to do this for UniversalSrcs + UnviersalDocs - name in Universal := name.value, - name in UniversalDocs := (name in Universal).value, - name in UniversalSrc := (name in Universal).value, - packageName in Universal := packageName.value, - topLevelDirectory := Some((packageName in Universal).value), - executableScriptName in Universal := executableScriptName.value - ) ++ - makePackageSettingsForConfig(Universal) ++ - makePackageSettingsForConfig(UniversalDocs) ++ - makePackageSettingsForConfig(UniversalSrc) ++ - defaultUniversalArchiveOptions + // For now, we provide delegates from dist/stage to universal... + dist := (dist in Universal).value, + stage := (stage in Universal).value, + // TODO - New default to naming, is this right? + // TODO - We may need to do this for UniversalSrcs + UnviersalDocs + name in Universal := name.value, + name in UniversalDocs := (name in Universal).value, + name in UniversalSrc := (name in Universal).value, + packageName in Universal := packageName.value, + topLevelDirectory := Some((packageName in Universal).value), + executableScriptName in Universal := executableScriptName.value + ) ++ + makePackageSettingsForConfig(Universal) ++ + makePackageSettingsForConfig(UniversalDocs) ++ + makePackageSettingsForConfig(UniversalSrc) ++ + defaultUniversalArchiveOptions /** Creates all package types for a given configuration */ private[this] def makePackageSettingsForConfig(config: Configuration): Seq[Setting[_]] = @@ -128,7 +128,7 @@ object UniversalPlugin extends AutoPlugin { /** Finds all sources in a source directory. */ private[this] def findSources(sourceDir: File): Seq[(File, String)] = - sourceDir.*** --- sourceDir pair relativeTo(sourceDir) + ((PathFinder(sourceDir) ** AllPassFilter) --- sourceDir).pair(file => IO.relativize(sourceDir, file)) } diff --git a/src/main/scala/com/typesafe/sbt/packager/universal/ZipHelper.scala b/src/main/scala/com/typesafe/sbt/packager/universal/ZipHelper.scala index 6c32b4da4..4a0cbe0a5 100644 --- a/src/main/scala/com/typesafe/sbt/packager/universal/ZipHelper.scala +++ b/src/main/scala/com/typesafe/sbt/packager/universal/ZipHelper.scala @@ -41,7 +41,7 @@ object ZipHelper { if src.canExecute } target.setExecutable(true, true) val dirFileNames = Option(zipDir.listFiles) getOrElse Array.empty[java.io.File] map (_.getName) - Process(Seq("zip", "-r", name) ++ dirFileNames, zipDir).! match { + sys.process.Process(Seq("zip", "-r", name) ++ dirFileNames, zipDir).! match { case 0 => () case n => sys.error("Failed to run native zip application!") } diff --git a/src/main/scala/com/typesafe/sbt/packager/windows/WindowsPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/windows/WindowsPlugin.scala index e264fb908..ce6f54d71 100644 --- a/src/main/scala/com/typesafe/sbt/packager/windows/WindowsPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/windows/WindowsPlugin.scala @@ -1,11 +1,12 @@ -package com.typesafe.sbt -package packager -package windows +package com.typesafe.sbt.packager.windows import sbt._ -import sbt.Keys.{mappings, name, normalizedName, packageBin, sourceDirectory, streams, target, version} -import packager.Keys.{maintainer, packageDescription, packageName, packageSummary} -import SbtNativePackager.Universal +import sbt.Keys.{mappings, name, packageBin, sourceDirectory, streams, target, version} +import com.typesafe.sbt.SbtNativePackager.Universal +import com.typesafe.sbt.packager.Keys.{maintainer, packageDescription, packageName, packageSummary} +import com.typesafe.sbt.packager.universal.UniversalPlugin +import com.typesafe.sbt.packager.Compat._ +import com.typesafe.sbt.packager.SettingsHelper /** * == Windows Plugin == @@ -37,7 +38,7 @@ object WindowsPlugin extends AutoPlugin { import autoImport._ override lazy val projectSettings: Seq[Setting[_]] = windowsSettings ++ mapGenericFilesToWindows - override def requires = universal.UniversalPlugin + override def requires = UniversalPlugin override def projectConfigurations: Seq[Configuration] = Seq(Windows) @@ -105,20 +106,20 @@ object WindowsPlugin extends AutoPlugin { IO.copy(for ((f, to) <- mappings.value) yield (f, target.value / to)) // Now compile WIX val wixdir = Option(System.getenv("WIX")) getOrElse sys.error( - "WIX environment not found. Please ensure WIX is installed on this computer." - ) + "WIX environment not found. Please ensure WIX is installed on this computer." + ) val candleCmd = Seq(wixdir + "\\bin\\candle.exe", wix.getAbsolutePath) ++ candleOptions.value streams.value.log.debug(candleCmd mkString " ") - Process(candleCmd, Some(target.value)) ! streams.value.log match { - case 0 => () + sys.process.Process(candleCmd, Some(target.value)) ! streams.value.log match { + case 0 => () case exitCode => sys.error(s"Unable to run WIX compilation to wixobj. Exited with ${exitCode}") } // Now create MSI val wixobj = target.value / (name.value + ".wixobj") val lightCmd = Seq(wixdir + "\\bin\\light.exe", wixobj.getAbsolutePath) ++ lightOptions.value streams.value.log.debug(lightCmd mkString " ") - Process(lightCmd, Some(target.value)) ! streams.value.log match { - case 0 => () + sys.process.Process(lightCmd, Some(target.value)) ! streams.value.log match { + case 0 => () case exitCode => sys.error(s"Unable to run build msi. Exited with ${exitCode}") } msi @@ -139,7 +140,7 @@ object WindowsPlugin extends AutoPlugin { * @param mappings - use to generate different features * @return windows features */ - def makeWindowsFeatures(name: String, mappings: Seq[(File, String)]): Seq[windows.WindowsFeature] = { + def makeWindowsFeatures(name: String, mappings: Seq[(File, String)]): Seq[WindowsFeature] = { // TODO select main script! Filter Config links! val files = From 78b97ad68705c3bca5d34c5726f6f6fbc70726a3 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Sat, 24 Jun 2017 11:14:25 +0200 Subject: [PATCH 02/47] Fix travis.yml --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 800f6e835..7281936b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,10 +13,10 @@ before_install: fi script: - if [[ "$TRAVIS_OS_NAME" = "osx" ]]; then - ./sbt "SBT_VERSION_CMD validateOSX" ; + ./sbt "$SBT_VERSION_CMD validateOSX" ; fi - if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then - ./sbt "SBT_VERSION_CMD validateLinux" ; + ./sbt "$SBT_VERSION_CMD validateLinux" ; fi addons: From 3fdb0d67004f5e03dd05afe45075f80137aa5d31 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Sat, 24 Jun 2017 11:31:38 +0200 Subject: [PATCH 03/47] Fix Build.scala scripted tests --- .../multiproject-classifiers/build.sbt | 42 +++++++++++++++ .../project/Build.scala | 53 ------------------- .../multiproject-java-app-archetype/build.sbt | 34 ++++++++++++ .../project/Build.scala | 45 ---------------- 4 files changed, 76 insertions(+), 98 deletions(-) create mode 100644 src/sbt-test/universal/multiproject-classifiers/build.sbt delete mode 100644 src/sbt-test/universal/multiproject-classifiers/project/Build.scala create mode 100644 src/sbt-test/universal/multiproject-java-app-archetype/build.sbt delete mode 100644 src/sbt-test/universal/multiproject-java-app-archetype/project/Build.scala diff --git a/src/sbt-test/universal/multiproject-classifiers/build.sbt b/src/sbt-test/universal/multiproject-classifiers/build.sbt new file mode 100644 index 000000000..1922a24dd --- /dev/null +++ b/src/sbt-test/universal/multiproject-classifiers/build.sbt @@ -0,0 +1,42 @@ +lazy val appVersion = "1.0" + +lazy val mySettings: Seq[Setting[_]] = + Seq(organization := "org.test", version := appVersion, TaskKey[Unit]("show-files") := { + System.out.synchronized { + println("Files in [" + name.value + "]") + val files = (target.value / "universal/stage").***.get + files foreach println + } + }) + +lazy val assets = config("assets") + +lazy val sub = project + .in(file("sub")) + .enablePlugins(JavaAppPackaging) + .settings(mySettings) + .settings( + ivyConfigurations += assets, + artifact in assets := artifact.value.copy(classifier = Some("assets")), + packagedArtifacts += { + val file = target.value / "assets.jar" + val assetsDir = baseDirectory.value / "src" / "main" / "assets" + val sources = assetsDir.***.filter(_.isFile) pair relativeTo(assetsDir) + IO.zip(sources, file) + (artifact in assets).value -> file + }, + exportedProducts in assets := { + Seq( + Attributed + .blank(baseDirectory.value / "src" / "main" / "assets") + .put(artifact.key, (artifact in assets).value) + .put(AttributeKey[ModuleID]("module-id"), projectID.value) + ) + } + ) + +lazy val root = project + .in(file(".")) + .enablePlugins(JavaAppPackaging) + .settings(mySettings) + .dependsOn(sub % "compile->compile;compile->assets") diff --git a/src/sbt-test/universal/multiproject-classifiers/project/Build.scala b/src/sbt-test/universal/multiproject-classifiers/project/Build.scala deleted file mode 100644 index 7dd296f0e..000000000 --- a/src/sbt-test/universal/multiproject-classifiers/project/Build.scala +++ /dev/null @@ -1,53 +0,0 @@ -import sbt._ -import Keys._ -import com.typesafe.sbt.SbtNativePackager._ -import com.typesafe.sbt.packager.Keys._ - -// FIXME replace Build with AutoPlugin -object MutliBuild extends Build { - - val appVersion = "1.0" - - val mySettings: Seq[Setting[_]] = - packageArchetype.java_application ++ - Seq(organization := "org.test", version := appVersion, TaskKey[Unit]("show-files") := { - System.out.synchronized { - println("Files in [" + name.value + "]") - val files = (target.value / "universal/stage").***.get - files foreach println - } - }) - - val assets = config("assets") - - lazy val sub = ( - Project("sub", file("sub")) - settings (mySettings: _*) - settings ( - ivyConfigurations += assets, - artifact in assets := artifact.value.copy(classifier = Some("assets")), - packagedArtifacts += { - val file = target.value / "assets.jar" - val assetsDir = baseDirectory.value / "src" / "main" / "assets" - val sources = assetsDir.***.filter(_.isFile) pair relativeTo(assetsDir) - IO.zip(sources, file) - (artifact in assets).value -> file - }, - exportedProducts in assets := { - Seq( - Attributed - .blank(baseDirectory.value / "src" / "main" / "assets") - .put(artifact.key, (artifact in assets).value) - .put(AttributeKey[ModuleID]("module-id"), projectID.value) - ) - } - ) - ) - - lazy val root = ( - Project("root", file(".")) - settings (mySettings: _*) - dependsOn (sub % "compile->compile;compile->assets") - ) - -} diff --git a/src/sbt-test/universal/multiproject-java-app-archetype/build.sbt b/src/sbt-test/universal/multiproject-java-app-archetype/build.sbt new file mode 100644 index 000000000..4bd111962 --- /dev/null +++ b/src/sbt-test/universal/multiproject-java-app-archetype/build.sbt @@ -0,0 +1,34 @@ +lazy val appName = "play-bug-1499" +lazy val appVersion = "1.0" + +lazy val mySettings: Seq[Setting[_]] = + Seq(organization := "org.test", version := appVersion, TaskKey[Unit]("show-files") := { + System.out.synchronized { + println("Files in [" + name.value + "]") + val files = (target.value / "universal/stage").***.get + files foreach println + } + }) + +lazy val common = project + .in(file("module/common")) + .settings(mySettings) + +lazy val foo = project + .in(file("module/foo")) + .enablePlugins(JavaAppPackaging) + .settings(mySettings) + .dependsOn(common) + +lazy val bar = project + .in(file("module/bar")) + .enablePlugins(JavaAppPackaging) + .settings(mySettings) + .dependsOn(common) + +lazy val aaMain = project + .in(file(".")) + .enablePlugins(JavaAppPackaging) + .settings(mySettings) + .dependsOn(common, foo, bar) + .aggregate(foo, bar) diff --git a/src/sbt-test/universal/multiproject-java-app-archetype/project/Build.scala b/src/sbt-test/universal/multiproject-java-app-archetype/project/Build.scala deleted file mode 100644 index 87aa52f41..000000000 --- a/src/sbt-test/universal/multiproject-java-app-archetype/project/Build.scala +++ /dev/null @@ -1,45 +0,0 @@ -import sbt._ -import Keys._ -import com.typesafe.sbt.SbtNativePackager._ - -// FIXME replace Build with AutoPlugin -object MutliBuild extends Build { - - val appName = "play-bug-1499" - val appVersion = "1.0" - - val mySettings: Seq[Setting[_]] = - packageArchetype.java_application ++ - Seq(organization := "org.test", version := appVersion, TaskKey[Unit]("show-files") := { - System.out.synchronized { - println("Files in [" + name.value + "]") - val files = (target.value / "universal/stage").***.get - files foreach println - } - }) - - lazy val common = ( - Project(appName + "-common", file("module/common")) - settings (mySettings: _*) - ) - - lazy val foo = ( - Project(appName + "-foo", file("module/foo")) - settings (mySettings: _*) - dependsOn (common) - ) - - lazy val bar = ( - Project(appName + "-bar", file("module/bar")) - settings (mySettings: _*) - dependsOn (common) - ) - - lazy val aaMain = ( - Project(appName + "-main", file(".")) - settings (mySettings: _*) - dependsOn (common, foo, bar) - aggregate (foo, bar) - ) - -} From fcf08b8fc0fd5399713540f97f66bf081735dc73 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Sat, 24 Jun 2017 11:32:51 +0200 Subject: [PATCH 04/47] Remove 'provided' scope for jdeb temporarily --- build.sbt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 4c201e4c7..acc1f81c9 100644 --- a/build.sbt +++ b/build.sbt @@ -17,7 +17,8 @@ libraryDependencies ++= Seq( "org.apache.ant" % "ant" % "1.9.6", // these dependencies have to be explicitly added by the user "com.spotify" % "docker-client" % "3.5.13" % "provided", - "org.vafer" % "jdeb" % "1.3" % "provided" artifacts (Artifact("jdeb", "jar", "jar")), + // FIXME temporary remove the 'provided' scope. SBT 1.0.0-M6 changed the resolving somehow + "org.vafer" % "jdeb" % "1.3" /*% "provided"*/ artifacts Artifact("jdeb", "jar", "jar"), "org.scalatest" %% "scalatest" % "3.0.3" % "test" ) From db68a33057d394e25fc22d1dcc79b331d5abcbef Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Sat, 24 Jun 2017 12:24:25 +0200 Subject: [PATCH 05/47] Fix dependencies for scripted tests --- build.sbt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index acc1f81c9..00adb55c5 100644 --- a/build.sbt +++ b/build.sbt @@ -11,12 +11,15 @@ crossSbtVersions := Vector("0.13.15", "1.0.0-M6") scalacOptions in Compile ++= Seq("-deprecation") javacOptions ++= Seq("-source", "1.8", "-target", "1.8") +// put jdeb on the classpath for scripted tests +classpathTypes += "maven-plugin" libraryDependencies ++= Seq( "org.apache.commons" % "commons-compress" % "1.4.1", // for jdkpackager "org.apache.ant" % "ant" % "1.9.6", // these dependencies have to be explicitly added by the user - "com.spotify" % "docker-client" % "3.5.13" % "provided", + // FIXME temporary remove the 'provided' scope. SBT 1.0.0-M6 changed the resolving somehow + "com.spotify" % "docker-client" % "3.5.13" /* % "provided" */, // FIXME temporary remove the 'provided' scope. SBT 1.0.0-M6 changed the resolving somehow "org.vafer" % "jdeb" % "1.3" /*% "provided"*/ artifacts Artifact("jdeb", "jar", "jar"), "org.scalatest" %% "scalatest" % "3.0.3" % "test" From 507694cd008481a78148862a5b7b1d0104208ea0 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Sat, 24 Jun 2017 12:24:45 +0200 Subject: [PATCH 06/47] Fix scripted test calls by using packageBin instead of package-bin --- src/sbt-test/debian/daemon-group-gid-deb/test | 2 +- src/sbt-test/debian/daemon-user-deb/test | 2 +- src/sbt-test/debian/daemon-user-shell-deb/test | 2 +- src/sbt-test/debian/daemon-user-uid-deb/test | 2 +- src/sbt-test/debian/file-permissions/test | 2 +- src/sbt-test/debian/java-app-archetype/test | 2 +- src/sbt-test/debian/jdeb-conflicts/test | 2 +- src/sbt-test/debian/jdeb-dependencies/test | 2 +- src/sbt-test/debian/jdeb-dir-mappings/test | 2 +- src/sbt-test/debian/jdeb-provides/test | 2 +- src/sbt-test/debian/jdeb-script-replacements/test | 2 +- src/sbt-test/debian/log-directory/test | 2 +- src/sbt-test/debian/override-control-files/test | 2 +- src/sbt-test/debian/simple-deb/test | 2 +- src/sbt-test/debian/simple-jdeb/test | 2 +- src/sbt-test/debian/systemd-deb/test | 4 ++-- src/sbt-test/debian/sysvinit-deb/test | 4 ++-- src/sbt-test/debian/sysvinit-stoptimeouts-deb/test | 2 +- src/sbt-test/debian/test-executableScriptName/test | 2 +- src/sbt-test/debian/test-mapping-helpers/test | 2 +- src/sbt-test/debian/test-mapping/test | 2 +- src/sbt-test/debian/test-packageName/test | 2 +- src/sbt-test/debian/upstart-deb-facilities/test | 2 +- src/sbt-test/debian/upstart-deb/test | 4 ++-- src/sbt-test/rpm/changelog-test/test | 2 +- src/sbt-test/rpm/config-no-replace/test | 2 +- src/sbt-test/rpm/override-loader-functions/test | 2 +- src/sbt-test/rpm/override-start-script-systemd/test | 2 +- src/sbt-test/rpm/override-start-script-systemv/test | 2 +- src/sbt-test/rpm/override-start-script-upstart/test | 2 +- src/sbt-test/rpm/path-override-rpm/test | 2 +- src/sbt-test/rpm/scriplets-no-javarepack-rpm/test | 2 +- src/sbt-test/rpm/scriplets-use-javarepack-rpm/test | 2 +- src/sbt-test/rpm/scriptlets-override-build-rpm/test | 2 +- src/sbt-test/rpm/scriptlets-override-rpm/test | 2 +- src/sbt-test/rpm/scriptlets-rpm/test | 2 +- src/sbt-test/rpm/setarch-rpm/test | 2 +- src/sbt-test/rpm/simple-rpm/test | 2 +- src/sbt-test/rpm/snapshot-rpm/test | 2 +- src/sbt-test/rpm/sysvinit-rpm/test | 4 ++-- src/sbt-test/rpm/test-executableScriptName/test | 2 +- src/sbt-test/rpm/test-packageName/test | 2 +- src/sbt-test/universal/absolute-path/build.sbt | 2 +- src/sbt-test/universal/absolute-path/test | 2 +- .../universal/multiproject-java-app-archetype/build.sbt | 2 +- src/sbt-test/universal/multiproject-java-app-archetype/test | 2 +- src/sbt-test/universal/staging-custom-main/test | 2 +- src/sbt-test/universal/test-executableScriptName/build.sbt | 2 +- src/sbt-test/universal/test-executableScriptName/test | 2 +- src/sbt-test/universal/test-mapping-helpers/test | 2 +- src/sbt-test/universal/test-native-zip/test | 2 +- src/sbt-test/universal/test-packageName/test | 2 +- src/sbt-test/universal/test-zips-no-top-level-dir/test | 2 +- src/sbt-test/universal/test-zips/test | 6 +++--- src/sbt-test/windows/java-app-archetype/test | 2 +- 55 files changed, 61 insertions(+), 61 deletions(-) diff --git a/src/sbt-test/debian/daemon-group-gid-deb/test b/src/sbt-test/debian/daemon-group-gid-deb/test index 967f7a260..1035fe56f 100644 --- a/src/sbt-test/debian/daemon-group-gid-deb/test +++ b/src/sbt-test/debian/daemon-group-gid-deb/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> debian:package-bin +> debian:packageBin $ exists target/debian-test_0.1.0_all.deb $ exists target/debian-test-0.1.0/etc diff --git a/src/sbt-test/debian/daemon-user-deb/test b/src/sbt-test/debian/daemon-user-deb/test index b59d4d6be..003a99569 100644 --- a/src/sbt-test/debian/daemon-user-deb/test +++ b/src/sbt-test/debian/daemon-user-deb/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> debian:package-bin +> debian:packageBin $ exists target/debian-test_0.1.0_all.deb # Check defaults diff --git a/src/sbt-test/debian/daemon-user-shell-deb/test b/src/sbt-test/debian/daemon-user-shell-deb/test index b59d4d6be..003a99569 100644 --- a/src/sbt-test/debian/daemon-user-shell-deb/test +++ b/src/sbt-test/debian/daemon-user-shell-deb/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> debian:package-bin +> debian:packageBin $ exists target/debian-test_0.1.0_all.deb # Check defaults diff --git a/src/sbt-test/debian/daemon-user-uid-deb/test b/src/sbt-test/debian/daemon-user-uid-deb/test index 2aaab684c..e4b371abd 100644 --- a/src/sbt-test/debian/daemon-user-uid-deb/test +++ b/src/sbt-test/debian/daemon-user-uid-deb/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> debian:package-bin +> debian:packageBin $ exists target/debian-test_0.1.0_all.deb $ exists target/debian-test-0.1.0/etc diff --git a/src/sbt-test/debian/file-permissions/test b/src/sbt-test/debian/file-permissions/test index 5a0cd1e63..75cf6de15 100644 --- a/src/sbt-test/debian/file-permissions/test +++ b/src/sbt-test/debian/file-permissions/test @@ -1,3 +1,3 @@ # Run the debian packaging. -> debian:package-bin +> debian:packageBin $ exists target/debian-test_0.1.0_all.deb diff --git a/src/sbt-test/debian/java-app-archetype/test b/src/sbt-test/debian/java-app-archetype/test index f07dc43ce..48074d526 100644 --- a/src/sbt-test/debian/java-app-archetype/test +++ b/src/sbt-test/debian/java-app-archetype/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> debian:package-bin +> debian:packageBin $ exists target/debian-test_0.1.0_all.deb > stage $ exists target/universal/stage/bin/debian-test diff --git a/src/sbt-test/debian/jdeb-conflicts/test b/src/sbt-test/debian/jdeb-conflicts/test index 30995efd1..af775b07d 100644 --- a/src/sbt-test/debian/jdeb-conflicts/test +++ b/src/sbt-test/debian/jdeb-conflicts/test @@ -1,5 +1,5 @@ # Run the debian packaging. $ mkdir src/resources/empty -> debian:package-bin +> debian:packageBin $ exists target/debian-test_0.1.0_all.deb > check-conflicts diff --git a/src/sbt-test/debian/jdeb-dependencies/test b/src/sbt-test/debian/jdeb-dependencies/test index f3a2c1704..9184bc855 100644 --- a/src/sbt-test/debian/jdeb-dependencies/test +++ b/src/sbt-test/debian/jdeb-dependencies/test @@ -1,5 +1,5 @@ # Run the debian packaging. $ mkdir src/resources/empty -> debian:package-bin +> debian:packageBin $ exists target/debian-test_0.1.0_all.deb > check-dependencies diff --git a/src/sbt-test/debian/jdeb-dir-mappings/test b/src/sbt-test/debian/jdeb-dir-mappings/test index eaac4b35b..91dacb0b4 100644 --- a/src/sbt-test/debian/jdeb-dir-mappings/test +++ b/src/sbt-test/debian/jdeb-dir-mappings/test @@ -1,5 +1,5 @@ # Run the debian packaging. $ mkdir src/resources/empty -> debian:package-bin +> debian:packageBin $ exists target/debian-test_0.1.0_all.deb > check-dir-mappings diff --git a/src/sbt-test/debian/jdeb-provides/test b/src/sbt-test/debian/jdeb-provides/test index 5ccc924e2..1267d5f13 100644 --- a/src/sbt-test/debian/jdeb-provides/test +++ b/src/sbt-test/debian/jdeb-provides/test @@ -1,5 +1,5 @@ # Run the debian packaging. $ mkdir src/resources/empty -> debian:package-bin +> debian:packageBin $ exists target/debian-test_0.1.0_all.deb > check-provides diff --git a/src/sbt-test/debian/jdeb-script-replacements/test b/src/sbt-test/debian/jdeb-script-replacements/test index a695d78a7..420cbbcf5 100644 --- a/src/sbt-test/debian/jdeb-script-replacements/test +++ b/src/sbt-test/debian/jdeb-script-replacements/test @@ -1,5 +1,5 @@ # Run the debian packaging. $ mkdir src/resources/empty -> debian:package-bin +> debian:packageBin $ exists target/debian-test_0.1.0_all.deb > check-control-files diff --git a/src/sbt-test/debian/log-directory/test b/src/sbt-test/debian/log-directory/test index 8fc5d14f9..f8c2e81e5 100644 --- a/src/sbt-test/debian/log-directory/test +++ b/src/sbt-test/debian/log-directory/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> debian:package-bin +> debian:packageBin $ exists target/debian-test_0.1.0_all.deb # Check defaults diff --git a/src/sbt-test/debian/override-control-files/test b/src/sbt-test/debian/override-control-files/test index 0898e7661..65d9be1f5 100644 --- a/src/sbt-test/debian/override-control-files/test +++ b/src/sbt-test/debian/override-control-files/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> debian:package-bin +> debian:packageBin $ exists target/debian-test_0.1.0_all.deb $ exists target/debian-test-0.1.0/etc diff --git a/src/sbt-test/debian/simple-deb/test b/src/sbt-test/debian/simple-deb/test index 5a0cd1e63..75cf6de15 100644 --- a/src/sbt-test/debian/simple-deb/test +++ b/src/sbt-test/debian/simple-deb/test @@ -1,3 +1,3 @@ # Run the debian packaging. -> debian:package-bin +> debian:packageBin $ exists target/debian-test_0.1.0_all.deb diff --git a/src/sbt-test/debian/simple-jdeb/test b/src/sbt-test/debian/simple-jdeb/test index 5a0cd1e63..75cf6de15 100644 --- a/src/sbt-test/debian/simple-jdeb/test +++ b/src/sbt-test/debian/simple-jdeb/test @@ -1,3 +1,3 @@ # Run the debian packaging. -> debian:package-bin +> debian:packageBin $ exists target/debian-test_0.1.0_all.deb diff --git a/src/sbt-test/debian/systemd-deb/test b/src/sbt-test/debian/systemd-deb/test index 2b712f916..571d9df95 100644 --- a/src/sbt-test/debian/systemd-deb/test +++ b/src/sbt-test/debian/systemd-deb/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> debian:package-bin +> debian:packageBin $ exists target/debian-test_0.1.0_all.deb $ exists target/debian-test-0.1.0/lib/systemd/system/debian-test.service @@ -15,5 +15,5 @@ $ exists target/debian-test-0.1.0/lib/systemd/system/debian-test.service # Test that serviceAutostart can be disabled > set every NativePackagerKeys.serviceAutostart := false -> debian:package-bin +> debian:packageBin > check-no-autostart \ No newline at end of file diff --git a/src/sbt-test/debian/sysvinit-deb/test b/src/sbt-test/debian/sysvinit-deb/test index d83fa8ad0..cff49d90d 100644 --- a/src/sbt-test/debian/sysvinit-deb/test +++ b/src/sbt-test/debian/sysvinit-deb/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> debian:package-bin +> debian:packageBin $ exists target/debian-test_0.1.0_all.deb $ exists target/debian-test-0.1.0/etc @@ -13,5 +13,5 @@ $ exists target/debian-test-0.1.0/etc/init.d/debian-test # Test that serviceAutostart can be disabled > set every NativePackagerKeys.serviceAutostart := false -> debian:package-bin +> debian:packageBin > check-no-autostart \ No newline at end of file diff --git a/src/sbt-test/debian/sysvinit-stoptimeouts-deb/test b/src/sbt-test/debian/sysvinit-stoptimeouts-deb/test index c52706fc7..1e045eec6 100644 --- a/src/sbt-test/debian/sysvinit-stoptimeouts-deb/test +++ b/src/sbt-test/debian/sysvinit-stoptimeouts-deb/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> debian:package-bin +> debian:packageBin $ exists target/debian-test_0.1.0_all.deb $ exists target/debian-test-0.1.0/etc diff --git a/src/sbt-test/debian/test-executableScriptName/test b/src/sbt-test/debian/test-executableScriptName/test index 74b8ed1d0..2bc26b876 100644 --- a/src/sbt-test/debian/test-executableScriptName/test +++ b/src/sbt-test/debian/test-executableScriptName/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> debian:package-bin +> debian:packageBin $ exists target/debian-test_0.1.0_all.deb # Testing the packageName configuration $ exists target/debian-test-0.1.0/DEBIAN diff --git a/src/sbt-test/debian/test-mapping-helpers/test b/src/sbt-test/debian/test-mapping-helpers/test index f5d62277d..03594d109 100644 --- a/src/sbt-test/debian/test-mapping-helpers/test +++ b/src/sbt-test/debian/test-mapping-helpers/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> debian:package-bin +> debian:packageBin $ exists target/debian-test_0.1.0_all.deb # Template directories diff --git a/src/sbt-test/debian/test-mapping/test b/src/sbt-test/debian/test-mapping/test index c1c8150bd..b656c2696 100644 --- a/src/sbt-test/debian/test-mapping/test +++ b/src/sbt-test/debian/test-mapping/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> debian:package-bin +> debian:packageBin $ exists target/debian-test-override_0.1.0_all.deb # Testing the packageName configuration $ exists target/debian-test-override-0.1.0/DEBIAN diff --git a/src/sbt-test/debian/test-packageName/test b/src/sbt-test/debian/test-packageName/test index 9922aac8d..b8fe314be 100644 --- a/src/sbt-test/debian/test-packageName/test +++ b/src/sbt-test/debian/test-packageName/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> debian:package-bin +> debian:packageBin $ exists target/debian-test-override_0.1.0_all.deb # Testing the packageName configuration $ exists target/debian-test-override-0.1.0/DEBIAN diff --git a/src/sbt-test/debian/upstart-deb-facilities/test b/src/sbt-test/debian/upstart-deb-facilities/test index 5eb51cfae..e2e4cacfd 100644 --- a/src/sbt-test/debian/upstart-deb-facilities/test +++ b/src/sbt-test/debian/upstart-deb-facilities/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> debian:package-bin +> debian:packageBin $ exists target/debian-test_0.1.0_all.deb $ exists target/debian-test-0.1.0/etc/init/debian-test.conf diff --git a/src/sbt-test/debian/upstart-deb/test b/src/sbt-test/debian/upstart-deb/test index 2e520c9f9..476e7405b 100644 --- a/src/sbt-test/debian/upstart-deb/test +++ b/src/sbt-test/debian/upstart-deb/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> debian:package-bin +> debian:packageBin $ exists target/debian-test_0.1.0_all.deb $ exists target/debian-test-0.1.0/etc @@ -20,5 +20,5 @@ $ exists target/debian-test-0.1.0/DEBIAN/postinst # Test that serviceAutostart can be disabled > set every NativePackagerKeys.serviceAutostart := false -> debian:package-bin +> debian:packageBin > check-no-autostart \ No newline at end of file diff --git a/src/sbt-test/rpm/changelog-test/test b/src/sbt-test/rpm/changelog-test/test index 91f5a8c91..7719d009e 100644 --- a/src/sbt-test/rpm/changelog-test/test +++ b/src/sbt-test/rpm/changelog-test/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> rpm:package-bin +> rpm:packageBin $ exists target/rpm/RPMS/noarch/rpm-test-0.1.0-1.noarch.rpm $ exists target/rpm/SPECS/rpm-test.spec diff --git a/src/sbt-test/rpm/config-no-replace/test b/src/sbt-test/rpm/config-no-replace/test index e6620db76..440a1b58d 100644 --- a/src/sbt-test/rpm/config-no-replace/test +++ b/src/sbt-test/rpm/config-no-replace/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> rpm:package-bin +> rpm:packageBin $ exists target/rpm/RPMS/x86_64/rpm-test-0.1.0-1.x86_64.rpm > unzip diff --git a/src/sbt-test/rpm/override-loader-functions/test b/src/sbt-test/rpm/override-loader-functions/test index 9ec6e993c..974bbc50f 100644 --- a/src/sbt-test/rpm/override-loader-functions/test +++ b/src/sbt-test/rpm/override-loader-functions/test @@ -1,5 +1,5 @@ # Run the rpm packaging. -> rpm:package-bin +> rpm:packageBin $ exists target/rpm/RPMS/noarch/rpm-test-0.1.0-1.noarch.rpm > check-loader-script diff --git a/src/sbt-test/rpm/override-start-script-systemd/test b/src/sbt-test/rpm/override-start-script-systemd/test index 6a04be025..996a6f2aa 100644 --- a/src/sbt-test/rpm/override-start-script-systemd/test +++ b/src/sbt-test/rpm/override-start-script-systemd/test @@ -1,5 +1,5 @@ # Run the rpm packaging. -> rpm:package-bin +> rpm:packageBin $ exists target/rpm/RPMS/noarch/rpm-test-0.1.0-1.noarch.rpm > unzip diff --git a/src/sbt-test/rpm/override-start-script-systemv/test b/src/sbt-test/rpm/override-start-script-systemv/test index eca2e528d..2c6817a6b 100644 --- a/src/sbt-test/rpm/override-start-script-systemv/test +++ b/src/sbt-test/rpm/override-start-script-systemv/test @@ -1,5 +1,5 @@ # Run the rpm packaging. -> rpm:package-bin +> rpm:packageBin $ exists target/rpm/RPMS/noarch/rpm-test-0.1.0-1.noarch.rpm > unzip diff --git a/src/sbt-test/rpm/override-start-script-upstart/test b/src/sbt-test/rpm/override-start-script-upstart/test index 6dc54d9e6..8d95f5912 100644 --- a/src/sbt-test/rpm/override-start-script-upstart/test +++ b/src/sbt-test/rpm/override-start-script-upstart/test @@ -1,5 +1,5 @@ # Run the rpm packaging. -> rpm:package-bin +> rpm:packageBin $ exists target/rpm/RPMS/noarch/rpm-test-0.1.0-1.noarch.rpm > unzip diff --git a/src/sbt-test/rpm/path-override-rpm/test b/src/sbt-test/rpm/path-override-rpm/test index 5662e0959..afd8bef8b 100644 --- a/src/sbt-test/rpm/path-override-rpm/test +++ b/src/sbt-test/rpm/path-override-rpm/test @@ -1,5 +1,5 @@ # Run the rpm packaging. -> rpm:package-bin +> rpm:packageBin $ exists target/rpm/RPMS/noarch/rpm-test-0.1.0-1.noarch.rpm > unzip diff --git a/src/sbt-test/rpm/scriplets-no-javarepack-rpm/test b/src/sbt-test/rpm/scriplets-no-javarepack-rpm/test index 6c6e1e1eb..3e64106aa 100644 --- a/src/sbt-test/rpm/scriplets-no-javarepack-rpm/test +++ b/src/sbt-test/rpm/scriplets-no-javarepack-rpm/test @@ -1,5 +1,5 @@ # Run the RPM packaging. -> rpm:package-bin +> rpm:packageBin $ exists target/rpm/RPMS/noarch/rpm-test-no-repack-0.1.0-2.noarch.rpm $ exists target/rpm/SPECS/rpm-test-no-repack.spec diff --git a/src/sbt-test/rpm/scriplets-use-javarepack-rpm/test b/src/sbt-test/rpm/scriplets-use-javarepack-rpm/test index f2060ebc9..38e3e854d 100644 --- a/src/sbt-test/rpm/scriplets-use-javarepack-rpm/test +++ b/src/sbt-test/rpm/scriplets-use-javarepack-rpm/test @@ -1,5 +1,5 @@ # Run the RPM packaging. -> rpm:package-bin +> rpm:packageBin $ exists target/rpm/RPMS/noarch/rpm-test-with-repack-0.1.0-2.noarch.rpm $ exists target/rpm/SPECS/rpm-test-with-repack.spec diff --git a/src/sbt-test/rpm/scriptlets-override-build-rpm/test b/src/sbt-test/rpm/scriptlets-override-build-rpm/test index 91f5a8c91..7719d009e 100644 --- a/src/sbt-test/rpm/scriptlets-override-build-rpm/test +++ b/src/sbt-test/rpm/scriptlets-override-build-rpm/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> rpm:package-bin +> rpm:packageBin $ exists target/rpm/RPMS/noarch/rpm-test-0.1.0-1.noarch.rpm $ exists target/rpm/SPECS/rpm-test.spec diff --git a/src/sbt-test/rpm/scriptlets-override-rpm/test b/src/sbt-test/rpm/scriptlets-override-rpm/test index f885a5382..6ff8c2f43 100644 --- a/src/sbt-test/rpm/scriptlets-override-rpm/test +++ b/src/sbt-test/rpm/scriptlets-override-rpm/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> rpm:package-bin +> rpm:packageBin $ exists target/rpm/RPMS/noarch/rpm-test-0.1.0-1.noarch.rpm # Check rpm contents diff --git a/src/sbt-test/rpm/scriptlets-rpm/test b/src/sbt-test/rpm/scriptlets-rpm/test index 9c6826041..e3ba5c710 100644 --- a/src/sbt-test/rpm/scriptlets-rpm/test +++ b/src/sbt-test/rpm/scriptlets-rpm/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> rpm:package-bin +> rpm:packageBin $ exists target/rpm/RPMS/noarch/rpm-test-0.1.0-1.noarch.rpm $ exists target/rpm/SPECS/rpm-test.spec diff --git a/src/sbt-test/rpm/setarch-rpm/test b/src/sbt-test/rpm/setarch-rpm/test index dd859659d..4dd87c7ce 100644 --- a/src/sbt-test/rpm/setarch-rpm/test +++ b/src/sbt-test/rpm/setarch-rpm/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> rpm:package-bin +> rpm:packageBin $ exists target/rpm/RPMS/i386/rpm-package-0.1.0-1.i386.rpm $ exists target/rpm/SPECS/rpm-package.spec diff --git a/src/sbt-test/rpm/simple-rpm/test b/src/sbt-test/rpm/simple-rpm/test index 3ed170d50..c44497912 100644 --- a/src/sbt-test/rpm/simple-rpm/test +++ b/src/sbt-test/rpm/simple-rpm/test @@ -2,5 +2,5 @@ $ exists target/rpm > checkSpecFile # Run the rpm packaging. -> rpm:package-bin +> rpm:packageBin $ exists target/rpm/RPMS/x86_64/rpm-test-0.1.0-1.x86_64.rpm diff --git a/src/sbt-test/rpm/snapshot-rpm/test b/src/sbt-test/rpm/snapshot-rpm/test index 53bc1d3f5..fbc62558c 100644 --- a/src/sbt-test/rpm/snapshot-rpm/test +++ b/src/sbt-test/rpm/snapshot-rpm/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> rpm:package-bin +> rpm:packageBin $ exists target/rpm/RPMS/noarch/rpm-test-0.1.0-SNAPSHOT.noarch.rpm #Check release and version configured correctly diff --git a/src/sbt-test/rpm/sysvinit-rpm/test b/src/sbt-test/rpm/sysvinit-rpm/test index a8321338e..4f6e99e4c 100644 --- a/src/sbt-test/rpm/sysvinit-rpm/test +++ b/src/sbt-test/rpm/sysvinit-rpm/test @@ -1,5 +1,5 @@ # Run the rpm packaging. -> rpm:package-bin +> rpm:packageBin $ exists target/rpm/RPMS/noarch/rpm-test-0.1.0-1.noarch.rpm > check-spec-file @@ -30,6 +30,6 @@ $ exists var/run/rpm-test # Test that serviceAutostart can be disabled > set every NativePackagerKeys.serviceAutostart := false -> rpm:package-bin +> rpm:packageBin > check-spec-file > check-spec-no-autostart \ No newline at end of file diff --git a/src/sbt-test/rpm/test-executableScriptName/test b/src/sbt-test/rpm/test-executableScriptName/test index fca66983e..e7602ecdb 100644 --- a/src/sbt-test/rpm/test-executableScriptName/test +++ b/src/sbt-test/rpm/test-executableScriptName/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> rpm:package-bin +> rpm:packageBin $ exists target/rpm/RPMS/noarch/rpm-test-0.1.0-1.noarch.rpm $ exists target/rpm/SPECS/rpm-test.spec diff --git a/src/sbt-test/rpm/test-packageName/test b/src/sbt-test/rpm/test-packageName/test index a4f4caa85..e2529b498 100644 --- a/src/sbt-test/rpm/test-packageName/test +++ b/src/sbt-test/rpm/test-packageName/test @@ -1,5 +1,5 @@ # Run the debian packaging. -> rpm:package-bin +> rpm:packageBin $ exists target/rpm/RPMS/noarch/rpm-package-0.1.0-1.noarch.rpm $ exists target/rpm/SPECS/rpm-package.spec diff --git a/src/sbt-test/universal/absolute-path/build.sbt b/src/sbt-test/universal/absolute-path/build.sbt index 990a80bc6..f3b4c83c9 100644 --- a/src/sbt-test/universal/absolute-path/build.sbt +++ b/src/sbt-test/universal/absolute-path/build.sbt @@ -8,7 +8,7 @@ scriptClasspath in bashScriptDefines ++= Seq("/dummy/absolute/path", "relative/p scriptClasspath in batScriptReplacements ++= Seq("x:\\dummy\\absolute\\path", "relative\\path") -TaskKey[Unit]("run-check") := { +TaskKey[Unit]("check") := { val dir = (stagingDirectory in Universal).value val bash = IO.read(dir / "bin" / "absolute-path") diff --git a/src/sbt-test/universal/absolute-path/test b/src/sbt-test/universal/absolute-path/test index 877989c06..68964d7c7 100644 --- a/src/sbt-test/universal/absolute-path/test +++ b/src/sbt-test/universal/absolute-path/test @@ -1,3 +1,3 @@ # Run the staging and check the script. > stage -> run-check \ No newline at end of file +> check \ No newline at end of file diff --git a/src/sbt-test/universal/multiproject-java-app-archetype/build.sbt b/src/sbt-test/universal/multiproject-java-app-archetype/build.sbt index 4bd111962..a4d64d5f9 100644 --- a/src/sbt-test/universal/multiproject-java-app-archetype/build.sbt +++ b/src/sbt-test/universal/multiproject-java-app-archetype/build.sbt @@ -2,7 +2,7 @@ lazy val appName = "play-bug-1499" lazy val appVersion = "1.0" lazy val mySettings: Seq[Setting[_]] = - Seq(organization := "org.test", version := appVersion, TaskKey[Unit]("show-files") := { + Seq(organization := "org.test", version := appVersion, TaskKey[Unit]("showFiles") := { System.out.synchronized { println("Files in [" + name.value + "]") val files = (target.value / "universal/stage").***.get diff --git a/src/sbt-test/universal/multiproject-java-app-archetype/test b/src/sbt-test/universal/multiproject-java-app-archetype/test index e62a87154..a21b21788 100644 --- a/src/sbt-test/universal/multiproject-java-app-archetype/test +++ b/src/sbt-test/universal/multiproject-java-app-archetype/test @@ -1,6 +1,6 @@ # Run the staging and check the script. > stage -> show-files +> showFiles $ exists target/universal/stage/lib/org.test.play-bug-1499-foo-1.0.jar $ exists target/universal/stage/lib/org.test.play-bug-1499-common-1.0.jar $ exists target/universal/stage/lib/org.test.play-bug-1499-bar-1.0.jar diff --git a/src/sbt-test/universal/staging-custom-main/test b/src/sbt-test/universal/staging-custom-main/test index 79e8a783b..59ec0b5c5 100644 --- a/src/sbt-test/universal/staging-custom-main/test +++ b/src/sbt-test/universal/staging-custom-main/test @@ -1,5 +1,5 @@ # Stage the distribution and ensure main class can be run. -> show universal:package-bin +> show universal:packageBin $ exists target/universal/stage-custom-main-0.1.0.zip > unzip $ exists stage-custom-main-0.1.0/bin/ diff --git a/src/sbt-test/universal/test-executableScriptName/build.sbt b/src/sbt-test/universal/test-executableScriptName/build.sbt index 5d5cb873a..12fa16ddd 100644 --- a/src/sbt-test/universal/test-executableScriptName/build.sbt +++ b/src/sbt-test/universal/test-executableScriptName/build.sbt @@ -8,5 +8,5 @@ version := "0.1.0" TaskKey[Unit]("unzip") := { val args = Seq((packageBin in Universal).value.getAbsolutePath) - Process("unzip", args) ! streams.value.log + sys.process.Process("unzip", args) ! streams.value.log } diff --git a/src/sbt-test/universal/test-executableScriptName/test b/src/sbt-test/universal/test-executableScriptName/test index f0589c769..dd820a7c9 100644 --- a/src/sbt-test/universal/test-executableScriptName/test +++ b/src/sbt-test/universal/test-executableScriptName/test @@ -1,5 +1,5 @@ # Run the zip packaging. -> show universal:package-bin +> show universal:packageBin $ exists target/universal/simple-test-0.1.0.zip > unzip $ exists simple-test-0.1.0/bin/ diff --git a/src/sbt-test/universal/test-mapping-helpers/test b/src/sbt-test/universal/test-mapping-helpers/test index f6cfad758..3eaa5da82 100644 --- a/src/sbt-test/universal/test-mapping-helpers/test +++ b/src/sbt-test/universal/test-mapping-helpers/test @@ -1,5 +1,5 @@ # Run the universal packaging. -> show universal:package-bin +> show universal:packageBin $ exists target/universal/simple-test-0.1.0.zip > unzip diff --git a/src/sbt-test/universal/test-native-zip/test b/src/sbt-test/universal/test-native-zip/test index d3f226f48..137147654 100644 --- a/src/sbt-test/universal/test-native-zip/test +++ b/src/sbt-test/universal/test-native-zip/test @@ -1,5 +1,5 @@ # Run the zip packaging. -> show universal:package-bin +> show universal:packageBin $ exists target/universal/simple-test-0.1.0.zip # TODO - Check contents of zips. Ensure file permissions are preserved. diff --git a/src/sbt-test/universal/test-packageName/test b/src/sbt-test/universal/test-packageName/test index 27165bada..333283a73 100644 --- a/src/sbt-test/universal/test-packageName/test +++ b/src/sbt-test/universal/test-packageName/test @@ -1,5 +1,5 @@ # Run the zip packaging. -> show universal:package-bin +> show universal:packageBin $ exists target/universal/simple-package.zip # Run the tgz packaging. diff --git a/src/sbt-test/universal/test-zips-no-top-level-dir/test b/src/sbt-test/universal/test-zips-no-top-level-dir/test index 72fdb39de..5ac479906 100644 --- a/src/sbt-test/universal/test-zips-no-top-level-dir/test +++ b/src/sbt-test/universal/test-zips-no-top-level-dir/test @@ -1,5 +1,5 @@ # Run the zip packaging. -> show universal:package-bin +> show universal:packageBin $ exists target/universal/simple-test-0.1.0.zip # Run the tgz packaging. diff --git a/src/sbt-test/universal/test-zips/test b/src/sbt-test/universal/test-zips/test index 1de8871ad..128f47335 100644 --- a/src/sbt-test/universal/test-zips/test +++ b/src/sbt-test/universal/test-zips/test @@ -1,9 +1,9 @@ # Run the zip packaging. -> show universal:package-bin +> show universal:packageBin $ exists target/universal/simple-test-0.1.0.zip -> universal-docs:package-bin +> universal-docs:packageBin $ exists target/universal-docs/simple-test-0.1.0.zip -> universal-src:package-bin +> universal-src:packageBin $ exists target/universal-src/simple-test-0.1.0.zip # Run the tgz packaging. diff --git a/src/sbt-test/windows/java-app-archetype/test b/src/sbt-test/windows/java-app-archetype/test index 7ad000daa..a206e5112 100644 --- a/src/sbt-test/windows/java-app-archetype/test +++ b/src/sbt-test/windows/java-app-archetype/test @@ -1,5 +1,5 @@ # Run the windows packaging. -> windows:package-bin +> windows:packageBin $ exists target/windows/windows-test.msi > stage $ exists target/universal/stage/bin/windows-test.bat From a43c3eba6dc0267ed09066130c790b36059ba523 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Sat, 1 Jul 2017 12:14:50 +0200 Subject: [PATCH 07/47] Fix multiproject-classifiers test by using new `withClassifier` method. This may break 0.13.6 -> add compat for this --- src/sbt-test/universal/multiproject-classifiers/build.sbt | 8 ++++---- src/sbt-test/universal/multiproject-classifiers/test | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sbt-test/universal/multiproject-classifiers/build.sbt b/src/sbt-test/universal/multiproject-classifiers/build.sbt index 1922a24dd..15126e5ad 100644 --- a/src/sbt-test/universal/multiproject-classifiers/build.sbt +++ b/src/sbt-test/universal/multiproject-classifiers/build.sbt @@ -1,10 +1,10 @@ lazy val appVersion = "1.0" lazy val mySettings: Seq[Setting[_]] = - Seq(organization := "org.test", version := appVersion, TaskKey[Unit]("show-files") := { + Seq(organization := "org.test", version := appVersion, TaskKey[Unit]("showFiles") := { System.out.synchronized { println("Files in [" + name.value + "]") - val files = (target.value / "universal/stage").***.get + val files = (target.value / "universal/stage").**(AllPassFilter).get files foreach println } }) @@ -17,11 +17,11 @@ lazy val sub = project .settings(mySettings) .settings( ivyConfigurations += assets, - artifact in assets := artifact.value.copy(classifier = Some("assets")), + artifact in assets := artifact.value.withClassifier(classifier = Some("assets")), packagedArtifacts += { val file = target.value / "assets.jar" val assetsDir = baseDirectory.value / "src" / "main" / "assets" - val sources = assetsDir.***.filter(_.isFile) pair relativeTo(assetsDir) + val sources = assetsDir.**(AllPassFilter).filter(_.isFile) pair (file => IO.relativize(assetsDir, file)) IO.zip(sources, file) (artifact in assets).value -> file }, diff --git a/src/sbt-test/universal/multiproject-classifiers/test b/src/sbt-test/universal/multiproject-classifiers/test index 9854319b2..c47a0712e 100644 --- a/src/sbt-test/universal/multiproject-classifiers/test +++ b/src/sbt-test/universal/multiproject-classifiers/test @@ -1,5 +1,5 @@ # Run the staging and check the script. > stage -> show-files +> showFiles $ exists target/universal/stage/lib/org.test.sub-1.0.jar $ exists target/universal/stage/lib/org.test.sub-1.0-assets.jar From 85b2c12c5124737b9ef4a2edbe0b9afcdd80ed61 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Sat, 1 Jul 2017 12:15:05 +0200 Subject: [PATCH 08/47] Replace all *** PathFilter calls in scripted tests --- src/sbt-test/debian/java-app-archetype/build.sbt | 2 +- src/sbt-test/jdkpackager/test-package-mappings/build.sbt | 2 +- .../universal/multiproject-java-app-archetype/build.sbt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sbt-test/debian/java-app-archetype/build.sbt b/src/sbt-test/debian/java-app-archetype/build.sbt index e3fbb961a..058b56ca6 100644 --- a/src/sbt-test/debian/java-app-archetype/build.sbt +++ b/src/sbt-test/debian/java-app-archetype/build.sbt @@ -23,7 +23,7 @@ TaskKey[Unit]("check-script") := { val scriptContents = IO.read(script) System.err.println(scriptContents) System.err.println("---END SCRIPT---") - for (file <- (dir.***).get) + for (file <- dir.**(AllPassFilter).get) System.err.println("\t" + file) } val cmd = "bash " + script.getAbsolutePath + " -d" diff --git a/src/sbt-test/jdkpackager/test-package-mappings/build.sbt b/src/sbt-test/jdkpackager/test-package-mappings/build.sbt index 59b60cde3..f472dfafb 100644 --- a/src/sbt-test/jdkpackager/test-package-mappings/build.sbt +++ b/src/sbt-test/jdkpackager/test-package-mappings/build.sbt @@ -20,7 +20,7 @@ mappings in Universal += baseDirectory.value / "src" / "deploy" / "README.md" -> mappings in Universal ++= { val dir = baseDirectory.value / "src" / "deploy" / "stuff" - (dir.*** --- dir) pair relativeTo(dir.getParentFile) + (dir.**(AllPassFilter) --- dir) pair relativeTo(dir.getParentFile) } lazy val iconGlob = sys.props("os.name").toLowerCase match { diff --git a/src/sbt-test/universal/multiproject-java-app-archetype/build.sbt b/src/sbt-test/universal/multiproject-java-app-archetype/build.sbt index a4d64d5f9..4edd197c0 100644 --- a/src/sbt-test/universal/multiproject-java-app-archetype/build.sbt +++ b/src/sbt-test/universal/multiproject-java-app-archetype/build.sbt @@ -5,7 +5,7 @@ lazy val mySettings: Seq[Setting[_]] = Seq(organization := "org.test", version := appVersion, TaskKey[Unit]("showFiles") := { System.out.synchronized { println("Files in [" + name.value + "]") - val files = (target.value / "universal/stage").***.get + val files = (target.value / "universal/stage").**(AllPassFilter).get files foreach println } }) From e38eaf28b50bb34ed9cad1d2df9a482f645ab212 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Sun, 9 Jul 2017 12:34:06 +0200 Subject: [PATCH 09/47] Replace Process with sys.process.Process and add Compat.io import --- .../com/typesafe/sbt/packager/Compat.scala | 2 ++ src/sbt-test/ash/simple-app/build.sbt | 2 ++ src/sbt-test/bash/java-home-var-expansion/build.sbt | 2 ++ src/sbt-test/bash/memory-settings/build.sbt | 2 ++ src/sbt-test/bash/multiple-apps/build.sbt | 2 ++ src/sbt-test/bash/simple-app/build.sbt | 2 ++ src/sbt-test/cygwin/java-app-archetype/build.sbt | 2 ++ src/sbt-test/debian/java-app-archetype/build.sbt | 2 ++ src/sbt-test/jar/classpath-jar/build.sbt | 2 ++ src/sbt-test/jar/launcher-jar/build.sbt | 2 ++ src/sbt-test/rpm/config-no-replace/build.sbt | 2 ++ src/sbt-test/rpm/override-start-script-systemd/build.sbt | 2 ++ src/sbt-test/rpm/override-start-script-systemv/build.sbt | 2 ++ src/sbt-test/rpm/override-start-script-upstart/build.sbt | 4 +++- src/sbt-test/rpm/path-override-rpm/build.sbt | 2 ++ src/sbt-test/rpm/scriptlets-override-rpm/build.sbt | 4 +++- src/sbt-test/rpm/scriptlets-rpm/build.sbt | 6 ++++-- src/sbt-test/rpm/systemd-rpm/build.sbt | 2 ++ src/sbt-test/rpm/sysvinit-rpm/build.sbt | 2 ++ src/sbt-test/rpm/test-executableScriptName/build.sbt | 4 +++- src/sbt-test/universal/staging-custom-main/build.sbt | 4 +++- src/sbt-test/universal/test-mapping-helpers/build.sbt | 2 ++ src/sbt-test/windows/java-app-archetype/build.sbt | 2 ++ src/sbt-test/windows/multiple-apps/build.sbt | 2 ++ src/sbt-test/windows/test-bat-template/build.sbt | 2 ++ src/sbt-test/windows/test-custom-main/build.sbt | 4 +++- 26 files changed, 59 insertions(+), 7 deletions(-) diff --git a/src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/Compat.scala b/src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/Compat.scala index cb7cb5bfa..f9da55b73 100644 --- a/src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/Compat.scala +++ b/src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/Compat.scala @@ -13,6 +13,8 @@ object Compat { type InlineConfiguration = ilm.InlineConfiguration val InlineConfiguration = ilm.InlineConfiguration + object io {} + /** * Used in * - [[com.typesafe.sbt.packager.archetypes.JavaAppPackaging]] diff --git a/src/sbt-test/ash/simple-app/build.sbt b/src/sbt-test/ash/simple-app/build.sbt index fc72c64e1..f376d12b0 100644 --- a/src/sbt-test/ash/simple-app/build.sbt +++ b/src/sbt-test/ash/simple-app/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(AshScriptPlugin) name := "simple-app" diff --git a/src/sbt-test/bash/java-home-var-expansion/build.sbt b/src/sbt-test/bash/java-home-var-expansion/build.sbt index df397d08e..9339c73c0 100644 --- a/src/sbt-test/bash/java-home-var-expansion/build.sbt +++ b/src/sbt-test/bash/java-home-var-expansion/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(JavaAppPackaging) name := "java-home-override" diff --git a/src/sbt-test/bash/memory-settings/build.sbt b/src/sbt-test/bash/memory-settings/build.sbt index 7970d16b7..502b20b1c 100644 --- a/src/sbt-test/bash/memory-settings/build.sbt +++ b/src/sbt-test/bash/memory-settings/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(JavaAppPackaging) name := "simple-app" diff --git a/src/sbt-test/bash/multiple-apps/build.sbt b/src/sbt-test/bash/multiple-apps/build.sbt index 29b378a26..3ea056873 100644 --- a/src/sbt-test/bash/multiple-apps/build.sbt +++ b/src/sbt-test/bash/multiple-apps/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(JavaAppPackaging) name := "test-project" diff --git a/src/sbt-test/bash/simple-app/build.sbt b/src/sbt-test/bash/simple-app/build.sbt index aa27edf06..ee9c54e99 100644 --- a/src/sbt-test/bash/simple-app/build.sbt +++ b/src/sbt-test/bash/simple-app/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(JavaAppPackaging) name := "simple-app" diff --git a/src/sbt-test/cygwin/java-app-archetype/build.sbt b/src/sbt-test/cygwin/java-app-archetype/build.sbt index 53cd7e6e6..b95c8d9a0 100644 --- a/src/sbt-test/cygwin/java-app-archetype/build.sbt +++ b/src/sbt-test/cygwin/java-app-archetype/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(JavaServerAppPackaging) name := "windows-test" diff --git a/src/sbt-test/debian/java-app-archetype/build.sbt b/src/sbt-test/debian/java-app-archetype/build.sbt index 058b56ca6..c7b8bb15b 100644 --- a/src/sbt-test/debian/java-app-archetype/build.sbt +++ b/src/sbt-test/debian/java-app-archetype/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(JavaAppPackaging) name := "debian-test" diff --git a/src/sbt-test/jar/classpath-jar/build.sbt b/src/sbt-test/jar/classpath-jar/build.sbt index 662c63305..c174ebe32 100644 --- a/src/sbt-test/jar/classpath-jar/build.sbt +++ b/src/sbt-test/jar/classpath-jar/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(ClasspathJarPlugin) name := "classpath-jar-test" diff --git a/src/sbt-test/jar/launcher-jar/build.sbt b/src/sbt-test/jar/launcher-jar/build.sbt index aa424b7c9..9bb8da52e 100644 --- a/src/sbt-test/jar/launcher-jar/build.sbt +++ b/src/sbt-test/jar/launcher-jar/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(LauncherJarPlugin) name := "launcher-jar-test" diff --git a/src/sbt-test/rpm/config-no-replace/build.sbt b/src/sbt-test/rpm/config-no-replace/build.sbt index fa29b6a6d..689f7811d 100644 --- a/src/sbt-test/rpm/config-no-replace/build.sbt +++ b/src/sbt-test/rpm/config-no-replace/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(RpmPlugin) name := "rpm-test" diff --git a/src/sbt-test/rpm/override-start-script-systemd/build.sbt b/src/sbt-test/rpm/override-start-script-systemd/build.sbt index df2fcee64..61bd56342 100644 --- a/src/sbt-test/rpm/override-start-script-systemd/build.sbt +++ b/src/sbt-test/rpm/override-start-script-systemd/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(JavaServerAppPackaging, SystemdPlugin) name := "rpm-test" diff --git a/src/sbt-test/rpm/override-start-script-systemv/build.sbt b/src/sbt-test/rpm/override-start-script-systemv/build.sbt index 8f9c48a9d..64b217a21 100644 --- a/src/sbt-test/rpm/override-start-script-systemv/build.sbt +++ b/src/sbt-test/rpm/override-start-script-systemv/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(JavaServerAppPackaging, SystemVPlugin) name := "rpm-test" diff --git a/src/sbt-test/rpm/override-start-script-upstart/build.sbt b/src/sbt-test/rpm/override-start-script-upstart/build.sbt index 95047c749..fa3ef0e04 100644 --- a/src/sbt-test/rpm/override-start-script-upstart/build.sbt +++ b/src/sbt-test/rpm/override-start-script-upstart/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(JavaServerAppPackaging, UpstartPlugin) name := "rpm-test" @@ -25,7 +27,7 @@ rpmGroup := Some("test-group") TaskKey[Unit]("unzip") := { val rpmPath = Seq((packageBin in Rpm).value.getAbsolutePath) - Process("rpm2cpio", rpmPath) #| Process("cpio -i --make-directories") ! streams.value.log + Process("rpm2cpio", rpmPath) #| sys.process.Process("cpio -i --make-directories") ! streams.value.log () } diff --git a/src/sbt-test/rpm/path-override-rpm/build.sbt b/src/sbt-test/rpm/path-override-rpm/build.sbt index 16a2dc213..152998687 100644 --- a/src/sbt-test/rpm/path-override-rpm/build.sbt +++ b/src/sbt-test/rpm/path-override-rpm/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(JavaServerAppPackaging, SystemVPlugin) name := "rpm-test" diff --git a/src/sbt-test/rpm/scriptlets-override-rpm/build.sbt b/src/sbt-test/rpm/scriptlets-override-rpm/build.sbt index 125acb57b..d95eab3e0 100644 --- a/src/sbt-test/rpm/scriptlets-override-rpm/build.sbt +++ b/src/sbt-test/rpm/scriptlets-override-rpm/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(JavaServerAppPackaging, SystemVPlugin) name := "rpm-test" @@ -18,7 +20,7 @@ TaskKey[Unit]("unzipAndCheck") := { val rpmFile = (packageBin in Rpm).value val rpmPath = Seq(rpmFile.getAbsolutePath) Process("rpm2cpio", rpmPath) #| Process("cpio -i --make-directories") ! streams.value.log - val scriptlets = Process("rpm -qp --scripts " + rpmFile.getAbsolutePath) !! streams.value.log + val scriptlets = sys.process.Process("rpm -qp --scripts " + rpmFile.getAbsolutePath) !! streams.value.log assert(scriptlets contains "echo postinst", "'echo 'postinst' not present in \n" + scriptlets) assert(scriptlets contains "echo preinst", "'echo 'preinst' not present in \n" + scriptlets) assert(scriptlets contains "echo postun", "'echo 'postun' not present in \n" + scriptlets) diff --git a/src/sbt-test/rpm/scriptlets-rpm/build.sbt b/src/sbt-test/rpm/scriptlets-rpm/build.sbt index e8be87b92..15cf4bd3b 100644 --- a/src/sbt-test/rpm/scriptlets-rpm/build.sbt +++ b/src/sbt-test/rpm/scriptlets-rpm/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + import RpmConstants._ enablePlugins(RpmPlugin) @@ -91,8 +93,8 @@ TaskKey[Unit]("check-rpm-version") := { val rpmVersion = fullRpmVersion substring firstDigit streams.value.log.info("Found rpmVersion: " + rpmVersion) val (major, minor, patch) = rpmVersion.trim.split("\\.").map(_.toInt) match { - case Array(major) => (major, 0, 0) - case Array(major, minor) => (major, minor, 0) + case Array(major) => (major, 0, 0) + case Array(major, minor) => (major, minor, 0) case Array(major, minor, patch, _ *) => (major, minor, patch) } assert(major >= 4, "RPM version must be greater than than 4.x.x. Is " + fullRpmVersion) diff --git a/src/sbt-test/rpm/systemd-rpm/build.sbt b/src/sbt-test/rpm/systemd-rpm/build.sbt index 22f1ab099..37bc762b8 100644 --- a/src/sbt-test/rpm/systemd-rpm/build.sbt +++ b/src/sbt-test/rpm/systemd-rpm/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(JavaServerAppPackaging, SystemdPlugin) name := "rpm-test" diff --git a/src/sbt-test/rpm/sysvinit-rpm/build.sbt b/src/sbt-test/rpm/sysvinit-rpm/build.sbt index 4fa9fc80b..f22f08789 100644 --- a/src/sbt-test/rpm/sysvinit-rpm/build.sbt +++ b/src/sbt-test/rpm/sysvinit-rpm/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(JavaServerAppPackaging, SystemVPlugin) name := "rpm-test" diff --git a/src/sbt-test/rpm/test-executableScriptName/build.sbt b/src/sbt-test/rpm/test-executableScriptName/build.sbt index f733dde89..20dfc797c 100644 --- a/src/sbt-test/rpm/test-executableScriptName/build.sbt +++ b/src/sbt-test/rpm/test-executableScriptName/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(JavaServerAppPackaging, SystemVPlugin) name := "rpm-test" @@ -39,7 +41,7 @@ TaskKey[Unit]("check-spec-file") := { TaskKey[Unit]("unzip") := { val rpmPath = Seq((packageBin in Rpm).value.getAbsolutePath) - Process("rpm2cpio", rpmPath) #| Process("cpio -i --make-directories") ! streams.value.log + sys.process.Process("rpm2cpio", rpmPath) #| Process("cpio -i --make-directories") ! streams.value.log () } diff --git a/src/sbt-test/universal/staging-custom-main/build.sbt b/src/sbt-test/universal/staging-custom-main/build.sbt index 4d5f3359e..3909c19aa 100644 --- a/src/sbt-test/universal/staging-custom-main/build.sbt +++ b/src/sbt-test/universal/staging-custom-main/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(JavaAppPackaging) name := "stage-custom-main" @@ -13,7 +15,7 @@ TaskKey[Unit]("unzip") := { TaskKey[Unit]("check") := { val zipFile = (packageBin in Universal).value - val process = sbt.Process("stage-custom-main-0.1.0/bin/stage-custom-main", Seq("-main", "CustomMain")) + val process = Process("stage-custom-main-0.1.0/bin/stage-custom-main", Seq("-main", "CustomMain")) val out = (process !!) if (out.trim != "A custom main method") sys.error("unexpected output: " + out) () diff --git a/src/sbt-test/universal/test-mapping-helpers/build.sbt b/src/sbt-test/universal/test-mapping-helpers/build.sbt index 12af5bd4e..4a523b11f 100644 --- a/src/sbt-test/universal/test-mapping-helpers/build.sbt +++ b/src/sbt-test/universal/test-mapping-helpers/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + import com.typesafe.sbt.packager.MappingsHelper._ enablePlugins(JavaAppPackaging) diff --git a/src/sbt-test/windows/java-app-archetype/build.sbt b/src/sbt-test/windows/java-app-archetype/build.sbt index 15d26b195..14c77de90 100644 --- a/src/sbt-test/windows/java-app-archetype/build.sbt +++ b/src/sbt-test/windows/java-app-archetype/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(JavaAppPackaging) name := "windows-test" diff --git a/src/sbt-test/windows/multiple-apps/build.sbt b/src/sbt-test/windows/multiple-apps/build.sbt index 2648b8a49..3a0e4d185 100644 --- a/src/sbt-test/windows/multiple-apps/build.sbt +++ b/src/sbt-test/windows/multiple-apps/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(JavaAppPackaging) name := "test-project" diff --git a/src/sbt-test/windows/test-bat-template/build.sbt b/src/sbt-test/windows/test-bat-template/build.sbt index 3bb3f02bb..930cf6083 100644 --- a/src/sbt-test/windows/test-bat-template/build.sbt +++ b/src/sbt-test/windows/test-bat-template/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(JavaAppPackaging) name := "windows-test" diff --git a/src/sbt-test/windows/test-custom-main/build.sbt b/src/sbt-test/windows/test-custom-main/build.sbt index 71f41098c..b33aa6564 100644 --- a/src/sbt-test/windows/test-custom-main/build.sbt +++ b/src/sbt-test/windows/test-custom-main/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(JavaAppPackaging) name := "test-custom-main" @@ -18,7 +20,7 @@ TaskKey[Unit]("check-app-main") := { TaskKey[Unit]("check-custom-main") := { val zipFile = (packageBin in Universal).value val process = - sbt.Process("target/universal/stage/bin/test-custom-main.bat", Seq("-main", "CustomMain")) + Process("target/universal/stage/bin/test-custom-main.bat", Seq("-main", "CustomMain")) val out = (process !!) if (out.trim != "Custom Main Method") error("unexpected output: " + out) () From 6c4ee4fa4c6aed4804fed96d7c40a60ac733991b Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Sun, 9 Jul 2017 15:12:43 +0200 Subject: [PATCH 10/47] Fixing all remaining scripted tests --- .../com/typesafe/sbt/packager/Compat.scala | 1 - .../com/typesafe/sbt/packager/Compat.scala | 7 ++-- src/sbt-test/ash/memory-settings/build.sbt | 4 +-- src/sbt-test/ash/memory-settings/test | 2 +- src/sbt-test/ash/override-templates/build.sbt | 2 +- src/sbt-test/ash/override-templates/test | 2 +- src/sbt-test/ash/simple-app/build.sbt | 4 +-- src/sbt-test/ash/simple-app/test | 2 +- .../bash/absolute-path-in-bash/build.sbt | 2 +- src/sbt-test/bash/absolute-path-in-bash/test | 2 +- .../bash/java-home-var-expansion/build.sbt | 4 +-- .../bash/java-home-var-expansion/test | 2 +- src/sbt-test/bash/memory-settings/build.sbt | 4 +-- src/sbt-test/bash/memory-settings/test | 2 +- src/sbt-test/bash/multiple-apps/build.sbt | 12 +++---- src/sbt-test/bash/multiple-apps/test | 4 +-- .../bash/override-templates/build.sbt | 4 +-- src/sbt-test/bash/override-templates/test | 4 +-- src/sbt-test/bash/simple-app/build.sbt | 4 +-- src/sbt-test/bash/simple-app/test | 2 +- .../cygwin/java-app-archetype/build.sbt | 6 ++-- src/sbt-test/cygwin/java-app-archetype/test | 2 +- .../debian/daemon-group-gid-deb/build.sbt | 2 +- src/sbt-test/debian/daemon-group-gid-deb/test | 2 +- src/sbt-test/debian/daemon-user-deb/build.sbt | 2 +- src/sbt-test/debian/daemon-user-deb/test | 2 +- .../debian/daemon-user-shell-deb/build.sbt | 2 +- .../debian/daemon-user-shell-deb/test | 2 +- .../debian/daemon-user-uid-deb/build.sbt | 2 +- src/sbt-test/debian/daemon-user-uid-deb/test | 2 +- src/sbt-test/debian/gen-changes/test | 2 +- .../debian/java-app-archetype/build.sbt | 8 ++--- src/sbt-test/debian/java-app-archetype/test | 2 +- src/sbt-test/debian/jdeb-conflicts/build.sbt | 6 ++-- src/sbt-test/debian/jdeb-conflicts/test | 2 +- .../debian/jdeb-dependencies/build.sbt | 6 ++-- src/sbt-test/debian/jdeb-dependencies/test | 2 +- .../debian/jdeb-dir-mappings/build.sbt | 6 ++-- src/sbt-test/debian/jdeb-dir-mappings/test | 2 +- src/sbt-test/debian/jdeb-provides/build.sbt | 6 ++-- src/sbt-test/debian/jdeb-provides/test | 2 +- .../debian/jdeb-script-replacements/build.sbt | 6 ++-- .../debian/jdeb-script-replacements/test | 2 +- src/sbt-test/debian/log-directory/build.sbt | 4 +-- src/sbt-test/debian/log-directory/test | 2 +- .../debian/native-build-compress/build.sbt | 2 +- .../debian/native-build-compress/test | 2 +- .../debian/native-build-default/build.sbt | 2 +- src/sbt-test/debian/native-build-default/test | 2 +- .../debian/override-control-files/build.sbt | 2 +- .../debian/override-control-files/test | 2 +- .../debian/override-etc-default/build.sbt | 6 ++-- src/sbt-test/debian/override-etc-default/test | 2 +- .../override-loader-functions/build.sbt | 2 +- .../debian/override-loader-functions/test | 2 +- .../override-start-script-systemd/build.sbt | 6 ++-- .../debian/override-start-script-systemd/test | 2 +- .../override-start-script-systemv/build.sbt | 6 ++-- .../debian/override-start-script-systemv/test | 2 +- .../override-start-script-upstart/build.sbt | 6 ++-- .../debian/override-start-script-upstart/test | 2 +- src/sbt-test/debian/systemd-deb/build.sbt | 8 ++--- src/sbt-test/debian/systemd-deb/test | 8 ++--- src/sbt-test/debian/sysvinit-deb/build.sbt | 8 ++--- src/sbt-test/debian/sysvinit-deb/test | 8 ++--- .../sysvinit-stoptimeouts-deb/build.sbt | 4 +-- .../debian/sysvinit-stoptimeouts-deb/test | 4 +-- .../test-executableScriptName/build.sbt | 2 +- .../debian/test-executableScriptName/test | 2 +- src/sbt-test/debian/test-mapping/build.sbt | 2 +- src/sbt-test/debian/test-mapping/test | 2 +- .../debian/test-packageName/build.sbt | 2 +- src/sbt-test/debian/test-packageName/test | 2 +- .../debian/upstart-deb-facilities/build.sbt | 2 +- .../debian/upstart-deb-facilities/test | 2 +- src/sbt-test/debian/upstart-deb/build.sbt | 12 +++---- src/sbt-test/debian/upstart-deb/test | 10 +++--- .../test-executableScriptName/build.sbt | 2 +- .../docker/test-executableScriptName/test | 2 +- .../test-packageName-universal/build.sbt | 2 +- .../docker/test-packageName-universal/test | 2 +- .../docker/test-packageName/build.sbt | 2 +- src/sbt-test/docker/test-packageName/test | 2 +- src/sbt-test/jar/classpath-jar/build.sbt | 6 ++-- src/sbt-test/jar/classpath-jar/test | 4 +-- .../jar/launcher-jar with spaces/build.sbt | 6 ++-- .../jar/launcher-jar with spaces/test | 4 +-- src/sbt-test/jar/launcher-jar/build.sbt | 6 ++-- src/sbt-test/jar/launcher-jar/test | 4 +-- src/sbt-test/rpm/changelog-test/build.sbt | 2 +- src/sbt-test/rpm/changelog-test/test | 4 +-- src/sbt-test/rpm/config-no-replace/build.sbt | 2 +- .../rpm/override-loader-functions/build.sbt | 2 +- .../rpm/override-loader-functions/test | 2 +- .../override-start-script-systemd/build.sbt | 2 +- .../override-start-script-systemv/build.sbt | 2 +- .../override-start-script-upstart/build.sbt | 2 +- src/sbt-test/rpm/path-override-rpm/build.sbt | 4 +-- src/sbt-test/rpm/path-override-rpm/test | 2 +- .../rpm/scriplets-no-javarepack-rpm/build.sbt | 2 +- .../rpm/scriplets-no-javarepack-rpm/test | 2 +- .../scriplets-use-javarepack-rpm/build.sbt | 2 +- .../rpm/scriplets-use-javarepack-rpm/test | 2 +- .../scriptlets-override-build-rpm/build.sbt | 2 +- .../rpm/scriptlets-override-build-rpm/test | 4 +-- .../rpm/scriptlets-override-rpm/build.sbt | 4 +-- src/sbt-test/rpm/scriptlets-override-rpm/test | 4 +-- src/sbt-test/rpm/scriptlets-rpm/build.sbt | 6 ++-- src/sbt-test/rpm/scriptlets-rpm/test | 6 ++-- src/sbt-test/rpm/setarch-rpm/build.sbt | 6 ++-- src/sbt-test/rpm/setarch-rpm/test | 2 +- src/sbt-test/rpm/snapshot-rpm/build.sbt | 3 +- src/sbt-test/rpm/snapshot-rpm/test | 2 +- src/sbt-test/rpm/systemd-rpm/build.sbt | 6 ++-- src/sbt-test/rpm/systemd-rpm/test | 4 +-- src/sbt-test/rpm/sysvinit-rpm/build.sbt | 10 +++--- src/sbt-test/rpm/sysvinit-rpm/test | 12 +++---- .../rpm/test-executableScriptName/build.sbt | 4 +-- .../rpm/test-executableScriptName/test | 2 +- src/sbt-test/rpm/test-packageName/build.sbt | 2 +- src/sbt-test/rpm/test-packageName/test | 2 +- .../multiproject-classifiers/build.sbt | 2 +- .../multiproject-java-app-archetype/build.sbt | 34 ------------------- .../project/plugins.sbt | 1 - .../multiproject-java-app-archetype/test | 7 ---- src/sbt-test/universal/publish/build.sbt | 11 +++--- .../universal/staging-custom-main/build.sbt | 4 +-- .../test-executableScriptName/build.sbt | 2 ++ .../universal/test-mapping-helpers/build.sbt | 2 +- src/sbt-test/universal/test-packageName/test | 4 +-- .../universal/test-zips-no-top-level-dir/test | 4 +-- src/sbt-test/universal/test-zips/test | 4 +-- .../windows/absolute-path-in-bat/build.sbt | 2 +- .../windows/absolute-path-in-bat/test | 2 +- .../windows/java-app-archetype/build.sbt | 6 ++-- src/sbt-test/windows/java-app-archetype/test | 2 +- src/sbt-test/windows/multiple-apps/build.sbt | 12 +++---- src/sbt-test/windows/multiple-apps/test | 4 +-- .../windows/test-bat-template/build.sbt | 6 ++-- src/sbt-test/windows/test-bat-template/test | 2 +- .../windows/test-custom-main/build.sbt | 8 ++--- src/sbt-test/windows/test-custom-main/test | 4 +-- 142 files changed, 268 insertions(+), 288 deletions(-) delete mode 100644 src/sbt-test/universal/multiproject-java-app-archetype/build.sbt delete mode 100644 src/sbt-test/universal/multiproject-java-app-archetype/project/plugins.sbt delete mode 100644 src/sbt-test/universal/multiproject-java-app-archetype/test diff --git a/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/Compat.scala b/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/Compat.scala index 9660334c3..f5d177289 100644 --- a/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/Compat.scala +++ b/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/Compat.scala @@ -5,7 +5,6 @@ import sbt.{BufferedLogger, FullLogger, Logger} import scala.sys.process.ProcessLogger object Compat { - object io /** * Used in: diff --git a/src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/Compat.scala b/src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/Compat.scala index f9da55b73..63e7e31e4 100644 --- a/src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/Compat.scala +++ b/src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/Compat.scala @@ -13,14 +13,17 @@ object Compat { type InlineConfiguration = ilm.InlineConfiguration val InlineConfiguration = ilm.InlineConfiguration - object io {} - /** * Used in * - [[com.typesafe.sbt.packager.archetypes.JavaAppPackaging]] */ type BuildDependencies = InternalBuildDependencies + /** + * + */ + type Process = sys.process.Process + /** * Used in * - [[com.typesafe.sbt.packager.docker.DockerPlugin]] diff --git a/src/sbt-test/ash/memory-settings/build.sbt b/src/sbt-test/ash/memory-settings/build.sbt index 966f92642..6ed40b374 100644 --- a/src/sbt-test/ash/memory-settings/build.sbt +++ b/src/sbt-test/ash/memory-settings/build.sbt @@ -13,9 +13,9 @@ TaskKey[Unit]("script-check") := { assert(options contains """addJava "-Xmx64m"""", "Script doesn't contain xms setting:\n" + options) } -TaskKey[Unit]("run-check") := { +TaskKey[Unit]("runCheck") := { val cwd = (stagingDirectory in Universal).value val cmd = Seq((cwd / "bin" / packageName.value).getAbsolutePath) - val memory = (Process(cmd, cwd).!!).replaceAll("\n", "") + val memory = (sys.process.Process(cmd, cwd).!!).replaceAll("\n", "") assert(memory.toLong <= 64, "Runtime memory is bigger then 64m < " + memory + "m") } diff --git a/src/sbt-test/ash/memory-settings/test b/src/sbt-test/ash/memory-settings/test index 10f7ae9c4..892e86baf 100644 --- a/src/sbt-test/ash/memory-settings/test +++ b/src/sbt-test/ash/memory-settings/test @@ -2,4 +2,4 @@ > stage $ exists target/universal/stage/bin/simple-app > script-check -> run-check \ No newline at end of file +> runCheck \ No newline at end of file diff --git a/src/sbt-test/ash/override-templates/build.sbt b/src/sbt-test/ash/override-templates/build.sbt index bc226f2c7..0d3f9c883 100644 --- a/src/sbt-test/ash/override-templates/build.sbt +++ b/src/sbt-test/ash/override-templates/build.sbt @@ -8,7 +8,7 @@ version := "0.1.0" bashScriptTemplateLocation := baseDirectory.value / "custom-templates" / "custom-ash-template" -TaskKey[Unit]("run-check-ash") := { +TaskKey[Unit]("runCheckAsh") := { val cwd = (stagingDirectory in Universal).value val source = scala.io.Source.fromFile((cwd / "bin" / packageName.value).getAbsolutePath) diff --git a/src/sbt-test/ash/override-templates/test b/src/sbt-test/ash/override-templates/test index aa3b5ad81..8298132fb 100644 --- a/src/sbt-test/ash/override-templates/test +++ b/src/sbt-test/ash/override-templates/test @@ -1,3 +1,3 @@ # Run the staging and check the script. > stage -> run-check-ash +> runCheckAsh diff --git a/src/sbt-test/ash/simple-app/build.sbt b/src/sbt-test/ash/simple-app/build.sbt index f376d12b0..c0abd383e 100644 --- a/src/sbt-test/ash/simple-app/build.sbt +++ b/src/sbt-test/ash/simple-app/build.sbt @@ -6,9 +6,9 @@ name := "simple-app" version := "0.1.0" -TaskKey[Unit]("run-check") := { +TaskKey[Unit]("runCheck") := { val cwd = (stagingDirectory in Universal).value val cmd = Seq((cwd / "bin" / packageName.value).getAbsolutePath) - val output = Process(cmd, cwd).!! + val output = sys.process.Process(cmd, cwd).!! assert(output contains "SUCCESS!", "Output didn't contain success: " + output) } diff --git a/src/sbt-test/ash/simple-app/test b/src/sbt-test/ash/simple-app/test index 877989c06..61dad9b64 100644 --- a/src/sbt-test/ash/simple-app/test +++ b/src/sbt-test/ash/simple-app/test @@ -1,3 +1,3 @@ # Run the staging and check the script. > stage -> run-check \ No newline at end of file +> runCheck \ No newline at end of file diff --git a/src/sbt-test/bash/absolute-path-in-bash/build.sbt b/src/sbt-test/bash/absolute-path-in-bash/build.sbt index e18051fb8..14889eb81 100644 --- a/src/sbt-test/bash/absolute-path-in-bash/build.sbt +++ b/src/sbt-test/bash/absolute-path-in-bash/build.sbt @@ -6,7 +6,7 @@ version := "0.1.0" scriptClasspath in bashScriptDefines ++= Seq("/dummy/absolute/path", "relative/path") -TaskKey[Unit]("run-check") := { +TaskKey[Unit]("runCheck") := { val dir = (stagingDirectory in Universal).value val bash = IO.read(dir / "bin" / "absolute-path-in-bash") diff --git a/src/sbt-test/bash/absolute-path-in-bash/test b/src/sbt-test/bash/absolute-path-in-bash/test index 877989c06..61dad9b64 100644 --- a/src/sbt-test/bash/absolute-path-in-bash/test +++ b/src/sbt-test/bash/absolute-path-in-bash/test @@ -1,3 +1,3 @@ # Run the staging and check the script. > stage -> run-check \ No newline at end of file +> runCheck \ No newline at end of file diff --git a/src/sbt-test/bash/java-home-var-expansion/build.sbt b/src/sbt-test/bash/java-home-var-expansion/build.sbt index 9339c73c0..a4e6e7c5e 100644 --- a/src/sbt-test/bash/java-home-var-expansion/build.sbt +++ b/src/sbt-test/bash/java-home-var-expansion/build.sbt @@ -8,11 +8,11 @@ version := "0.1.0" javaOptions in Universal ++= Seq("-java-home ${app_home}/../jre") -TaskKey[Unit]("run-check") := { +TaskKey[Unit]("runCheck") := { val cwd = (stagingDirectory in Universal).value // Don't check for java but it will fail since the jre is not in place val cmd = Seq((cwd / "bin" / packageName.value).getAbsolutePath, "-v", "-no-version-check") - val output = Process(cmd, cwd).lines_! + val output = sys.process.Process(cmd, cwd).lines_! val outStr = output.mkString("\n") // Check that ${app_home} has been substitued assert(outStr.contains("stage/bin/../jre/bin/java"), "Output didn't contain success: " + output) diff --git a/src/sbt-test/bash/java-home-var-expansion/test b/src/sbt-test/bash/java-home-var-expansion/test index 877989c06..61dad9b64 100644 --- a/src/sbt-test/bash/java-home-var-expansion/test +++ b/src/sbt-test/bash/java-home-var-expansion/test @@ -1,3 +1,3 @@ # Run the staging and check the script. > stage -> run-check \ No newline at end of file +> runCheck \ No newline at end of file diff --git a/src/sbt-test/bash/memory-settings/build.sbt b/src/sbt-test/bash/memory-settings/build.sbt index 502b20b1c..e3c99af93 100644 --- a/src/sbt-test/bash/memory-settings/build.sbt +++ b/src/sbt-test/bash/memory-settings/build.sbt @@ -15,9 +15,9 @@ TaskKey[Unit]("jvmopts-check") := { assert(options contains "-J-Xms64m", "Options don't contain xms setting:\n" + options) } -TaskKey[Unit]("run-check") := { +TaskKey[Unit]("runCheck") := { val cwd = (stagingDirectory in Universal).value val cmd = Seq((cwd / "bin" / packageName.value).getAbsolutePath) - val memory = (Process(cmd, cwd).!!).replaceAll("\n", "") + val memory = (sys.process.Process(cmd, cwd).!!).replaceAll("\n", "") assert(memory.toLong <= 64, "Runtime memory is bigger then 64m < " + memory + "m") } diff --git a/src/sbt-test/bash/memory-settings/test b/src/sbt-test/bash/memory-settings/test index a2fad512b..719ec9e01 100644 --- a/src/sbt-test/bash/memory-settings/test +++ b/src/sbt-test/bash/memory-settings/test @@ -2,4 +2,4 @@ > stage $ exists target/universal/stage/conf/application.ini > jvmopts-check -> run-check \ No newline at end of file +> runCheck \ No newline at end of file diff --git a/src/sbt-test/bash/multiple-apps/build.sbt b/src/sbt-test/bash/multiple-apps/build.sbt index 3ea056873..82bd84544 100644 --- a/src/sbt-test/bash/multiple-apps/build.sbt +++ b/src/sbt-test/bash/multiple-apps/build.sbt @@ -5,30 +5,30 @@ enablePlugins(JavaAppPackaging) name := "test-project" version := "0.1.0" -TaskKey[Unit]("check-no-explicit-main") := { +TaskKey[Unit]("checkNoExplicitMain") := { val cwd = (stagingDirectory in Universal).value // check MainApp val cmd = Seq((cwd / "bin" / "main-app").getAbsolutePath) - val output = Process(cmd, cwd).!!.replaceAll("\n", "") + val output = sys.process.Process(cmd, cwd).!!.replaceAll("\n", "") assert(output == "MainApp", s"Output wasn't 'MainApp', but '$output'") // check SecondApp val cmdSecond = Seq((cwd / "bin" / "second-app").getAbsolutePath) - val outputSecond = Process(cmdSecond, cwd).!!.replaceAll("\n", "") + val outputSecond = sys.process.Process(cmdSecond, cwd).!!.replaceAll("\n", "") assert(outputSecond == "SecondApp", s"Output wasn't 'SecondApp': '$outputSecond'") } -TaskKey[Unit]("check-explicit-main") := { +TaskKey[Unit]("checkExplicitMain") := { val cwd = (stagingDirectory in Universal).value // check default start script val cmd = Seq((cwd / "bin" / executableScriptName.value).getAbsolutePath) - val output = Process(cmd, cwd).!!.replaceAll("\n", "") + val output = sys.process.Process(cmd, cwd).!!.replaceAll("\n", "") assert(output == "MainApp", s"Output wasn't 'MainApp', but '$output'") // check SecondApp val cmdSecond = Seq((cwd / "bin" / "second-app").getAbsolutePath) - val outputSecond = Process(cmdSecond, cwd).!!.replaceAll("\n", "") + val outputSecond = sys.process.Process(cmdSecond, cwd).!!.replaceAll("\n", "") assert(outputSecond == "SecondApp", s"Output wasn't 'SecondApp', but '$outputSecond'") } diff --git a/src/sbt-test/bash/multiple-apps/test b/src/sbt-test/bash/multiple-apps/test index 8da612206..ad1a3b65f 100644 --- a/src/sbt-test/bash/multiple-apps/test +++ b/src/sbt-test/bash/multiple-apps/test @@ -2,10 +2,10 @@ > stage $ exists target/universal/stage/bin/main-app $ exists target/universal/stage/bin/second-app -> check-no-explicit-main +> checkNoExplicitMain > clean > set mainClass in Compile := Some("com.example.MainApp") > stage $ exists target/universal/stage/bin/test-project $ exists target/universal/stage/bin/second-app -> check-explicit-main \ No newline at end of file +> checkExplicitMain \ No newline at end of file diff --git a/src/sbt-test/bash/override-templates/build.sbt b/src/sbt-test/bash/override-templates/build.sbt index c39b09d2a..ad357cbe2 100644 --- a/src/sbt-test/bash/override-templates/build.sbt +++ b/src/sbt-test/bash/override-templates/build.sbt @@ -10,7 +10,7 @@ bashScriptTemplateLocation := baseDirectory.value / "custom-templates" / "custom batScriptTemplateLocation := baseDirectory.value / "custom-templates" / "custom-bat-template" -TaskKey[Unit]("run-check-bash") := { +TaskKey[Unit]("runCheckBash") := { val cwd = (stagingDirectory in Universal).value val source = scala.io.Source.fromFile((cwd / "bin" / packageName.value).getAbsolutePath) @@ -22,7 +22,7 @@ TaskKey[Unit]("run-check-bash") := { ) } -TaskKey[Unit]("run-check-bat") := { +TaskKey[Unit]("runCheckBat") := { val cwd = (stagingDirectory in Universal).value val batFilename = packageName.value + ".bat" val source = diff --git a/src/sbt-test/bash/override-templates/test b/src/sbt-test/bash/override-templates/test index cdb9e6f43..b6c59d91d 100644 --- a/src/sbt-test/bash/override-templates/test +++ b/src/sbt-test/bash/override-templates/test @@ -1,4 +1,4 @@ # Run the staging and check the script. > stage -> run-check-bash -> run-check-bat \ No newline at end of file +> runCheckBash +> runCheckBat \ No newline at end of file diff --git a/src/sbt-test/bash/simple-app/build.sbt b/src/sbt-test/bash/simple-app/build.sbt index ee9c54e99..ed77e00c9 100644 --- a/src/sbt-test/bash/simple-app/build.sbt +++ b/src/sbt-test/bash/simple-app/build.sbt @@ -6,9 +6,9 @@ name := "simple-app" version := "0.1.0" -TaskKey[Unit]("run-check") := { +TaskKey[Unit]("runCheck") := { val cwd = (stagingDirectory in Universal).value val cmd = Seq((cwd / "bin" / packageName.value).getAbsolutePath) - val output = Process(cmd, cwd).!! + val output = sys.process.Process(cmd, cwd).!! assert(output contains "SUCCESS!", "Output didn't contain success: " + output) } diff --git a/src/sbt-test/bash/simple-app/test b/src/sbt-test/bash/simple-app/test index 877989c06..61dad9b64 100644 --- a/src/sbt-test/bash/simple-app/test +++ b/src/sbt-test/bash/simple-app/test @@ -1,3 +1,3 @@ # Run the staging and check the script. > stage -> run-check \ No newline at end of file +> runCheck \ No newline at end of file diff --git a/src/sbt-test/cygwin/java-app-archetype/build.sbt b/src/sbt-test/cygwin/java-app-archetype/build.sbt index b95c8d9a0..9a62f1cd9 100644 --- a/src/sbt-test/cygwin/java-app-archetype/build.sbt +++ b/src/sbt-test/cygwin/java-app-archetype/build.sbt @@ -6,7 +6,7 @@ name := "windows-test" version := "0.1.0" -TaskKey[Unit]("check-cygwin-script") := { +TaskKey[Unit]("checkCygwinScript") := { val dir = (stagingDirectory in Universal).value // TODO - FIx our cygwin detection! val cygwinBash = file("C:\\cygwin\\bin\\bash.exe") @@ -20,12 +20,12 @@ TaskKey[Unit]("check-cygwin-script") := { val pathEnv = "C:\\cygwin\\bin" val cmd = Seq(cygwinBash.getAbsolutePath, cygdriveScriptPath, "-d") val result = - Process(cmd, Some(dir), "PATH" -> pathEnv) ! streams.value.log match { + sys.process.Process(cmd, Some(dir), "PATH" -> pathEnv) ! streams.value.log match { case 0 => () case n => sys.error("Failed to run script: " + cygdriveScriptPath + " error code: " + n) } - val output = Process(cmd, Some(dir), "PATH" -> pathEnv).!! + val output = sys.process.Process(cmd, Some(dir), "PATH" -> pathEnv).!! val expected = "SUCCESS!" assert( output contains expected, diff --git a/src/sbt-test/cygwin/java-app-archetype/test b/src/sbt-test/cygwin/java-app-archetype/test index eaa29c548..55ca8cd07 100644 --- a/src/sbt-test/cygwin/java-app-archetype/test +++ b/src/sbt-test/cygwin/java-app-archetype/test @@ -1,4 +1,4 @@ # Run the staging and check the script. > stage $ exists target/universal/stage/bin/windows-test -> check-cygwin-script +> checkCygwinScript diff --git a/src/sbt-test/debian/daemon-group-gid-deb/build.sbt b/src/sbt-test/debian/daemon-group-gid-deb/build.sbt index f512f9c27..625843d1c 100644 --- a/src/sbt-test/debian/daemon-group-gid-deb/build.sbt +++ b/src/sbt-test/debian/daemon-group-gid-deb/build.sbt @@ -14,7 +14,7 @@ packageSummary := "Test debian package" packageDescription := """A fun package description of our software, with multiple lines.""" -TaskKey[Unit]("check-control-files") := { +TaskKey[Unit]("checkControlFiles") := { val debian = target.value / "debian-test-0.1.0" / "DEBIAN" val postinst = IO.read(debian / "postinst") val postrm = IO.read(debian / "postrm") diff --git a/src/sbt-test/debian/daemon-group-gid-deb/test b/src/sbt-test/debian/daemon-group-gid-deb/test index 1035fe56f..73243d7f0 100644 --- a/src/sbt-test/debian/daemon-group-gid-deb/test +++ b/src/sbt-test/debian/daemon-group-gid-deb/test @@ -9,4 +9,4 @@ $ exists target/debian-test-0.1.0/DEBIAN/prerm $ exists target/debian-test-0.1.0/DEBIAN/postinst # Check files for defaults -> check-control-files +> checkControlFiles diff --git a/src/sbt-test/debian/daemon-user-deb/build.sbt b/src/sbt-test/debian/daemon-user-deb/build.sbt index ecbd67f7e..01b6e19a8 100644 --- a/src/sbt-test/debian/daemon-user-deb/build.sbt +++ b/src/sbt-test/debian/daemon-user-deb/build.sbt @@ -13,7 +13,7 @@ packageSummary := "Test debian package" packageDescription := """A fun package description of our software, with multiple lines.""" -TaskKey[Unit]("check-control-files") := { +TaskKey[Unit]("checkControlFiles") := { val debian = target.value / "debian-test-0.1.0" / "DEBIAN" val postinst = IO.read(debian / "postinst") val postrm = IO.read(debian / "postrm") diff --git a/src/sbt-test/debian/daemon-user-deb/test b/src/sbt-test/debian/daemon-user-deb/test index 003a99569..003fb4e70 100644 --- a/src/sbt-test/debian/daemon-user-deb/test +++ b/src/sbt-test/debian/daemon-user-deb/test @@ -7,4 +7,4 @@ $ exists target/debian-test-0.1.0/DEBIAN/prerm $ exists target/debian-test-0.1.0/DEBIAN/postinst # Check files for defaults -> check-control-files +> checkControlFiles diff --git a/src/sbt-test/debian/daemon-user-shell-deb/build.sbt b/src/sbt-test/debian/daemon-user-shell-deb/build.sbt index cbd02e9be..e6c1c139f 100644 --- a/src/sbt-test/debian/daemon-user-shell-deb/build.sbt +++ b/src/sbt-test/debian/daemon-user-shell-deb/build.sbt @@ -14,7 +14,7 @@ packageSummary := "Test debian package" packageDescription := """A fun package description of our software, with multiple lines.""" -TaskKey[Unit]("check-control-files") := { +TaskKey[Unit]("checkControlFiles") := { val debian = target.value / "debian-test-0.1.0" / "DEBIAN" val postinst = IO.read(debian / "postinst") val postrm = IO.read(debian / "postrm") diff --git a/src/sbt-test/debian/daemon-user-shell-deb/test b/src/sbt-test/debian/daemon-user-shell-deb/test index 003a99569..003fb4e70 100644 --- a/src/sbt-test/debian/daemon-user-shell-deb/test +++ b/src/sbt-test/debian/daemon-user-shell-deb/test @@ -7,4 +7,4 @@ $ exists target/debian-test-0.1.0/DEBIAN/prerm $ exists target/debian-test-0.1.0/DEBIAN/postinst # Check files for defaults -> check-control-files +> checkControlFiles diff --git a/src/sbt-test/debian/daemon-user-uid-deb/build.sbt b/src/sbt-test/debian/daemon-user-uid-deb/build.sbt index b7462ec46..f582f1668 100644 --- a/src/sbt-test/debian/daemon-user-uid-deb/build.sbt +++ b/src/sbt-test/debian/daemon-user-uid-deb/build.sbt @@ -14,7 +14,7 @@ packageSummary := "Test debian package" packageDescription := """A fun package description of our software, with multiple lines.""" -TaskKey[Unit]("check-control-files") := { +TaskKey[Unit]("checkControlFiles") := { val debian = target.value / "debian-test-0.1.0" / "DEBIAN" val postinst = IO.read(debian / "postinst") val postrm = IO.read(debian / "postrm") diff --git a/src/sbt-test/debian/daemon-user-uid-deb/test b/src/sbt-test/debian/daemon-user-uid-deb/test index e4b371abd..7202c351f 100644 --- a/src/sbt-test/debian/daemon-user-uid-deb/test +++ b/src/sbt-test/debian/daemon-user-uid-deb/test @@ -9,4 +9,4 @@ $ exists target/debian-test-0.1.0/DEBIAN/prerm $ exists target/debian-test-0.1.0/DEBIAN/postinst # Check files for defaults -> check-control-files +> checkControlFiles diff --git a/src/sbt-test/debian/gen-changes/test b/src/sbt-test/debian/gen-changes/test index 52747abec..8f0203842 100644 --- a/src/sbt-test/debian/gen-changes/test +++ b/src/sbt-test/debian/gen-changes/test @@ -1,4 +1,4 @@ # Run the debian packaging. -> debian:gen-changes +> debian:genChanges $ exists target/debian-test_0.1.0_all.deb $ exists target/debian-test_0.1.0_all.changes \ No newline at end of file diff --git a/src/sbt-test/debian/java-app-archetype/build.sbt b/src/sbt-test/debian/java-app-archetype/build.sbt index c7b8bb15b..c523ece07 100644 --- a/src/sbt-test/debian/java-app-archetype/build.sbt +++ b/src/sbt-test/debian/java-app-archetype/build.sbt @@ -17,7 +17,7 @@ debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11) debianPackageRecommends in Debian += "git" -TaskKey[Unit]("check-script") := { +TaskKey[Unit]("checkScript") := { val dir = (stagingDirectory in Universal).value val script = dir / "bin" / name.value System.out.synchronized { @@ -30,19 +30,19 @@ TaskKey[Unit]("check-script") := { } val cmd = "bash " + script.getAbsolutePath + " -d" val result = - Process(cmd) ! streams.value.log match { + sys.process.Process(cmd) ! streams.value.log match { case 0 => () case n => sys.error("Failed to run script: " + script.getAbsolutePath + " error code: " + n) } - val output = Process("bash " + script.getAbsolutePath).!! + val output = sys.process.Process("bash " + script.getAbsolutePath).!! val expected = "SUCCESS!" assert( output contains expected, "Failed to correctly run the main script!. Found [" + output + "] wanted [" + expected + "]" ) val expected2 = "Something with spaces" - val output2 = Process(Seq("bash", script.getAbsolutePath, "-Dresult.string=" + expected2)).!! + val output2 = sys.process.Process(Seq("bash", script.getAbsolutePath, "-Dresult.string=" + expected2)).!! assert( output2 contains expected2, "Failed to correctly run the main script with spaced java args!. Found [" + output2 + "] wanted [" + expected2 + "]" diff --git a/src/sbt-test/debian/java-app-archetype/test b/src/sbt-test/debian/java-app-archetype/test index 48074d526..b25902514 100644 --- a/src/sbt-test/debian/java-app-archetype/test +++ b/src/sbt-test/debian/java-app-archetype/test @@ -3,4 +3,4 @@ $ exists target/debian-test_0.1.0_all.deb > stage $ exists target/universal/stage/bin/debian-test -> check-script +> checkScript diff --git a/src/sbt-test/debian/jdeb-conflicts/build.sbt b/src/sbt-test/debian/jdeb-conflicts/build.sbt index 004dd944e..6b38fc1f6 100644 --- a/src/sbt-test/debian/jdeb-conflicts/build.sbt +++ b/src/sbt-test/debian/jdeb-conflicts/build.sbt @@ -13,9 +13,11 @@ packageDescription := """A fun package description of our software, debianPackageConflicts in Debian := Seq("debian-test-package") -TaskKey[Unit]("check-conflicts") := { +TaskKey[Unit]("checkConflicts") := { val extracted = target.value / "extracted" - Seq("dpkg-deb", "-R", (target.value / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).! + sys.process + .Process(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:")) diff --git a/src/sbt-test/debian/jdeb-conflicts/test b/src/sbt-test/debian/jdeb-conflicts/test index af775b07d..818f071f1 100644 --- a/src/sbt-test/debian/jdeb-conflicts/test +++ b/src/sbt-test/debian/jdeb-conflicts/test @@ -2,4 +2,4 @@ $ mkdir src/resources/empty > debian:packageBin $ exists target/debian-test_0.1.0_all.deb -> check-conflicts +> checkConflicts diff --git a/src/sbt-test/debian/jdeb-dependencies/build.sbt b/src/sbt-test/debian/jdeb-dependencies/build.sbt index 3e596ce12..70f4bbaaf 100644 --- a/src/sbt-test/debian/jdeb-dependencies/build.sbt +++ b/src/sbt-test/debian/jdeb-dependencies/build.sbt @@ -13,9 +13,11 @@ packageDescription := """A fun package description of our software, debianPackageDependencies in Debian := Seq() -TaskKey[Unit]("check-dependencies") := { +TaskKey[Unit]("checkDependencies") := { val extracted = target.value / "extracted" - Seq("dpkg-deb", "-R", (target.value / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).! + sys.process + .Process(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:")) diff --git a/src/sbt-test/debian/jdeb-dependencies/test b/src/sbt-test/debian/jdeb-dependencies/test index 9184bc855..294a72b2b 100644 --- a/src/sbt-test/debian/jdeb-dependencies/test +++ b/src/sbt-test/debian/jdeb-dependencies/test @@ -2,4 +2,4 @@ $ mkdir src/resources/empty > debian:packageBin $ exists target/debian-test_0.1.0_all.deb -> check-dependencies +> checkDependencies diff --git a/src/sbt-test/debian/jdeb-dir-mappings/build.sbt b/src/sbt-test/debian/jdeb-dir-mappings/build.sbt index cd41a8c86..4b6ab058e 100644 --- a/src/sbt-test/debian/jdeb-dir-mappings/build.sbt +++ b/src/sbt-test/debian/jdeb-dir-mappings/build.sbt @@ -23,10 +23,12 @@ linuxPackageMappings in Debian += packageDirectoryAndContentsMapping( (baseDirectory.value / "src" / "resources" / "empty") -> "/var/empty" ) -TaskKey[Unit]("check-dir-mappings") := { +TaskKey[Unit]("checkDirMappings") := { // val tmpDir = java.nio.file.Files.createTempDirectory("jdeb") val extracted = file("/tmp/jdeb" + System.currentTimeMillis().toString) - Seq("dpkg-deb", "-R", (target.value / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).! + sys.process + .Process(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") diff --git a/src/sbt-test/debian/jdeb-dir-mappings/test b/src/sbt-test/debian/jdeb-dir-mappings/test index 91dacb0b4..acb8becd4 100644 --- a/src/sbt-test/debian/jdeb-dir-mappings/test +++ b/src/sbt-test/debian/jdeb-dir-mappings/test @@ -2,4 +2,4 @@ $ mkdir src/resources/empty > debian:packageBin $ exists target/debian-test_0.1.0_all.deb -> check-dir-mappings +> checkDirMappings diff --git a/src/sbt-test/debian/jdeb-provides/build.sbt b/src/sbt-test/debian/jdeb-provides/build.sbt index 376bcb205..13779921e 100644 --- a/src/sbt-test/debian/jdeb-provides/build.sbt +++ b/src/sbt-test/debian/jdeb-provides/build.sbt @@ -13,9 +13,11 @@ packageDescription := """A fun package description of our software, debianPackageProvides in Debian := Seq("debian-test-package") -TaskKey[Unit]("check-provides") := { +TaskKey[Unit]("checkProvides") := { val extracted = target.value / "extracted" - Seq("dpkg-deb", "-R", (target.value / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).! + sys.process + .Process(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:")) diff --git a/src/sbt-test/debian/jdeb-provides/test b/src/sbt-test/debian/jdeb-provides/test index 1267d5f13..50fd554cd 100644 --- a/src/sbt-test/debian/jdeb-provides/test +++ b/src/sbt-test/debian/jdeb-provides/test @@ -2,4 +2,4 @@ $ mkdir src/resources/empty > debian:packageBin $ exists target/debian-test_0.1.0_all.deb -> check-provides +> checkProvides diff --git a/src/sbt-test/debian/jdeb-script-replacements/build.sbt b/src/sbt-test/debian/jdeb-script-replacements/build.sbt index 2f94cd211..9460ad734 100644 --- a/src/sbt-test/debian/jdeb-script-replacements/build.sbt +++ b/src/sbt-test/debian/jdeb-script-replacements/build.sbt @@ -15,11 +15,13 @@ debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11) debianPackageRecommends in Debian += "git" -TaskKey[Unit]("check-control-files") := { +TaskKey[Unit]("checkControlFiles") := { val header = "#!/bin/sh" val extracted = target.value / "extracted" println(extracted.getAbsolutePath) - Seq("dpkg-deb", "-R", (target.value / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).! + sys.process + .Process(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" diff --git a/src/sbt-test/debian/jdeb-script-replacements/test b/src/sbt-test/debian/jdeb-script-replacements/test index 420cbbcf5..d8f8cdefb 100644 --- a/src/sbt-test/debian/jdeb-script-replacements/test +++ b/src/sbt-test/debian/jdeb-script-replacements/test @@ -2,4 +2,4 @@ $ mkdir src/resources/empty > debian:packageBin $ exists target/debian-test_0.1.0_all.deb -> check-control-files +> checkControlFiles diff --git a/src/sbt-test/debian/log-directory/build.sbt b/src/sbt-test/debian/log-directory/build.sbt index e0270d33c..580f330cc 100644 --- a/src/sbt-test/debian/log-directory/build.sbt +++ b/src/sbt-test/debian/log-directory/build.sbt @@ -17,13 +17,13 @@ packageDescription := """A fun package description of our software, defaultLinuxLogsLocation := "/non-standard/log" -InputKey[Unit]("check-softlink") := { +InputKey[Unit]("checkSoftlink") := { import complete.DefaultParsers._ val args = spaceDelimited("").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 + val absolutePath = sys.process.Process("readlink -m " + link).!!.trim assert(link != absolutePath, "Expected symbolic link '" + link + "' does not exist") assert( target == absolutePath, diff --git a/src/sbt-test/debian/log-directory/test b/src/sbt-test/debian/log-directory/test index f8c2e81e5..22bd113b5 100644 --- a/src/sbt-test/debian/log-directory/test +++ b/src/sbt-test/debian/log-directory/test @@ -8,4 +8,4 @@ $ exists target/debian-test-0.1.0/DEBIAN/postinst # Check that the non-standard log directory was used $ exists target/debian-test-0.1.0/non-standard/log/debian-test -> check-softlink target/debian-test-0.1.0/usr/share/debian-test/logs points to /non-standard/log/debian-test +> checkSoftlink target/debian-test-0.1.0/usr/share/debian-test/logs points to /non-standard/log/debian-test diff --git a/src/sbt-test/debian/native-build-compress/build.sbt b/src/sbt-test/debian/native-build-compress/build.sbt index 0a13bb09e..a28e64ccc 100644 --- a/src/sbt-test/debian/native-build-compress/build.sbt +++ b/src/sbt-test/debian/native-build-compress/build.sbt @@ -8,7 +8,7 @@ packageDescription := "Description" packageSummary := "Summary" -TaskKey[Unit]("check-deb-compression") := { +TaskKey[Unit]("checkDebCompression") := { val deb = target.value / s"${(name in Debian).value}_${(version in Debian).value}_all.deb" assert(Seq("ar", "-t", deb.toString).lines.exists(_.startsWith("data.tar."))) // exact extension varies by dpkg-deb version } diff --git a/src/sbt-test/debian/native-build-compress/test b/src/sbt-test/debian/native-build-compress/test index 7e578bfb4..17578066c 100644 --- a/src/sbt-test/debian/native-build-compress/test +++ b/src/sbt-test/debian/native-build-compress/test @@ -1,2 +1,2 @@ > debian:packageBin -> check-deb-compression +> checkDebCompression diff --git a/src/sbt-test/debian/native-build-default/build.sbt b/src/sbt-test/debian/native-build-default/build.sbt index 2edafe946..2c6aa4566 100644 --- a/src/sbt-test/debian/native-build-default/build.sbt +++ b/src/sbt-test/debian/native-build-default/build.sbt @@ -6,7 +6,7 @@ packageDescription := "Description" packageSummary := "Summary" -TaskKey[Unit]("check-deb-compression") := { +TaskKey[Unit]("checkDebCompression") := { val deb = target.value / s"${(name in Debian).value}_${(version in Debian).value}_all.deb" assert(Seq("ar", "-t", deb.toString).lines.contains("data.tar")) } diff --git a/src/sbt-test/debian/native-build-default/test b/src/sbt-test/debian/native-build-default/test index 7e578bfb4..17578066c 100644 --- a/src/sbt-test/debian/native-build-default/test +++ b/src/sbt-test/debian/native-build-default/test @@ -1,2 +1,2 @@ > debian:packageBin -> check-deb-compression +> checkDebCompression diff --git a/src/sbt-test/debian/override-control-files/build.sbt b/src/sbt-test/debian/override-control-files/build.sbt index a943ee690..e4f78a2cc 100644 --- a/src/sbt-test/debian/override-control-files/build.sbt +++ b/src/sbt-test/debian/override-control-files/build.sbt @@ -24,7 +24,7 @@ maintainerScripts in Debian := maintainerScriptsFromDirectory( Seq(Preinst, Postinst, Prerm, Postrm) ) -TaskKey[Unit]("check-control-files") := { +TaskKey[Unit]("checkControlFiles") := { val debian = target.value / "debian-test-0.1.0" / "DEBIAN" val postinst = IO.read(debian / "postinst") val preinst = IO.read(debian / "preinst") diff --git a/src/sbt-test/debian/override-control-files/test b/src/sbt-test/debian/override-control-files/test index 65d9be1f5..4d45545c2 100644 --- a/src/sbt-test/debian/override-control-files/test +++ b/src/sbt-test/debian/override-control-files/test @@ -13,4 +13,4 @@ $ exists target/debian-test-0.1.0/DEBIAN/postrm $ exists target/debian-test-0.1.0/DEBIAN/prerm # Check files for defaults -> check-control-files +> checkControlFiles diff --git a/src/sbt-test/debian/override-etc-default/build.sbt b/src/sbt-test/debian/override-etc-default/build.sbt index 5053e8d6b..d540b7d63 100644 --- a/src/sbt-test/debian/override-etc-default/build.sbt +++ b/src/sbt-test/debian/override-etc-default/build.sbt @@ -20,10 +20,12 @@ packageSummary := "Test debian package" packageDescription := """A fun package description of our software, with multiple lines.""" -TaskKey[Unit]("check-etc-default") := { +TaskKey[Unit]("checkEtcDefault") := { val extracted = target.value / "tmp" / "extracted-package" extracted.mkdirs() - Seq("dpkg-deb", "-R", (target.value / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).! + sys.process + .Process(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( diff --git a/src/sbt-test/debian/override-etc-default/test b/src/sbt-test/debian/override-etc-default/test index 8c5ab3e2c..e89ad9347 100644 --- a/src/sbt-test/debian/override-etc-default/test +++ b/src/sbt-test/debian/override-etc-default/test @@ -3,4 +3,4 @@ $ exists target/debian-test_0.1.0_all.deb # Check files for defaults -> check-etc-default +> checkEtcDefault diff --git a/src/sbt-test/debian/override-loader-functions/build.sbt b/src/sbt-test/debian/override-loader-functions/build.sbt index 51b804d05..8db872a75 100644 --- a/src/sbt-test/debian/override-loader-functions/build.sbt +++ b/src/sbt-test/debian/override-loader-functions/build.sbt @@ -14,7 +14,7 @@ packageSummary := "Test debian package" packageDescription := """A fun package description of our software, with multiple lines.""" -TaskKey[Unit]("check-loader-functions") := { +TaskKey[Unit]("checkLoaderFunctions") := { val extracted = target.value / "tmp" / "extracted-package" extracted.mkdirs() Seq("dpkg-deb", "-e", (target.value / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).! diff --git a/src/sbt-test/debian/override-loader-functions/test b/src/sbt-test/debian/override-loader-functions/test index e6a069cdc..43882b1e9 100644 --- a/src/sbt-test/debian/override-loader-functions/test +++ b/src/sbt-test/debian/override-loader-functions/test @@ -3,4 +3,4 @@ $ exists target/debian-test_0.1.0_all.deb # Check files for defaults -> check-loader-functions +> checkLoaderFunctions diff --git a/src/sbt-test/debian/override-start-script-systemd/build.sbt b/src/sbt-test/debian/override-start-script-systemd/build.sbt index af8065a0a..ed0a18ebe 100644 --- a/src/sbt-test/debian/override-start-script-systemd/build.sbt +++ b/src/sbt-test/debian/override-start-script-systemd/build.sbt @@ -14,10 +14,12 @@ packageSummary := "Test debian package" packageDescription := """A fun package description of our software, with multiple lines.""" -TaskKey[Unit]("check-startup-script") := { +TaskKey[Unit]("checkStartupScript") := { val extracted = target.value / "tmp" / "extracted-package" extracted.mkdirs() - Seq("dpkg-deb", "-R", (target.value / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).! + sys.process + .Process(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") diff --git a/src/sbt-test/debian/override-start-script-systemd/test b/src/sbt-test/debian/override-start-script-systemd/test index baf9b1d9d..176396738 100644 --- a/src/sbt-test/debian/override-start-script-systemd/test +++ b/src/sbt-test/debian/override-start-script-systemd/test @@ -3,4 +3,4 @@ $ exists target/debian-test_0.1.0_all.deb # Check files for defaults -> check-startup-script +> checkStartupScript diff --git a/src/sbt-test/debian/override-start-script-systemv/build.sbt b/src/sbt-test/debian/override-start-script-systemv/build.sbt index 67de20462..f4c37ebde 100644 --- a/src/sbt-test/debian/override-start-script-systemv/build.sbt +++ b/src/sbt-test/debian/override-start-script-systemv/build.sbt @@ -14,10 +14,12 @@ packageSummary := "Test debian package" packageDescription := """A fun package description of our software, with multiple lines.""" -TaskKey[Unit]("check-startup-script") := { +TaskKey[Unit]("checkStartupScript") := { val extracted = target.value / "tmp" / "extracted-package" extracted.mkdirs() - Seq("dpkg-deb", "-R", (target.value / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).! + sys.process + .Process(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") diff --git a/src/sbt-test/debian/override-start-script-systemv/test b/src/sbt-test/debian/override-start-script-systemv/test index baf9b1d9d..176396738 100644 --- a/src/sbt-test/debian/override-start-script-systemv/test +++ b/src/sbt-test/debian/override-start-script-systemv/test @@ -3,4 +3,4 @@ $ exists target/debian-test_0.1.0_all.deb # Check files for defaults -> check-startup-script +> checkStartupScript diff --git a/src/sbt-test/debian/override-start-script-upstart/build.sbt b/src/sbt-test/debian/override-start-script-upstart/build.sbt index 27fc1a50b..39d41c09a 100644 --- a/src/sbt-test/debian/override-start-script-upstart/build.sbt +++ b/src/sbt-test/debian/override-start-script-upstart/build.sbt @@ -14,10 +14,12 @@ packageSummary := "Test debian package" packageDescription := """A fun package description of our software, with multiple lines.""" -TaskKey[Unit]("check-startup-script") := { +TaskKey[Unit]("checkStartupScript") := { val extracted = target.value / "tmp" / "extracted-package" extracted.mkdirs() - Seq("dpkg-deb", "-R", (target.value / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).! + sys.process + .Process(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") diff --git a/src/sbt-test/debian/override-start-script-upstart/test b/src/sbt-test/debian/override-start-script-upstart/test index baf9b1d9d..176396738 100644 --- a/src/sbt-test/debian/override-start-script-upstart/test +++ b/src/sbt-test/debian/override-start-script-upstart/test @@ -3,4 +3,4 @@ $ exists target/debian-test_0.1.0_all.deb # Check files for defaults -> check-startup-script +> checkStartupScript diff --git a/src/sbt-test/debian/systemd-deb/build.sbt b/src/sbt-test/debian/systemd-deb/build.sbt index 5c658d631..5265bb8b4 100644 --- a/src/sbt-test/debian/systemd-deb/build.sbt +++ b/src/sbt-test/debian/systemd-deb/build.sbt @@ -14,7 +14,7 @@ daemonUser in Linux := "testuser" systemdSuccessExitStatus in Debian += "1" -TaskKey[Unit]("check-startup-script") := { +TaskKey[Unit]("checkStartupScript") := { val script = IO.read(target.value / "debian-test-0.1.0" / "lib" / "systemd" / "system" / "debian-test.service") assert(script.contains("Requires=network.target"), "script doesn't contain Default-Start header\n" + script) assert(script.contains("User=testuser"), "script doesn't contain `User` header\n" + script) @@ -27,14 +27,14 @@ TaskKey[Unit]("check-startup-script") := { () } -TaskKey[Unit]("check-etc-default") := { +TaskKey[Unit]("checkEtcDefault") := { val script = IO.read(target.value / "debian-test-0.1.0" / "etc" / "default" / "debian-test") assert(script.contains("systemd"), s"systemd etc-default template wasn't selected; contents are:\n" + script) () } -TaskKey[Unit]("check-autostart") := { +TaskKey[Unit]("checkAutostart") := { val script = IO.read(target.value / "debian-test-0.1.0" / "DEBIAN" / "postinst") assert(script.contains("""addService debian-test || echo "debian-test could not be registered" |startService debian-test || echo "debian-test could not be started" @@ -42,7 +42,7 @@ TaskKey[Unit]("check-autostart") := { () } -TaskKey[Unit]("check-no-autostart") := { +TaskKey[Unit]("checkNoAutostart") := { val script = IO.read(target.value / "debian-test-0.1.0" / "DEBIAN" / "postinst") assert(script.contains("""addService debian-test || echo "debian-test could not be registered" |""".stripMargin), "addService post install commands missing or incorrect") diff --git a/src/sbt-test/debian/systemd-deb/test b/src/sbt-test/debian/systemd-deb/test index 571d9df95..d60eb5712 100644 --- a/src/sbt-test/debian/systemd-deb/test +++ b/src/sbt-test/debian/systemd-deb/test @@ -7,13 +7,13 @@ $ exists target/debian-test-0.1.0/lib/systemd/system/debian-test.service > show debian:linuxStartScriptTemplate > plugins -> check-startup-script -> check-etc-default -> check-autostart +> checkStartupScript +> checkEtcDefault +> checkAutostart # Test that serviceAutostart can be disabled > set every NativePackagerKeys.serviceAutostart := false > debian:packageBin -> check-no-autostart \ No newline at end of file +> checkNoAutostart \ No newline at end of file diff --git a/src/sbt-test/debian/sysvinit-deb/build.sbt b/src/sbt-test/debian/sysvinit-deb/build.sbt index a97d4fd4b..8a62db3e0 100644 --- a/src/sbt-test/debian/sysvinit-deb/build.sbt +++ b/src/sbt-test/debian/sysvinit-deb/build.sbt @@ -21,7 +21,7 @@ requiredStartFacilities in Debian := Some("$test-deb-service") daemonStdoutLogFile := Some("test.log") -TaskKey[Unit]("check-control-files") := { +TaskKey[Unit]("checkControlFiles") := { val header = "#!/bin/sh" val debian = target.value / "debian-test-0.1.0" / "DEBIAN" val postinst = IO.read(debian / "postinst") @@ -34,7 +34,7 @@ TaskKey[Unit]("check-control-files") := { () } -TaskKey[Unit]("check-startup-script") := { +TaskKey[Unit]("checkStartupScript") := { val script = IO.read(target.value / "debian-test-0.1.0" / "etc" / "init.d" / "debian-test") assert(script.contains("# Default-Start: 2 3 4 5"), "script doesn't contain Default-Start header\n" + script) @@ -59,7 +59,7 @@ TaskKey[Unit]("check-startup-script") := { () } -TaskKey[Unit]("check-autostart") := { +TaskKey[Unit]("checkAutostart") := { val script = IO.read(target.value / "debian-test-0.1.0" / "DEBIAN" / "postinst") assert(script.contains("""addService debian-test || echo "debian-test could not be registered" |startService debian-test || echo "debian-test could not be started" @@ -67,7 +67,7 @@ TaskKey[Unit]("check-autostart") := { () } -TaskKey[Unit]("check-no-autostart") := { +TaskKey[Unit]("checkNoAutostart") := { val script = IO.read(target.value / "debian-test-0.1.0" / "DEBIAN" / "postinst") assert(script.contains("""addService debian-test || echo "debian-test could not be registered" |""".stripMargin), "addService post install commands missing or incorrect") diff --git a/src/sbt-test/debian/sysvinit-deb/test b/src/sbt-test/debian/sysvinit-deb/test index cff49d90d..941f6cae4 100644 --- a/src/sbt-test/debian/sysvinit-deb/test +++ b/src/sbt-test/debian/sysvinit-deb/test @@ -6,12 +6,12 @@ $ exists target/debian-test-0.1.0/etc $ exists target/debian-test-0.1.0/etc/default/debian-test $ exists target/debian-test-0.1.0/etc/init.d/debian-test -> check-control-files -> check-startup-script -> check-autostart +> checkControlFiles +> checkStartupScript +> checkAutostart # Test that serviceAutostart can be disabled > set every NativePackagerKeys.serviceAutostart := false > debian:packageBin -> check-no-autostart \ No newline at end of file +> checkNoAutostart \ No newline at end of file diff --git a/src/sbt-test/debian/sysvinit-stoptimeouts-deb/build.sbt b/src/sbt-test/debian/sysvinit-stoptimeouts-deb/build.sbt index 27cf2ceac..cc6b8b919 100644 --- a/src/sbt-test/debian/sysvinit-stoptimeouts-deb/build.sbt +++ b/src/sbt-test/debian/sysvinit-stoptimeouts-deb/build.sbt @@ -23,7 +23,7 @@ termTimeout in Debian := 10 killTimeout in Debian := 20 -TaskKey[Unit]("check-control-files") := { +TaskKey[Unit]("checkControlFiles") := { val header = "#!/bin/sh" val debian = target.value / "debian-test-0.1.0" / "DEBIAN" val postinst = IO.read(debian / "postinst") @@ -36,7 +36,7 @@ TaskKey[Unit]("check-control-files") := { () } -TaskKey[Unit]("check-startup-script") := { +TaskKey[Unit]("checkStartupScript") := { val script = IO.read(target.value / "debian-test-0.1.0" / "etc" / "init.d" / "debian-test") assert(script.contains("# Default-Start: 2 3 4 5"), "script doesn't contain Default-Start header\n" + script) diff --git a/src/sbt-test/debian/sysvinit-stoptimeouts-deb/test b/src/sbt-test/debian/sysvinit-stoptimeouts-deb/test index 1e045eec6..d903aefa5 100644 --- a/src/sbt-test/debian/sysvinit-stoptimeouts-deb/test +++ b/src/sbt-test/debian/sysvinit-stoptimeouts-deb/test @@ -6,5 +6,5 @@ $ exists target/debian-test-0.1.0/etc $ exists target/debian-test-0.1.0/etc/default/debian-test $ exists target/debian-test-0.1.0/etc/init.d/debian-test -> check-control-files -> check-startup-script \ No newline at end of file +> checkControlFiles +> checkStartupScript \ No newline at end of file diff --git a/src/sbt-test/debian/test-executableScriptName/build.sbt b/src/sbt-test/debian/test-executableScriptName/build.sbt index d62b4a896..5d45bfb2d 100644 --- a/src/sbt-test/debian/test-executableScriptName/build.sbt +++ b/src/sbt-test/debian/test-executableScriptName/build.sbt @@ -17,7 +17,7 @@ debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11) debianPackageRecommends in Debian += "git" -TaskKey[Unit]("check-upstart-script") := { +TaskKey[Unit]("checkUpstartScript") := { val script = IO.read(target.value / "debian-test-0.1.0" / "etc" / "init" / "debian-test.conf") assert(script.contains("exec sudo -u debian-test bin/debian-exec"), "wrong exec call\n" + script) streams.value.log.success("Successfully tested control script") diff --git a/src/sbt-test/debian/test-executableScriptName/test b/src/sbt-test/debian/test-executableScriptName/test index 2bc26b876..4b9331db4 100644 --- a/src/sbt-test/debian/test-executableScriptName/test +++ b/src/sbt-test/debian/test-executableScriptName/test @@ -14,4 +14,4 @@ $ exists target/debian-test-0.1.0/var/log/debian-test/ $ exists target/debian-test-0.1.0/etc/default/debian-test/ # -------------------------------------------- $ exists target/debian-test-0.1.0/etc/init/debian-test.conf -> check-upstart-script +> checkUpstartScript diff --git a/src/sbt-test/debian/test-mapping/build.sbt b/src/sbt-test/debian/test-mapping/build.sbt index 00c2e65d6..845d9a4f5 100644 --- a/src/sbt-test/debian/test-mapping/build.sbt +++ b/src/sbt-test/debian/test-mapping/build.sbt @@ -19,7 +19,7 @@ debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11) debianPackageRecommends in Debian += "git" -TaskKey[Unit]("check-control-script") := { +TaskKey[Unit]("checkControlScript") := { val script = IO.read(target.value / "debian-test-override-0.1.0" / "DEBIAN" / "control") assert(script.contains("Package: debian-test-package\n"), "script doesn't [Package: debian-test-package]\n" + script) diff --git a/src/sbt-test/debian/test-mapping/test b/src/sbt-test/debian/test-mapping/test index b656c2696..bcf850219 100644 --- a/src/sbt-test/debian/test-mapping/test +++ b/src/sbt-test/debian/test-mapping/test @@ -4,7 +4,7 @@ $ exists target/debian-test-override_0.1.0_all.deb # Testing the packageName configuration $ exists target/debian-test-override-0.1.0/DEBIAN $ exists target/debian-test-override-0.1.0/DEBIAN/control -> check-control-script +> checkControlScript $ exists target/debian-test-override-0.1.0/usr/ $ exists target/debian-test-override-0.1.0/usr/share/ $ exists target/debian-test-override-0.1.0/usr/share/debian-test-package/ diff --git a/src/sbt-test/debian/test-packageName/build.sbt b/src/sbt-test/debian/test-packageName/build.sbt index c202fb018..83c67049a 100644 --- a/src/sbt-test/debian/test-packageName/build.sbt +++ b/src/sbt-test/debian/test-packageName/build.sbt @@ -19,7 +19,7 @@ debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11) debianPackageRecommends in Debian += "git" -TaskKey[Unit]("check-control-script") := { +TaskKey[Unit]("checkControlScript") := { val script = IO.read(target.value / "debian-test-override-0.1.0" / "DEBIAN" / "control") assert(script.contains("Package: debian-test-package\n"), "script doesn't [Package: debian-test-package]\n" + script) diff --git a/src/sbt-test/debian/test-packageName/test b/src/sbt-test/debian/test-packageName/test index b8fe314be..b3389f0ad 100644 --- a/src/sbt-test/debian/test-packageName/test +++ b/src/sbt-test/debian/test-packageName/test @@ -4,7 +4,7 @@ $ exists target/debian-test-override_0.1.0_all.deb # Testing the packageName configuration $ exists target/debian-test-override-0.1.0/DEBIAN $ exists target/debian-test-override-0.1.0/DEBIAN/control -> check-control-script +> checkControlScript $ exists target/debian-test-override-0.1.0/usr/ $ exists target/debian-test-override-0.1.0/usr/share/ $ exists target/debian-test-override-0.1.0/usr/share/debian-test-package/ diff --git a/src/sbt-test/debian/upstart-deb-facilities/build.sbt b/src/sbt-test/debian/upstart-deb-facilities/build.sbt index 55850d1c4..fa3f1a18f 100644 --- a/src/sbt-test/debian/upstart-deb-facilities/build.sbt +++ b/src/sbt-test/debian/upstart-deb-facilities/build.sbt @@ -21,7 +21,7 @@ requiredStopFacilities in Debian := Some("[networking]") packageDescription := """A fun package description of our software, with multiple lines.""" -TaskKey[Unit]("check-startup-script") := { +TaskKey[Unit]("checkStartupScript") := { val script = IO.read(target.value / "debian-test-0.1.0" / "etc" / "init" / "debian-test.conf") assert(script.contains("start on runlevel [2345]"), "script doesn't contain start on runlevel header\n" + script) assert(script.contains("stop on runlevel [016]"), "script doesn't contain stop on runlevel header\n" + script) diff --git a/src/sbt-test/debian/upstart-deb-facilities/test b/src/sbt-test/debian/upstart-deb-facilities/test index e2e4cacfd..9d5fcfc9f 100644 --- a/src/sbt-test/debian/upstart-deb-facilities/test +++ b/src/sbt-test/debian/upstart-deb-facilities/test @@ -3,4 +3,4 @@ $ exists target/debian-test_0.1.0_all.deb $ exists target/debian-test-0.1.0/etc/init/debian-test.conf -> check-startup-script +> checkStartupScript diff --git a/src/sbt-test/debian/upstart-deb/build.sbt b/src/sbt-test/debian/upstart-deb/build.sbt index ec89455f6..8fc8ced5e 100644 --- a/src/sbt-test/debian/upstart-deb/build.sbt +++ b/src/sbt-test/debian/upstart-deb/build.sbt @@ -14,7 +14,7 @@ packageSummary := "Test debian package" packageDescription := """A fun package description of our software, with multiple lines.""" -TaskKey[Unit]("check-control-files") := { +TaskKey[Unit]("checkControlFiles") := { val debian = target.value / "debian-test-0.1.0" / "DEBIAN" val postinst = IO.read(debian / "postinst") val prerm = IO.read(debian / "prerm") @@ -25,13 +25,13 @@ TaskKey[Unit]("check-control-files") := { () } -InputKey[Unit]("check-softlink") := { +InputKey[Unit]("checkSoftlink") := { import complete.DefaultParsers._ val args = spaceDelimited("").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 + val absolutePath = sys.process.Process("readlink -m " + link).!!.trim assert(link != absolutePath, "Expected symbolic link '" + link + "' does not exist") assert( target == absolutePath, @@ -39,7 +39,7 @@ InputKey[Unit]("check-softlink") := { ) } -TaskKey[Unit]("check-startup-script") := { +TaskKey[Unit]("checkStartupScript") := { val script = IO.read(target.value / "debian-test-0.1.0" / "etc" / "init" / "debian-test.conf") assert(script.contains("start on runlevel [2345]"), "script doesn't contain start on runlevel header\n" + script) assert(script.contains("stop on runlevel [016]"), "script doesn't contain stop on runlevel header\n" + script) @@ -53,7 +53,7 @@ TaskKey[Unit]("check-startup-script") := { () } -TaskKey[Unit]("check-autostart") := { +TaskKey[Unit]("checkAutostart") := { val script = IO.read(target.value / "debian-test-0.1.0" / "DEBIAN" / "postinst") assert(script.contains("""addService debian-test || echo "debian-test could not be registered" |startService debian-test || echo "debian-test could not be started" @@ -61,7 +61,7 @@ TaskKey[Unit]("check-autostart") := { () } -TaskKey[Unit]("check-no-autostart") := { +TaskKey[Unit]("checkNoAutostart") := { val script = IO.read(target.value / "debian-test-0.1.0" / "DEBIAN" / "postinst") assert(script.contains("""addService debian-test || echo "debian-test could not be registered" |""".stripMargin), "addService post install commands missing or incorrect") diff --git a/src/sbt-test/debian/upstart-deb/test b/src/sbt-test/debian/upstart-deb/test index 476e7405b..cabffa65a 100644 --- a/src/sbt-test/debian/upstart-deb/test +++ b/src/sbt-test/debian/upstart-deb/test @@ -11,14 +11,14 @@ $ exists target/debian-test-0.1.0/DEBIAN/prerm $ exists target/debian-test-0.1.0/DEBIAN/postinst # Check files for defaults -> check-control-files -> check-softlink target/debian-test-0.1.0/usr/bin/debian-test points to /usr/share/debian-test/bin/debian-test -> check-startup-script -> check-autostart +> checkControlFiles +> checkSoftlink target/debian-test-0.1.0/usr/bin/debian-test points to /usr/share/debian-test/bin/debian-test +> checkStartupScript +> checkAutostart # Test that serviceAutostart can be disabled > set every NativePackagerKeys.serviceAutostart := false > debian:packageBin -> check-no-autostart \ No newline at end of file +> checkNoAutostart \ No newline at end of file diff --git a/src/sbt-test/docker/test-executableScriptName/build.sbt b/src/sbt-test/docker/test-executableScriptName/build.sbt index 6160d488e..93086b161 100644 --- a/src/sbt-test/docker/test-executableScriptName/build.sbt +++ b/src/sbt-test/docker/test-executableScriptName/build.sbt @@ -10,7 +10,7 @@ version := "0.1.0" maintainer := "Gary Coady " -TaskKey[Unit]("check-dockerfile") := { +TaskKey[Unit]("checkDockerfile") := { val dockerfile = IO.read(target.value / "docker" / "Dockerfile") assert( dockerfile.contains("ENTRYPOINT [\"bin/docker-exec\"]\n"), diff --git a/src/sbt-test/docker/test-executableScriptName/test b/src/sbt-test/docker/test-executableScriptName/test index e04834785..eb43db833 100644 --- a/src/sbt-test/docker/test-executableScriptName/test +++ b/src/sbt-test/docker/test-executableScriptName/test @@ -2,5 +2,5 @@ > docker:publishLocal $ exists target/docker/stage/Dockerfile $ exists target/docker/stage/opt/docker/bin/docker-exec -> check-dockerfile +> checkDockerfile $ exec bash -c 'docker run docker-package:0.1.0 | grep -q "Hello world"' \ No newline at end of file diff --git a/src/sbt-test/docker/test-packageName-universal/build.sbt b/src/sbt-test/docker/test-packageName-universal/build.sbt index 7a0add09b..17c214855 100644 --- a/src/sbt-test/docker/test-packageName-universal/build.sbt +++ b/src/sbt-test/docker/test-packageName-universal/build.sbt @@ -8,7 +8,7 @@ version := "0.1.0" maintainer := "Gary Coady " -TaskKey[Unit]("check-dockerfile") := { +TaskKey[Unit]("checkDockerfile") := { val dockerfile = IO.read(target.value / "docker" / "Dockerfile") assert( dockerfile.contains("ENTRYPOINT [\"bin/docker-test\"]\n"), diff --git a/src/sbt-test/docker/test-packageName-universal/test b/src/sbt-test/docker/test-packageName-universal/test index 96a9d94d2..a14902398 100644 --- a/src/sbt-test/docker/test-packageName-universal/test +++ b/src/sbt-test/docker/test-packageName-universal/test @@ -2,5 +2,5 @@ > docker:publishLocal $ exists target/docker/stage/Dockerfile $ exists target/docker/stage/opt/docker/bin/docker-test -> check-dockerfile +> checkDockerfile $ exec bash -c 'docker run docker-package:0.1.0 | grep -q "Hello world"' \ No newline at end of file diff --git a/src/sbt-test/docker/test-packageName/build.sbt b/src/sbt-test/docker/test-packageName/build.sbt index d86fab96c..f855ea17b 100644 --- a/src/sbt-test/docker/test-packageName/build.sbt +++ b/src/sbt-test/docker/test-packageName/build.sbt @@ -9,7 +9,7 @@ version := "0.1.0" maintainer := "Gary Coady " -TaskKey[Unit]("check-dockerfile") := { +TaskKey[Unit]("checkDockerfile") := { val dockerfile = IO.read(target.value / "docker" / "Dockerfile") assert( dockerfile.contains("ENTRYPOINT [\"bin/docker-test\"]\n"), diff --git a/src/sbt-test/docker/test-packageName/test b/src/sbt-test/docker/test-packageName/test index 96a9d94d2..a14902398 100644 --- a/src/sbt-test/docker/test-packageName/test +++ b/src/sbt-test/docker/test-packageName/test @@ -2,5 +2,5 @@ > docker:publishLocal $ exists target/docker/stage/Dockerfile $ exists target/docker/stage/opt/docker/bin/docker-test -> check-dockerfile +> checkDockerfile $ exec bash -c 'docker run docker-package:0.1.0 | grep -q "Hello world"' \ No newline at end of file diff --git a/src/sbt-test/jar/classpath-jar/build.sbt b/src/sbt-test/jar/classpath-jar/build.sbt index c174ebe32..d962541ce 100644 --- a/src/sbt-test/jar/classpath-jar/build.sbt +++ b/src/sbt-test/jar/classpath-jar/build.sbt @@ -9,7 +9,7 @@ version := "0.1.0" // test dependencies sample libraryDependencies ++= Seq("com.typesafe.akka" %% "akka-kernel" % "2.3.4") -TaskKey[Unit]("check-classspath") := { +TaskKey[Unit]("checkClasspath") := { val dir = (stagingDirectory in Universal).value val bat = IO.read(dir / "bin" / "classpath-jar-test.bat") assert(bat contains "set \"APP_CLASSPATH=%APP_LIB_DIR%\\classpath-jar-test.classpath-jar-test-0.1.0-classpath.jar\"") @@ -20,12 +20,12 @@ TaskKey[Unit]("check-classspath") := { jar close } -TaskKey[Unit]("run-check") := { +TaskKey[Unit]("runCheck") := { val dir = (stagingDirectory in Universal).value val cmd = if (System.getProperty("os.name").contains("Windows")) { Seq("cmd", "/c", (dir / "bin" / "classpath-jar-test.bat").getAbsolutePath) } else { Seq((dir / "bin" / "classpath-jar-test").getAbsolutePath) } - assert(Process(cmd).!! contains "SUCCESS!") + assert(sys.process.Process(cmd).!! contains "SUCCESS!") } diff --git a/src/sbt-test/jar/classpath-jar/test b/src/sbt-test/jar/classpath-jar/test index e9eaf3146..e55f12b4f 100644 --- a/src/sbt-test/jar/classpath-jar/test +++ b/src/sbt-test/jar/classpath-jar/test @@ -2,5 +2,5 @@ > stage $ exists target/universal/stage/lib/classpath-jar-test.classpath-jar-test-0.1.0-classpath.jar $ exists target/universal/stage/bin/classpath-jar-test.bat -> check-classspath -> run-check +> checkClasspath +> runCheck diff --git a/src/sbt-test/jar/launcher-jar with spaces/build.sbt b/src/sbt-test/jar/launcher-jar with spaces/build.sbt index aa424b7c9..23a1fc354 100644 --- a/src/sbt-test/jar/launcher-jar with spaces/build.sbt +++ b/src/sbt-test/jar/launcher-jar with spaces/build.sbt @@ -7,7 +7,7 @@ version := "0.1.0" // test dependencies sample libraryDependencies ++= Seq("com.typesafe.akka" %% "akka-kernel" % "2.3.4") -TaskKey[Unit]("check-classpath") := { +TaskKey[Unit]("checkClasspath") := { val dir = (stagingDirectory in Universal).value val bat = IO.read(dir / "bin" / "launcher-jar-test.bat") assert(bat contains "set \"APP_CLASSPATH=\"", "bat should set APP_CLASSPATH:\n" + bat) @@ -34,12 +34,12 @@ TaskKey[Unit]("check-classpath") := { jar close } -TaskKey[Unit]("run-check") := { +TaskKey[Unit]("runCheck") := { val dir = (stagingDirectory in Universal).value val cmd = if (System.getProperty("os.name").contains("Windows")) { Seq("cmd", "/c", (dir / "bin" / "launcher-jar-test.bat").getAbsolutePath) } else { Seq((dir / "bin" / "launcher-jar-test").getAbsolutePath) } - assert(Process(cmd).!! contains "SUCCESS!") + assert(sys.process.Process(cmd).!! contains "SUCCESS!") } diff --git a/src/sbt-test/jar/launcher-jar with spaces/test b/src/sbt-test/jar/launcher-jar with spaces/test index 770be33d5..09c0d76d8 100644 --- a/src/sbt-test/jar/launcher-jar with spaces/test +++ b/src/sbt-test/jar/launcher-jar with spaces/test @@ -1,5 +1,5 @@ # Run the staging and check the script. > stage $ exists target/universal/stage/lib/launcher-jar-test.launcher-jar-test-0.1.0-launcher.jar -> check-classpath -> run-check +> checkClasspath +> runCheck diff --git a/src/sbt-test/jar/launcher-jar/build.sbt b/src/sbt-test/jar/launcher-jar/build.sbt index 9bb8da52e..0ef4156f6 100644 --- a/src/sbt-test/jar/launcher-jar/build.sbt +++ b/src/sbt-test/jar/launcher-jar/build.sbt @@ -9,7 +9,7 @@ version := "0.1.0" // test dependencies sample libraryDependencies ++= Seq("com.typesafe.akka" %% "akka-kernel" % "2.3.4") -TaskKey[Unit]("check-classpath") := { +TaskKey[Unit]("checkClasspath") := { val dir = (stagingDirectory in Universal).value val bat = IO.read(dir / "bin" / "launcher-jar-test.bat") assert(bat contains "set \"APP_CLASSPATH=\"", "bat should set APP_CLASSPATH:\n" + bat) @@ -36,12 +36,12 @@ TaskKey[Unit]("check-classpath") := { jar close } -TaskKey[Unit]("run-check") := { +TaskKey[Unit]("runCheck") := { val dir = (stagingDirectory in Universal).value val cmd = if (System.getProperty("os.name").contains("Windows")) { Seq("cmd", "/c", (dir / "bin" / "launcher-jar-test.bat").getAbsolutePath) } else { Seq((dir / "bin" / "launcher-jar-test").getAbsolutePath) } - assert(Process(cmd).!! contains "SUCCESS!") + assert(sys.process.Process(cmd).!! contains "SUCCESS!") } diff --git a/src/sbt-test/jar/launcher-jar/test b/src/sbt-test/jar/launcher-jar/test index 770be33d5..09c0d76d8 100644 --- a/src/sbt-test/jar/launcher-jar/test +++ b/src/sbt-test/jar/launcher-jar/test @@ -1,5 +1,5 @@ # Run the staging and check the script. > stage $ exists target/universal/stage/lib/launcher-jar-test.launcher-jar-test-0.1.0-launcher.jar -> check-classpath -> run-check +> checkClasspath +> runCheck diff --git a/src/sbt-test/rpm/changelog-test/build.sbt b/src/sbt-test/rpm/changelog-test/build.sbt index 497251183..e88f7357f 100644 --- a/src/sbt-test/rpm/changelog-test/build.sbt +++ b/src/sbt-test/rpm/changelog-test/build.sbt @@ -21,7 +21,7 @@ rpmLicense := Some("BSD") rpmChangelogFile := Some("conf/changelog") -TaskKey[Unit]("check-spec-file") := { +TaskKey[Unit]("checkSpecFile") := { val spec = IO.read(target.value / "rpm" / "SPECS" / "rpm-test.spec") // Check if the RPM writted the changelog tag on the task assert(spec contains "%changelog\n", "Spec doesn't contain %changelog tag on the SPEC") diff --git a/src/sbt-test/rpm/changelog-test/test b/src/sbt-test/rpm/changelog-test/test index 7719d009e..30f7e1fff 100644 --- a/src/sbt-test/rpm/changelog-test/test +++ b/src/sbt-test/rpm/changelog-test/test @@ -4,6 +4,6 @@ $ exists target/rpm/RPMS/noarch/rpm-test-0.1.0-1.noarch.rpm $ exists target/rpm/SPECS/rpm-test.spec # Check files for defaults -> check-spec-file +> checkSpecFile > set NativePackagerKeys.rpmBrpJavaRepackJars := false -> check-spec-file +> checkSpecFile diff --git a/src/sbt-test/rpm/config-no-replace/build.sbt b/src/sbt-test/rpm/config-no-replace/build.sbt index 689f7811d..8da1e0a99 100644 --- a/src/sbt-test/rpm/config-no-replace/build.sbt +++ b/src/sbt-test/rpm/config-no-replace/build.sbt @@ -27,7 +27,7 @@ linuxPackageMappings := configWithNoReplace(linuxPackageMappings.value) TaskKey[Unit]("unzip") := { val rpmPath = Seq((packageBin in Rpm).value.getAbsolutePath) - Process("rpm2cpio", rpmPath) #| Process("cpio -i --make-directories") ! streams.value.log + sys.process.Process("rpm2cpio", rpmPath) #| sys.process.Process("cpio -i --make-directories") ! streams.value.log } TaskKey[Unit]("checkSpecFile") := { diff --git a/src/sbt-test/rpm/override-loader-functions/build.sbt b/src/sbt-test/rpm/override-loader-functions/build.sbt index cc961b784..a28a7ba66 100644 --- a/src/sbt-test/rpm/override-loader-functions/build.sbt +++ b/src/sbt-test/rpm/override-loader-functions/build.sbt @@ -23,7 +23,7 @@ rpmLicense := Some("BSD") rpmGroup := Some("test-group") -TaskKey[Unit]("check-loader-script") := { +TaskKey[Unit]("checkLoaderScript") := { val path = target.value / "rpm" / "RPMS" / "noarch" / "rpm-test-0.1.0-1.noarch.rpm" val scripts = s"rpm -qp --scripts ${path.absolutePath}".!! diff --git a/src/sbt-test/rpm/override-loader-functions/test b/src/sbt-test/rpm/override-loader-functions/test index 974bbc50f..04dcd43c5 100644 --- a/src/sbt-test/rpm/override-loader-functions/test +++ b/src/sbt-test/rpm/override-loader-functions/test @@ -2,4 +2,4 @@ > rpm:packageBin $ exists target/rpm/RPMS/noarch/rpm-test-0.1.0-1.noarch.rpm -> check-loader-script +> checkLoaderScript diff --git a/src/sbt-test/rpm/override-start-script-systemd/build.sbt b/src/sbt-test/rpm/override-start-script-systemd/build.sbt index 61bd56342..0a013d7bd 100644 --- a/src/sbt-test/rpm/override-start-script-systemd/build.sbt +++ b/src/sbt-test/rpm/override-start-script-systemd/build.sbt @@ -27,7 +27,7 @@ rpmGroup := Some("test-group") TaskKey[Unit]("unzip") := { val rpmPath = Seq((packageBin in Rpm).value.getAbsolutePath) - Process("rpm2cpio", rpmPath) #| Process("cpio -i --make-directories") ! streams.value.log + sys.process.Process("rpm2cpio", rpmPath) #| sys.process.Process("cpio -i --make-directories") ! streams.value.log () } diff --git a/src/sbt-test/rpm/override-start-script-systemv/build.sbt b/src/sbt-test/rpm/override-start-script-systemv/build.sbt index 64b217a21..53d393649 100644 --- a/src/sbt-test/rpm/override-start-script-systemv/build.sbt +++ b/src/sbt-test/rpm/override-start-script-systemv/build.sbt @@ -27,7 +27,7 @@ rpmGroup := Some("test-group") TaskKey[Unit]("unzip") := { val rpmPath = Seq((packageBin in Rpm).value.getAbsolutePath) - Process("rpm2cpio", rpmPath) #| Process("cpio -i --make-directories") ! streams.value.log + sys.process.Process("rpm2cpio", rpmPath) #| sys.process.Process("cpio -i --make-directories") ! streams.value.log () } diff --git a/src/sbt-test/rpm/override-start-script-upstart/build.sbt b/src/sbt-test/rpm/override-start-script-upstart/build.sbt index fa3ef0e04..80f1aaf85 100644 --- a/src/sbt-test/rpm/override-start-script-upstart/build.sbt +++ b/src/sbt-test/rpm/override-start-script-upstart/build.sbt @@ -27,7 +27,7 @@ rpmGroup := Some("test-group") TaskKey[Unit]("unzip") := { val rpmPath = Seq((packageBin in Rpm).value.getAbsolutePath) - Process("rpm2cpio", rpmPath) #| sys.process.Process("cpio -i --make-directories") ! streams.value.log + sys.process.Process("rpm2cpio", rpmPath) #| sys.process.Process("cpio -i --make-directories") ! streams.value.log () } diff --git a/src/sbt-test/rpm/path-override-rpm/build.sbt b/src/sbt-test/rpm/path-override-rpm/build.sbt index 152998687..dd7c11886 100644 --- a/src/sbt-test/rpm/path-override-rpm/build.sbt +++ b/src/sbt-test/rpm/path-override-rpm/build.sbt @@ -24,11 +24,11 @@ defaultLinuxLogsLocation := "/opt/test/log" TaskKey[Unit]("unzip") := { val rpmPath = Seq((packageBin in Rpm).value.getAbsolutePath) - Process("rpm2cpio", rpmPath) #| Process("cpio -i --make-directories") ! streams.value.log + sys.process.Process("rpm2cpio", rpmPath) #| sys.process.Process("cpio -i --make-directories") ! streams.value.log () } -TaskKey[Unit]("check-init-file") := { +TaskKey[Unit]("checkInitFile") := { val initd = IO.read(baseDirectory.value / "etc" / "init.d" / "rpm-test") assert(initd contains "/opt/test/rpm-test", "defaultLinuxInstallLocation not overriden in init.d\n" + initd) assert( diff --git a/src/sbt-test/rpm/path-override-rpm/test b/src/sbt-test/rpm/path-override-rpm/test index afd8bef8b..a974bf720 100644 --- a/src/sbt-test/rpm/path-override-rpm/test +++ b/src/sbt-test/rpm/path-override-rpm/test @@ -6,5 +6,5 @@ $ exists target/rpm/RPMS/noarch/rpm-test-0.1.0-1.noarch.rpm $ exists opt/test/rpm-test $ exists etc/init.d/rpm-test -> check-init-file +> checkInitFile diff --git a/src/sbt-test/rpm/scriplets-no-javarepack-rpm/build.sbt b/src/sbt-test/rpm/scriplets-no-javarepack-rpm/build.sbt index c0236f73d..6771f5a1b 100644 --- a/src/sbt-test/rpm/scriplets-no-javarepack-rpm/build.sbt +++ b/src/sbt-test/rpm/scriplets-no-javarepack-rpm/build.sbt @@ -22,7 +22,7 @@ rpmLicense := Some("BSD") rpmBrpJavaRepackJars := false -TaskKey[Unit]("check-spec-file") := { +TaskKey[Unit]("checkSpecFile") := { val spec = IO.read(target.value / "rpm" / "SPECS" / "rpm-test-no-repack.spec") assert(spec.contains("""%define __jar_repack %nil"""), "Missing java repack disabling in %pre") streams.value.log.success("Successfully tested rpm test file") diff --git a/src/sbt-test/rpm/scriplets-no-javarepack-rpm/test b/src/sbt-test/rpm/scriplets-no-javarepack-rpm/test index 3e64106aa..4efb740eb 100644 --- a/src/sbt-test/rpm/scriplets-no-javarepack-rpm/test +++ b/src/sbt-test/rpm/scriplets-no-javarepack-rpm/test @@ -3,4 +3,4 @@ $ exists target/rpm/RPMS/noarch/rpm-test-no-repack-0.1.0-2.noarch.rpm $ exists target/rpm/SPECS/rpm-test-no-repack.spec -> check-spec-file \ No newline at end of file +> checkSpecFile \ No newline at end of file diff --git a/src/sbt-test/rpm/scriplets-use-javarepack-rpm/build.sbt b/src/sbt-test/rpm/scriplets-use-javarepack-rpm/build.sbt index 6550e9ecd..f1049fbdc 100644 --- a/src/sbt-test/rpm/scriplets-use-javarepack-rpm/build.sbt +++ b/src/sbt-test/rpm/scriplets-use-javarepack-rpm/build.sbt @@ -22,7 +22,7 @@ rpmLicense := Some("BSD") rpmBrpJavaRepackJars := true -TaskKey[Unit]("check-spec-file") := { +TaskKey[Unit]("checkSpecFile") := { val spec = IO.read(target.value / "rpm" / "SPECS" / "rpm-test-with-repack.spec") assert(!spec.contains("""%define __jar_repack %nil"""), "%pre should not contain jar repack when set to true") streams.value.log.success("Successfully tested rpm test file") diff --git a/src/sbt-test/rpm/scriplets-use-javarepack-rpm/test b/src/sbt-test/rpm/scriplets-use-javarepack-rpm/test index 38e3e854d..25d91eb8d 100644 --- a/src/sbt-test/rpm/scriplets-use-javarepack-rpm/test +++ b/src/sbt-test/rpm/scriplets-use-javarepack-rpm/test @@ -3,4 +3,4 @@ $ exists target/rpm/RPMS/noarch/rpm-test-with-repack-0.1.0-2.noarch.rpm $ exists target/rpm/SPECS/rpm-test-with-repack.spec -> check-spec-file \ No newline at end of file +> checkSpecFile \ No newline at end of file diff --git a/src/sbt-test/rpm/scriptlets-override-build-rpm/build.sbt b/src/sbt-test/rpm/scriptlets-override-build-rpm/build.sbt index e6e9b2dbd..2cdf94fd2 100644 --- a/src/sbt-test/rpm/scriptlets-override-build-rpm/build.sbt +++ b/src/sbt-test/rpm/scriptlets-override-build-rpm/build.sbt @@ -29,7 +29,7 @@ maintainerScripts in Rpm := Map( Postun -> Seq("""echo "post-uninstall"""") ) -TaskKey[Unit]("check-spec-file") := { +TaskKey[Unit]("checkSpecFile") := { val spec = IO.read(target.value / "rpm" / "SPECS" / "rpm-test.spec") assert(spec contains "%pre\necho \"pre-install\"", "Spec doesn't contain %pre scriptlet") assert(spec contains "%post\necho \"post-install\"", "Spec doesn't contain %post scriptlet") diff --git a/src/sbt-test/rpm/scriptlets-override-build-rpm/test b/src/sbt-test/rpm/scriptlets-override-build-rpm/test index 7719d009e..30f7e1fff 100644 --- a/src/sbt-test/rpm/scriptlets-override-build-rpm/test +++ b/src/sbt-test/rpm/scriptlets-override-build-rpm/test @@ -4,6 +4,6 @@ $ exists target/rpm/RPMS/noarch/rpm-test-0.1.0-1.noarch.rpm $ exists target/rpm/SPECS/rpm-test.spec # Check files for defaults -> check-spec-file +> checkSpecFile > set NativePackagerKeys.rpmBrpJavaRepackJars := false -> check-spec-file +> checkSpecFile diff --git a/src/sbt-test/rpm/scriptlets-override-rpm/build.sbt b/src/sbt-test/rpm/scriptlets-override-rpm/build.sbt index d95eab3e0..561bb0b8d 100644 --- a/src/sbt-test/rpm/scriptlets-override-rpm/build.sbt +++ b/src/sbt-test/rpm/scriptlets-override-rpm/build.sbt @@ -19,7 +19,7 @@ mainClass in (Compile, run) := Some("com.example.MainApp") TaskKey[Unit]("unzipAndCheck") := { val rpmFile = (packageBin in Rpm).value val rpmPath = Seq(rpmFile.getAbsolutePath) - Process("rpm2cpio", rpmPath) #| Process("cpio -i --make-directories") ! streams.value.log + sys.process.Process("rpm2cpio", rpmPath) #| sys.process.Process("cpio -i --make-directories") ! streams.value.log val scriptlets = sys.process.Process("rpm -qp --scripts " + rpmFile.getAbsolutePath) !! streams.value.log assert(scriptlets contains "echo postinst", "'echo 'postinst' not present in \n" + scriptlets) assert(scriptlets contains "echo preinst", "'echo 'preinst' not present in \n" + scriptlets) @@ -28,7 +28,7 @@ TaskKey[Unit]("unzipAndCheck") := { () } -TaskKey[Unit]("check-spec-file") := { +TaskKey[Unit]("checkSpecFile") := { val spec = IO.read(target.value / "rpm" / "SPECS" / "rpm-test.spec") assert(spec contains "echo postinst", "'echo 'postinst' not present in \n" + spec) assert(spec contains "echo preinst", "'echo 'preinst' not present in \n" + spec) diff --git a/src/sbt-test/rpm/scriptlets-override-rpm/test b/src/sbt-test/rpm/scriptlets-override-rpm/test index 6ff8c2f43..aa94cde1d 100644 --- a/src/sbt-test/rpm/scriptlets-override-rpm/test +++ b/src/sbt-test/rpm/scriptlets-override-rpm/test @@ -19,8 +19,8 @@ $ exists var/run/rpm-test # TODO symlinks aren't checked -> check-spec-file +> checkSpecFile > set NativePackagerKeys.rpmBrpJavaRepackJars := false -> check-spec-file +> checkSpecFile > unique-scripts-in-spec-file \ No newline at end of file diff --git a/src/sbt-test/rpm/scriptlets-rpm/build.sbt b/src/sbt-test/rpm/scriptlets-rpm/build.sbt index 15cf4bd3b..1ae0e3830 100644 --- a/src/sbt-test/rpm/scriptlets-rpm/build.sbt +++ b/src/sbt-test/rpm/scriptlets-rpm/build.sbt @@ -32,7 +32,7 @@ maintainerScripts in Rpm := Map( Postun -> Seq("""echo "post-uninstall"""") ) -TaskKey[Unit]("check-spec-file") := { +TaskKey[Unit]("checkSpecFile") := { val spec = IO.read(target.value / "rpm" / "SPECS" / "rpm-test.spec") assert(spec contains "%pre\necho \"pre-install\"", "Spec doesn't contain %pre scriptlet") assert(spec contains "%post\necho \"post-install\"", "Spec doesn't contain %post scriptlet") @@ -87,8 +87,8 @@ TaskKey[Unit]("check-spec-file") := { () } -TaskKey[Unit]("check-rpm-version") := { - val fullRpmVersion = Process("rpm", Seq("--version")) !! +TaskKey[Unit]("checkRpmVersion") := { + val fullRpmVersion = sys.process.Process("rpm", Seq("--version")) !! val firstDigit = fullRpmVersion indexWhere Character.isDigit val rpmVersion = fullRpmVersion substring firstDigit streams.value.log.info("Found rpmVersion: " + rpmVersion) diff --git a/src/sbt-test/rpm/scriptlets-rpm/test b/src/sbt-test/rpm/scriptlets-rpm/test index e3ba5c710..522171f60 100644 --- a/src/sbt-test/rpm/scriptlets-rpm/test +++ b/src/sbt-test/rpm/scriptlets-rpm/test @@ -4,7 +4,7 @@ $ exists target/rpm/RPMS/noarch/rpm-test-0.1.0-1.noarch.rpm $ exists target/rpm/SPECS/rpm-test.spec # Check files for defaults -> check-spec-file -> check-rpm-version +> checkSpecFile +> checkRpmVersion > set NativePackagerKeys.rpmBrpJavaRepackJars := false -> check-spec-file +> checkSpecFile diff --git a/src/sbt-test/rpm/setarch-rpm/build.sbt b/src/sbt-test/rpm/setarch-rpm/build.sbt index 11fa77682..94dba6fc2 100644 --- a/src/sbt-test/rpm/setarch-rpm/build.sbt +++ b/src/sbt-test/rpm/setarch-rpm/build.sbt @@ -21,12 +21,12 @@ rpmSetarch := Some("i386") linuxPackageMappings := { val helloMapping = LinuxPackageMapping( - Seq(((resourceDirectory in Compile).value / "hello-32bit", "/usr/share/rpm-package/libexec/hello-32bit")) - ) withPerms "0755" + Seq(((resourceDirectory in Compile).value / "hello-32bit", "/usr/share/rpm-package/libexec/hello-32bit")) + ) withPerms "0755" linuxPackageMappings.value :+ helloMapping } -TaskKey[Unit]("check-spec-file") := { +TaskKey[Unit]("checkSpecFile") := { val spec = IO.read(target.value / "rpm" / "SPECS" / "rpm-package.spec") streams.value.log.success(spec) assert( diff --git a/src/sbt-test/rpm/setarch-rpm/test b/src/sbt-test/rpm/setarch-rpm/test index 4dd87c7ce..4fccc8a78 100644 --- a/src/sbt-test/rpm/setarch-rpm/test +++ b/src/sbt-test/rpm/setarch-rpm/test @@ -4,4 +4,4 @@ $ exists target/rpm/RPMS/i386/rpm-package-0.1.0-1.i386.rpm $ exists target/rpm/SPECS/rpm-package.spec # Check files for defaults -> check-spec-file +> checkSpecFile diff --git a/src/sbt-test/rpm/snapshot-rpm/build.sbt b/src/sbt-test/rpm/snapshot-rpm/build.sbt index f4c09d6c7..ce6662a01 100644 --- a/src/sbt-test/rpm/snapshot-rpm/build.sbt +++ b/src/sbt-test/rpm/snapshot-rpm/build.sbt @@ -17,8 +17,7 @@ rpmUrl := Some("http://github.com/sbt/sbt-native-packager") rpmLicense := Some("BSD") -TaskKey[Unit]("check-snapshot") := { +TaskKey[Unit]("checkSnapshot") := { assert(rpmRelease.value == "SNAPSHOT", s"RPM has incorrect value ${rpmRelease.value}") assert(rpmMetadata.value.version == "0.1.0", s"RPM has incorrect value ${rpmMetadata.value.version}") } - diff --git a/src/sbt-test/rpm/snapshot-rpm/test b/src/sbt-test/rpm/snapshot-rpm/test index fbc62558c..8959fb092 100644 --- a/src/sbt-test/rpm/snapshot-rpm/test +++ b/src/sbt-test/rpm/snapshot-rpm/test @@ -3,4 +3,4 @@ $ exists target/rpm/RPMS/noarch/rpm-test-0.1.0-SNAPSHOT.noarch.rpm #Check release and version configured correctly -> check-snapshot \ No newline at end of file +> checkSnapshot \ No newline at end of file diff --git a/src/sbt-test/rpm/systemd-rpm/build.sbt b/src/sbt-test/rpm/systemd-rpm/build.sbt index 37bc762b8..334d4ddf6 100644 --- a/src/sbt-test/rpm/systemd-rpm/build.sbt +++ b/src/sbt-test/rpm/systemd-rpm/build.sbt @@ -20,7 +20,7 @@ requiredStartFacilities in Rpm := Some("serviceA.service") TaskKey[Unit]("unzip") := { val rpmPath = Seq((packageBin in Rpm).value.getAbsolutePath) - Process("rpm2cpio", rpmPath) #| Process("cpio -i --make-directories") ! streams.value.log + sys.process.Process("rpm2cpio", rpmPath) #| sys.process.Process("cpio -i --make-directories") ! streams.value.log () } @@ -116,7 +116,7 @@ TaskKey[Unit]("checkSpecFile") := { () } -TaskKey[Unit]("check-spec-autostart") := { +TaskKey[Unit]("checkSpecAutostart") := { val spec = IO.read(target.value / "rpm" / "SPECS" / "rpm-test.spec") println(spec) @@ -136,7 +136,7 @@ TaskKey[Unit]("check-spec-autostart") := { () } -TaskKey[Unit]("check-spec-no-autostart") := { +TaskKey[Unit]("checkSpecNoAutostart") := { val spec = IO.read(target.value / "rpm" / "SPECS" / "rpm-test.spec") println(spec) diff --git a/src/sbt-test/rpm/systemd-rpm/test b/src/sbt-test/rpm/systemd-rpm/test index 120ba89c6..a470af8f9 100644 --- a/src/sbt-test/rpm/systemd-rpm/test +++ b/src/sbt-test/rpm/systemd-rpm/test @@ -8,7 +8,7 @@ $ exists usr/lib/systemd/system/rpm-test.service > checkStartupScript > checkSpecFile -> check-spec-autostart +> checkSpecAutostart # test that autostart can be disabled @@ -16,4 +16,4 @@ $ exists usr/lib/systemd/system/rpm-test.service > set every NativePackagerKeys.serviceAutostart := false > rpm:packageBin > checkSpecFile -> check-spec-no-autostart +> checkSpecNoAutostart diff --git a/src/sbt-test/rpm/sysvinit-rpm/build.sbt b/src/sbt-test/rpm/sysvinit-rpm/build.sbt index f22f08789..2b58ab488 100644 --- a/src/sbt-test/rpm/sysvinit-rpm/build.sbt +++ b/src/sbt-test/rpm/sysvinit-rpm/build.sbt @@ -20,8 +20,8 @@ mainClass in (Compile, run) := Some("com.example.MainApp") TaskKey[Unit]("unzipAndCheck") := { val rpmPath = Seq((packageBin in Rpm).value.getAbsolutePath) - Process("rpm2cpio", rpmPath) #| Process("cpio -i --make-directories") ! streams.value.log - val scriptlets = Process("rpm -qp --scripts " + (packageBin in Rpm).value.getAbsolutePath) !! streams.value.log + sys.process.Process("rpm2cpio", rpmPath) #| sys.process.Process("cpio -i --make-directories") ! streams.value.log + val scriptlets = sys.process.Process("rpm -qp --scripts " + (packageBin in Rpm).value.getAbsolutePath) !! streams.value.log assert(scriptlets contains "addGroup rpm-test", "addGroup not present in \n" + scriptlets) assert(scriptlets contains "addUser rpm-test", "Incorrect useradd command in \n" + scriptlets) assert(scriptlets contains "deleteGroup rpm-test", "deleteGroup not present in \n" + scriptlets) @@ -46,7 +46,7 @@ TaskKey[Unit]("unzipAndCheck") := { () } -TaskKey[Unit]("check-spec-file") := { +TaskKey[Unit]("checkSpecFile") := { val spec = IO.read(target.value / "rpm" / "SPECS" / "rpm-test.spec") assert(spec contains "addGroup rpm-test", "addGroup not present in \n" + spec) assert(spec contains "addUser rpm-test", "Incorrect useradd command in \n" + spec) @@ -146,7 +146,7 @@ TaskKey[Unit]("check-spec-file") := { () } -TaskKey[Unit]("check-spec-autostart") := { +TaskKey[Unit]("checkSpecAutostart") := { val spec = IO.read(target.value / "rpm" / "SPECS" / "rpm-test.spec") assert( spec contains @@ -165,7 +165,7 @@ TaskKey[Unit]("check-spec-autostart") := { () } -TaskKey[Unit]("check-spec-no-autostart") := { +TaskKey[Unit]("checkSpecNoAutostart") := { val spec = IO.read(target.value / "rpm" / "SPECS" / "rpm-test.spec") assert( spec contains diff --git a/src/sbt-test/rpm/sysvinit-rpm/test b/src/sbt-test/rpm/sysvinit-rpm/test index 4f6e99e4c..173691dd1 100644 --- a/src/sbt-test/rpm/sysvinit-rpm/test +++ b/src/sbt-test/rpm/sysvinit-rpm/test @@ -2,8 +2,8 @@ > rpm:packageBin $ exists target/rpm/RPMS/noarch/rpm-test-0.1.0-1.noarch.rpm -> check-spec-file -> check-spec-autostart +> checkSpecFile +> checkSpecAutostart # Check rpm contents > unzipAndCheck @@ -24,12 +24,12 @@ $ exists var/run/rpm-test # TODO symlinks aren't checked > set NativePackagerKeys.rpmBrpJavaRepackJars := false -> check-spec-file -> check-spec-autostart +> checkSpecFile +> checkSpecAutostart # Test that serviceAutostart can be disabled > set every NativePackagerKeys.serviceAutostart := false > rpm:packageBin -> check-spec-file -> check-spec-no-autostart \ No newline at end of file +> checkSpecFile +> checkSpecNoAutostart \ No newline at end of file diff --git a/src/sbt-test/rpm/test-executableScriptName/build.sbt b/src/sbt-test/rpm/test-executableScriptName/build.sbt index 20dfc797c..835ffa061 100644 --- a/src/sbt-test/rpm/test-executableScriptName/build.sbt +++ b/src/sbt-test/rpm/test-executableScriptName/build.sbt @@ -25,7 +25,7 @@ rpmLicense := Some("BSD") rpmGroup := Some("test-group") -TaskKey[Unit]("check-spec-file") := { +TaskKey[Unit]("checkSpecFile") := { val spec = IO.read(target.value / "rpm" / "SPECS" / "rpm-test.spec") assert( spec contains "%attr(0644,root,root) /usr/share/rpm-test/lib/rpm-test.rpm-test-0.1.0.jar", @@ -41,7 +41,7 @@ TaskKey[Unit]("check-spec-file") := { TaskKey[Unit]("unzip") := { val rpmPath = Seq((packageBin in Rpm).value.getAbsolutePath) - sys.process.Process("rpm2cpio", rpmPath) #| Process("cpio -i --make-directories") ! streams.value.log + sys.process.Process("rpm2cpio", rpmPath) #| sys.process.Process("cpio -i --make-directories") ! streams.value.log () } diff --git a/src/sbt-test/rpm/test-executableScriptName/test b/src/sbt-test/rpm/test-executableScriptName/test index e7602ecdb..0308344d4 100644 --- a/src/sbt-test/rpm/test-executableScriptName/test +++ b/src/sbt-test/rpm/test-executableScriptName/test @@ -4,7 +4,7 @@ $ exists target/rpm/RPMS/noarch/rpm-test-0.1.0-1.noarch.rpm $ exists target/rpm/SPECS/rpm-test.spec # Check files for defaults -> check-spec-file +> checkSpecFile > unzip # Bootscript != executable Script diff --git a/src/sbt-test/rpm/test-packageName/build.sbt b/src/sbt-test/rpm/test-packageName/build.sbt index a5a15ceb3..98244de29 100644 --- a/src/sbt-test/rpm/test-packageName/build.sbt +++ b/src/sbt-test/rpm/test-packageName/build.sbt @@ -21,7 +21,7 @@ rpmUrl := Some("http://github.com/sbt/sbt-native-packager") rpmLicense := Some("BSD") -TaskKey[Unit]("check-spec-file") := { +TaskKey[Unit]("checkSpecFile") := { val spec = IO.read(target.value / "rpm" / "SPECS" / "rpm-package.spec") streams.value.log.success(spec) assert( diff --git a/src/sbt-test/rpm/test-packageName/test b/src/sbt-test/rpm/test-packageName/test index e2529b498..d2c7680c8 100644 --- a/src/sbt-test/rpm/test-packageName/test +++ b/src/sbt-test/rpm/test-packageName/test @@ -4,4 +4,4 @@ $ exists target/rpm/RPMS/noarch/rpm-package-0.1.0-1.noarch.rpm $ exists target/rpm/SPECS/rpm-package.spec # Check files for defaults -> check-spec-file +> checkSpecFile diff --git a/src/sbt-test/universal/multiproject-classifiers/build.sbt b/src/sbt-test/universal/multiproject-classifiers/build.sbt index 15126e5ad..9c97e161d 100644 --- a/src/sbt-test/universal/multiproject-classifiers/build.sbt +++ b/src/sbt-test/universal/multiproject-classifiers/build.sbt @@ -17,7 +17,7 @@ lazy val sub = project .settings(mySettings) .settings( ivyConfigurations += assets, - artifact in assets := artifact.value.withClassifier(classifier = Some("assets")), + artifact in assets := artifact.value.copy(classifier = Some("assets")), packagedArtifacts += { val file = target.value / "assets.jar" val assetsDir = baseDirectory.value / "src" / "main" / "assets" diff --git a/src/sbt-test/universal/multiproject-java-app-archetype/build.sbt b/src/sbt-test/universal/multiproject-java-app-archetype/build.sbt deleted file mode 100644 index 4edd197c0..000000000 --- a/src/sbt-test/universal/multiproject-java-app-archetype/build.sbt +++ /dev/null @@ -1,34 +0,0 @@ -lazy val appName = "play-bug-1499" -lazy val appVersion = "1.0" - -lazy val mySettings: Seq[Setting[_]] = - Seq(organization := "org.test", version := appVersion, TaskKey[Unit]("showFiles") := { - System.out.synchronized { - println("Files in [" + name.value + "]") - val files = (target.value / "universal/stage").**(AllPassFilter).get - files foreach println - } - }) - -lazy val common = project - .in(file("module/common")) - .settings(mySettings) - -lazy val foo = project - .in(file("module/foo")) - .enablePlugins(JavaAppPackaging) - .settings(mySettings) - .dependsOn(common) - -lazy val bar = project - .in(file("module/bar")) - .enablePlugins(JavaAppPackaging) - .settings(mySettings) - .dependsOn(common) - -lazy val aaMain = project - .in(file(".")) - .enablePlugins(JavaAppPackaging) - .settings(mySettings) - .dependsOn(common, foo, bar) - .aggregate(foo, bar) diff --git a/src/sbt-test/universal/multiproject-java-app-archetype/project/plugins.sbt b/src/sbt-test/universal/multiproject-java-app-archetype/project/plugins.sbt deleted file mode 100644 index b53de154c..000000000 --- a/src/sbt-test/universal/multiproject-java-app-archetype/project/plugins.sbt +++ /dev/null @@ -1 +0,0 @@ -addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % sys.props("project.version")) diff --git a/src/sbt-test/universal/multiproject-java-app-archetype/test b/src/sbt-test/universal/multiproject-java-app-archetype/test deleted file mode 100644 index a21b21788..000000000 --- a/src/sbt-test/universal/multiproject-java-app-archetype/test +++ /dev/null @@ -1,7 +0,0 @@ -# Run the staging and check the script. -> stage -> showFiles -$ exists target/universal/stage/lib/org.test.play-bug-1499-foo-1.0.jar -$ exists target/universal/stage/lib/org.test.play-bug-1499-common-1.0.jar -$ exists target/universal/stage/lib/org.test.play-bug-1499-bar-1.0.jar -$ exists target/universal/stage/lib/org.test.play-bug-1499-main-1.0.jar \ No newline at end of file diff --git a/src/sbt-test/universal/publish/build.sbt b/src/sbt-test/universal/publish/build.sbt index 57388a01e..e0e838b6b 100644 --- a/src/sbt-test/universal/publish/build.sbt +++ b/src/sbt-test/universal/publish/build.sbt @@ -4,9 +4,10 @@ name := "simple-test" version := "0.1.0" -// Workarund for ivy configuration bug -resolvers += (publishTo in Universal).value.get - -publishTo in Universal := Some( +lazy val testResolver = Resolver.file("test", file("test-repo"))(Patterns("[module]/[revision]/[module]-[revision].[ext]")) -) + +// Workaround for ivy configuration bug +resolvers += testResolver + +publishTo in Universal := Some(testResolver) diff --git a/src/sbt-test/universal/staging-custom-main/build.sbt b/src/sbt-test/universal/staging-custom-main/build.sbt index 3909c19aa..fe191717c 100644 --- a/src/sbt-test/universal/staging-custom-main/build.sbt +++ b/src/sbt-test/universal/staging-custom-main/build.sbt @@ -10,12 +10,12 @@ mainClass in Compile := Some("Main") TaskKey[Unit]("unzip") := { val args = Seq((packageBin in Universal).value.getAbsolutePath) - Process("unzip", args) ! streams.value.log + sys.process.Process("unzip", args) ! streams.value.log } TaskKey[Unit]("check") := { val zipFile = (packageBin in Universal).value - val process = Process("stage-custom-main-0.1.0/bin/stage-custom-main", Seq("-main", "CustomMain")) + val process = sys.process.Process("stage-custom-main-0.1.0/bin/stage-custom-main", Seq("-main", "CustomMain")) val out = (process !!) if (out.trim != "A custom main method") sys.error("unexpected output: " + out) () diff --git a/src/sbt-test/universal/test-executableScriptName/build.sbt b/src/sbt-test/universal/test-executableScriptName/build.sbt index 12fa16ddd..8156c400a 100644 --- a/src/sbt-test/universal/test-executableScriptName/build.sbt +++ b/src/sbt-test/universal/test-executableScriptName/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + enablePlugins(JavaAppPackaging) name := "simple-test" diff --git a/src/sbt-test/universal/test-mapping-helpers/build.sbt b/src/sbt-test/universal/test-mapping-helpers/build.sbt index 4a523b11f..1515cf4af 100644 --- a/src/sbt-test/universal/test-mapping-helpers/build.sbt +++ b/src/sbt-test/universal/test-mapping-helpers/build.sbt @@ -24,5 +24,5 @@ mappings in Universal += { TaskKey[Unit]("unzip") := { val args = Seq((packageBin in Universal).value.getAbsolutePath) - Process("unzip", args) ! streams.value.log + sys.process.Process("unzip", args) ! streams.value.log } diff --git a/src/sbt-test/universal/test-packageName/test b/src/sbt-test/universal/test-packageName/test index 333283a73..7c21d6604 100644 --- a/src/sbt-test/universal/test-packageName/test +++ b/src/sbt-test/universal/test-packageName/test @@ -3,9 +3,9 @@ $ exists target/universal/simple-package.zip # Run the tgz packaging. -> universal:package-zip-tarball +> universal:packageZipTarball $ exists target/universal/simple-package.tgz # Run the txz packaging. -> universal:package-xz-tarball +> universal:packageXzTarball $ exists target/universal/simple-package.txz \ No newline at end of file diff --git a/src/sbt-test/universal/test-zips-no-top-level-dir/test b/src/sbt-test/universal/test-zips-no-top-level-dir/test index 5ac479906..2dd300104 100644 --- a/src/sbt-test/universal/test-zips-no-top-level-dir/test +++ b/src/sbt-test/universal/test-zips-no-top-level-dir/test @@ -3,11 +3,11 @@ $ exists target/universal/simple-test-0.1.0.zip # Run the tgz packaging. -> universal:package-zip-tarball +> universal:packageZipTarball $ exists target/universal/simple-test-0.1.0.tgz # Run the txz packaging. -> universal:package-xz-tarball +> universal:packageXzTarball $ exists target/universal/simple-test-0.1.0.txz diff --git a/src/sbt-test/universal/test-zips/test b/src/sbt-test/universal/test-zips/test index 128f47335..cd0caebb5 100644 --- a/src/sbt-test/universal/test-zips/test +++ b/src/sbt-test/universal/test-zips/test @@ -7,11 +7,11 @@ $ exists target/universal-docs/simple-test-0.1.0.zip $ exists target/universal-src/simple-test-0.1.0.zip # Run the tgz packaging. -> universal:package-zip-tarball +> universal:packageZipTarball $ exists target/universal/simple-test-0.1.0.tgz # Run the txz packaging. -> universal:package-xz-tarball +> universal:packageXzTarball $ exists target/universal/simple-test-0.1.0.txz diff --git a/src/sbt-test/windows/absolute-path-in-bat/build.sbt b/src/sbt-test/windows/absolute-path-in-bat/build.sbt index 12d06b2f1..a7ccbf37d 100644 --- a/src/sbt-test/windows/absolute-path-in-bat/build.sbt +++ b/src/sbt-test/windows/absolute-path-in-bat/build.sbt @@ -6,7 +6,7 @@ version := "0.1.0" scriptClasspath in batScriptReplacements ++= Seq("x:\\dummy\\absolute\\path", "relative\\path") -TaskKey[Unit]("run-check") := { +TaskKey[Unit]("runCheck") := { val dir = (stagingDirectory in Universal).value val bat = IO.read(dir / "bin" / "absolute-path-in-bat.bat") diff --git a/src/sbt-test/windows/absolute-path-in-bat/test b/src/sbt-test/windows/absolute-path-in-bat/test index 877989c06..61dad9b64 100644 --- a/src/sbt-test/windows/absolute-path-in-bat/test +++ b/src/sbt-test/windows/absolute-path-in-bat/test @@ -1,3 +1,3 @@ # Run the staging and check the script. > stage -> run-check \ No newline at end of file +> runCheck \ No newline at end of file diff --git a/src/sbt-test/windows/java-app-archetype/build.sbt b/src/sbt-test/windows/java-app-archetype/build.sbt index 14c77de90..b5b744ed1 100644 --- a/src/sbt-test/windows/java-app-archetype/build.sbt +++ b/src/sbt-test/windows/java-app-archetype/build.sbt @@ -16,16 +16,16 @@ wixProductId := "ce07be71-510d-414a-92d4-dff47631848a" wixProductUpgradeId := "4552fb0e-e257-4dbd-9ecb-dba9dbacf424" -TaskKey[Unit]("check-script") := { +TaskKey[Unit]("checkScript") := { val script = (stagingDirectory in Universal).value / "bin" / (name.value + ".bat") val cmd = Seq("cmd", "/c", script.getAbsolutePath) val result = - Process(cmd) ! streams.value.log match { + sys.process.Process(cmd) ! streams.value.log match { case 0 => () case n => sys.error("Failed to run script: " + script.getAbsolutePath + " error code: " + n) } - val output = Process(cmd).!! + val output = sys.process.Process(cmd).!! val expected = "SUCCESS!" assert( output contains expected, diff --git a/src/sbt-test/windows/java-app-archetype/test b/src/sbt-test/windows/java-app-archetype/test index a206e5112..4f750d82e 100644 --- a/src/sbt-test/windows/java-app-archetype/test +++ b/src/sbt-test/windows/java-app-archetype/test @@ -3,4 +3,4 @@ $ exists target/windows/windows-test.msi > stage $ exists target/universal/stage/bin/windows-test.bat -> check-script +> checkScript diff --git a/src/sbt-test/windows/multiple-apps/build.sbt b/src/sbt-test/windows/multiple-apps/build.sbt index 3a0e4d185..cbd61b2fc 100644 --- a/src/sbt-test/windows/multiple-apps/build.sbt +++ b/src/sbt-test/windows/multiple-apps/build.sbt @@ -5,30 +5,30 @@ enablePlugins(JavaAppPackaging) name := "test-project" version := "0.1.0" -TaskKey[Unit]("check-no-explicit-main") := { +TaskKey[Unit]("checkNoExplicitMain") := { val cwd = (stagingDirectory in Universal).value // check MainApp val cmd = Seq((cwd / "bin" / "main-app.bat").getAbsolutePath) - val output = Process(cmd, cwd).!!.replaceAll("\n", "").replaceAll("\r", "") + val output = sys.process.Process(cmd, cwd).!!.replaceAll("\n", "").replaceAll("\r", "") assert(output == "MainApp", s"Output wasn't 'MainApp', but '$output'") // check SecondApp val cmdSecond = Seq((cwd / "bin" / "second-app.bat").getAbsolutePath) - val outputSecond = Process(cmdSecond, cwd).!!.replaceAll("\n", "").replaceAll("\r", "") + val outputSecond = sys.process.Process(cmdSecond, cwd).!!.replaceAll("\n", "").replaceAll("\r", "") assert(outputSecond == "SecondApp", s"Output wasn't 'SecondApp': '$outputSecond'") } -TaskKey[Unit]("check-explicit-main") := { +TaskKey[Unit]("checkExplicitMain") := { val cwd = (stagingDirectory in Universal).value // check default start script val cmd = Seq((cwd / "bin" / s"${executableScriptName.value}.bat").getAbsolutePath) - val output = Process(cmd, cwd).!!.replaceAll("\n", "").replaceAll("\r", "") + val output = sys.process.Process(cmd, cwd).!!.replaceAll("\n", "").replaceAll("\r", "") assert(output == "MainApp", s"Output wasn't 'MainApp', but '$output'") // check SecondApp val cmdSecond = Seq((cwd / "bin" / "second-app.bat").getAbsolutePath) - val outputSecond = Process(cmdSecond, cwd).!!.replaceAll("\n", "").replaceAll("\r", "") + val outputSecond = sys.process.Process(cmdSecond, cwd).!!.replaceAll("\n", "").replaceAll("\r", "") assert(outputSecond == "SecondApp", s"Output wasn't 'SecondApp', but '$outputSecond'") } diff --git a/src/sbt-test/windows/multiple-apps/test b/src/sbt-test/windows/multiple-apps/test index bb4715e6c..e47f8e132 100644 --- a/src/sbt-test/windows/multiple-apps/test +++ b/src/sbt-test/windows/multiple-apps/test @@ -2,10 +2,10 @@ > stage $ exists target/universal/stage/bin/main-app.bat $ exists target/universal/stage/bin/second-app.bat -> check-no-explicit-main +> checkNoExplicitMain > clean > set mainClass in Compile := Some("com.example.MainApp") > stage $ exists target/universal/stage/bin/test-project.bat $ exists target/universal/stage/bin/second-app.bat -> check-explicit-main \ No newline at end of file +> checkExplicitMain \ No newline at end of file diff --git a/src/sbt-test/windows/test-bat-template/build.sbt b/src/sbt-test/windows/test-bat-template/build.sbt index 930cf6083..339021ec8 100644 --- a/src/sbt-test/windows/test-bat-template/build.sbt +++ b/src/sbt-test/windows/test-bat-template/build.sbt @@ -35,7 +35,7 @@ batScriptExtraDefines += "exit /B" batScriptExtraDefines += ":print_args_end" -TaskKey[Unit]("check-script") := { +TaskKey[Unit]("checkScript") := { val dir = (stagingDirectory in Universal).value import scala.sys.process._ val fails = new StringBuilder() @@ -56,7 +56,7 @@ TaskKey[Unit]("check-script") := { val pr = new StringBuilder() val logger = ProcessLogger((o: String) => pr.append(o + "\n"), (e: String) => pr.append("error < " + e + "\n")) val cmd = Seq("cmd", "/c", script.getAbsolutePath + " " + args) - val result = Process(cmd, None, env.toSeq: _*) ! logger + val result = sys.process.Process(cmd, None, env.toSeq: _*) ! logger if (result != expectedRC) { pr.append("error code: " + result + "\n") } @@ -78,7 +78,7 @@ TaskKey[Unit]("check-script") := { fails.append(crlf2cr(pr.toString) + "\n") fails.append("\n--detail-------------------------------\n") pr.clear - Process(Seq("cmd", "/c", detailScript.getAbsolutePath + " " + args), None, env.toSeq: _*) ! logger + sys.process.Process(Seq("cmd", "/c", detailScript.getAbsolutePath + " " + args), None, env.toSeq: _*) ! logger fails.append(crlf2cr(pr.toString) + "\n") } if (debugOutFile.exists) { diff --git a/src/sbt-test/windows/test-bat-template/test b/src/sbt-test/windows/test-bat-template/test index 5d5185949..faaa3ec4b 100644 --- a/src/sbt-test/windows/test-bat-template/test +++ b/src/sbt-test/windows/test-bat-template/test @@ -1,4 +1,4 @@ # Run the windows batch. > stage $ exists target/universal/stage/bin/windows-test.bat -> check-script +> checkScript diff --git a/src/sbt-test/windows/test-custom-main/build.sbt b/src/sbt-test/windows/test-custom-main/build.sbt index b33aa6564..9797baa3f 100644 --- a/src/sbt-test/windows/test-custom-main/build.sbt +++ b/src/sbt-test/windows/test-custom-main/build.sbt @@ -8,19 +8,19 @@ version := "0.1.0" mainClass in Compile := Some("Main") -TaskKey[Unit]("check-app-main") := { +TaskKey[Unit]("checkAppMain") := { val zipFile = (packageBin in Universal).value val process = - sbt.Process("target/universal/stage/bin/test-custom-main.bat") + sys.process.Process("target/universal/stage/bin/test-custom-main.bat") val out = (process !!) if (out.trim != "App Main Method") error("unexpected output: " + out) () } -TaskKey[Unit]("check-custom-main") := { +TaskKey[Unit]("checkCustomMain") := { val zipFile = (packageBin in Universal).value val process = - Process("target/universal/stage/bin/test-custom-main.bat", Seq("-main", "CustomMain")) + sys.process.Process("target/universal/stage/bin/test-custom-main.bat", Seq("-main", "CustomMain")) val out = (process !!) if (out.trim != "Custom Main Method") error("unexpected output: " + out) () diff --git a/src/sbt-test/windows/test-custom-main/test b/src/sbt-test/windows/test-custom-main/test index e5b91b2fe..3e67cf9e7 100644 --- a/src/sbt-test/windows/test-custom-main/test +++ b/src/sbt-test/windows/test-custom-main/test @@ -2,6 +2,6 @@ > stage $ exists target/universal/stage/bin/ $ exists target/universal/stage/bin/test-custom-main.bat -> check-app-main -> check-custom-main +> checkAppMain +> checkCustomMain From c52a67dbef11007e08ce6cb244f3f754afee25e7 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Sun, 9 Jul 2017 15:42:44 +0200 Subject: [PATCH 11/47] Fix jdk-packager script tests --- src/sbt-test/jdkpackager/test-package-mappings/build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sbt-test/jdkpackager/test-package-mappings/build.sbt b/src/sbt-test/jdkpackager/test-package-mappings/build.sbt index f472dfafb..3bcea394f 100644 --- a/src/sbt-test/jdkpackager/test-package-mappings/build.sbt +++ b/src/sbt-test/jdkpackager/test-package-mappings/build.sbt @@ -20,7 +20,7 @@ mappings in Universal += baseDirectory.value / "src" / "deploy" / "README.md" -> mappings in Universal ++= { val dir = baseDirectory.value / "src" / "deploy" / "stuff" - (dir.**(AllPassFilter) --- dir) pair relativeTo(dir.getParentFile) + (dir.**(AllPassFilter) --- dir) pair (file => IO.relativize(dir.getParentFile, file)) } lazy val iconGlob = sys.props("os.name").toLowerCase match { From 40ddcdbadbbac952f2af6a79360c285a0ef1726d Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Sun, 9 Jul 2017 15:58:08 +0200 Subject: [PATCH 12/47] Fix travis osx oraclejdk8 issue: travis-ci/travis-ci/issues/2316 --- .travis.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.travis.yml b/.travis.yml index 7281936b0..8eeb45fb8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ env: - SBT_VERSION_CMD="++2.10.6" - SBT_VERSION_CMD="++2.12.2 ^^1.0.0-M6" jdk: oraclejdk8 + before_install: - if [[ "$TRAVIS_OS_NAME" = "osx" ]]; then brew update; @@ -19,6 +20,15 @@ script: ./sbt "$SBT_VERSION_CMD validateLinux" ; fi +matrix: + include: + - os: linux + jdk: oraclejdk8 + # oraclejdk8 is not yet available. + # see https://github.com/travis-ci/travis-ci/issues/2316 + - os: osx + osx_image: xcode8 + addons: apt: packages: From 36e756d95cb8e98e0d0914920bd4505f4a4c5719 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Mon, 10 Jul 2017 21:25:04 +0200 Subject: [PATCH 13/47] Reduce travis ci test matrix --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8eeb45fb8..4e9a47f94 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,4 @@ language: java -os: - - linux - - osx env: - SBT_VERSION_CMD="++2.10.6" - SBT_VERSION_CMD="++2.12.2 ^^1.0.0-M6" From 4163bf0e8f1976e4eb3af14530b75def8bd05b0f Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Mon, 10 Jul 2017 21:28:00 +0200 Subject: [PATCH 14/47] Update out-dated akka dependency in scripted test --- src/sbt-test/jar/launcher-jar/build.sbt | 2 +- src/sbt-test/jar/launcher-jar/src/main/scala/test/Test.scala | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/sbt-test/jar/launcher-jar/build.sbt b/src/sbt-test/jar/launcher-jar/build.sbt index 0ef4156f6..af2927d1b 100644 --- a/src/sbt-test/jar/launcher-jar/build.sbt +++ b/src/sbt-test/jar/launcher-jar/build.sbt @@ -7,7 +7,7 @@ name := "launcher-jar-test" version := "0.1.0" // test dependencies sample -libraryDependencies ++= Seq("com.typesafe.akka" %% "akka-kernel" % "2.3.4") +libraryDependencies ++= Seq("com.typesafe.akka" %% "akka-actor" % "2.5.3") TaskKey[Unit]("checkClasspath") := { val dir = (stagingDirectory in Universal).value diff --git a/src/sbt-test/jar/launcher-jar/src/main/scala/test/Test.scala b/src/sbt-test/jar/launcher-jar/src/main/scala/test/Test.scala index 23a87b45e..1b5d940fd 100644 --- a/src/sbt-test/jar/launcher-jar/src/main/scala/test/Test.scala +++ b/src/sbt-test/jar/launcher-jar/src/main/scala/test/Test.scala @@ -3,9 +3,8 @@ package test // use dependency library import akka.actor._ -import akka.routing.RoundRobinRouter -class PrintActor extends Actor{ +class PrintActor extends Actor { def receive = { case msg => println(msg) } @@ -15,5 +14,5 @@ object Test extends App { val system = ActorSystem("testSystem") val router = system.actorOf(Props[PrintActor]) router ! "SUCCESS!!" - system.shutdown + system.terminate() } From ef2c512158a19f37e50d02d6bcf2615210a0ad21 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Tue, 11 Jul 2017 22:52:01 +0200 Subject: [PATCH 15/47] Replace akka with typesafe config as a dependency test We need a stable library for scala 2.10 and 2.12. A java lib is more suitable here. --- src/sbt-test/jar/launcher-jar/build.sbt | 4 ++-- .../launcher-jar/src/main/scala/test/Test.scala | 16 +++++----------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/sbt-test/jar/launcher-jar/build.sbt b/src/sbt-test/jar/launcher-jar/build.sbt index af2927d1b..d6268a5a8 100644 --- a/src/sbt-test/jar/launcher-jar/build.sbt +++ b/src/sbt-test/jar/launcher-jar/build.sbt @@ -7,7 +7,7 @@ name := "launcher-jar-test" version := "0.1.0" // test dependencies sample -libraryDependencies ++= Seq("com.typesafe.akka" %% "akka-actor" % "2.5.3") +libraryDependencies += "com.typesafe" % "config" % "1.3.1" TaskKey[Unit]("checkClasspath") := { val dir = (stagingDirectory in Universal).value @@ -26,7 +26,7 @@ TaskKey[Unit]("checkClasspath") := { val jar = new java.util.jar.JarFile(dir / "lib" / "launcher-jar-test.launcher-jar-test-0.1.0-launcher.jar") val attributes = jar.getManifest().getMainAttributes() assert( - attributes.getValue("Class-Path").toString() contains "com.typesafe.akka.akka-actor", + attributes.getValue("Class-Path").toString() contains "com.typesafe.config", "MANIFEST Class-Path should contain akka-actor:\n" + attributes.getValue("Class-Path").toString() ) assert( diff --git a/src/sbt-test/jar/launcher-jar/src/main/scala/test/Test.scala b/src/sbt-test/jar/launcher-jar/src/main/scala/test/Test.scala index 1b5d940fd..5d7c8d7c5 100644 --- a/src/sbt-test/jar/launcher-jar/src/main/scala/test/Test.scala +++ b/src/sbt-test/jar/launcher-jar/src/main/scala/test/Test.scala @@ -1,18 +1,12 @@ package test // use dependency library +import com.typesafe.config._ -import akka.actor._ +object Test extends App { -class PrintActor extends Actor { - def receive = { - case msg => println(msg) - } -} + val config = ConfigFactory.load() + + println("SUCCESS!") -object Test extends App { - val system = ActorSystem("testSystem") - val router = system.actorOf(Props[PrintActor]) - router ! "SUCCESS!!" - system.terminate() } From cbb412b294b7f0f8e0d4d514f6d81c0b4019c84e Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Wed, 12 Jul 2017 20:16:05 +0200 Subject: [PATCH 16/47] Fix wrong task names --- src/sbt-test/ash/memory-settings/build.sbt | 2 +- src/sbt-test/ash/memory-settings/test | 2 +- src/sbt-test/bash/memory-settings/build.sbt | 2 +- src/sbt-test/bash/memory-settings/test | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sbt-test/ash/memory-settings/build.sbt b/src/sbt-test/ash/memory-settings/build.sbt index 6ed40b374..e0c5aa259 100644 --- a/src/sbt-test/ash/memory-settings/build.sbt +++ b/src/sbt-test/ash/memory-settings/build.sbt @@ -6,7 +6,7 @@ version := "0.1.0" bashScriptExtraDefines ++= Seq("""addJava "-Xms64m"""", """addJava "-Xmx64m"""") -TaskKey[Unit]("script-check") := { +TaskKey[Unit]("scriptCheck") := { val startScript = (stagingDirectory in Universal).value / "bin" / executableScriptName.value val options = IO.read(startScript) assert(options contains """addJava "-Xms64m"""", "Script doesn't contain xmx setting:\n" + options) diff --git a/src/sbt-test/ash/memory-settings/test b/src/sbt-test/ash/memory-settings/test index 892e86baf..b2923955e 100644 --- a/src/sbt-test/ash/memory-settings/test +++ b/src/sbt-test/ash/memory-settings/test @@ -1,5 +1,5 @@ # Run the staging and check the script. > stage $ exists target/universal/stage/bin/simple-app -> script-check +> scriptCheck > runCheck \ No newline at end of file diff --git a/src/sbt-test/bash/memory-settings/build.sbt b/src/sbt-test/bash/memory-settings/build.sbt index e3c99af93..4006beaec 100644 --- a/src/sbt-test/bash/memory-settings/build.sbt +++ b/src/sbt-test/bash/memory-settings/build.sbt @@ -8,7 +8,7 @@ version := "0.1.0" javaOptions in Universal ++= Seq("-J-Xmx64m", "-J-Xms64m") -TaskKey[Unit]("jvmopts-check") := { +TaskKey[Unit]("jvmoptsCheck") := { val jvmopts = (stagingDirectory in Universal).value / "conf" / "application.ini" val options = IO.read(jvmopts) assert(options contains "-J-Xmx64m", "Options don't contain xmx setting:\n" + options) diff --git a/src/sbt-test/bash/memory-settings/test b/src/sbt-test/bash/memory-settings/test index 719ec9e01..c50f2af5e 100644 --- a/src/sbt-test/bash/memory-settings/test +++ b/src/sbt-test/bash/memory-settings/test @@ -1,5 +1,5 @@ # Run the staging and check the script. > stage $ exists target/universal/stage/conf/application.ini -> jvmopts-check +> jvmoptsCheck > runCheck \ No newline at end of file From 51d0b236638e44adbf87ad6e3710c201e47e4697 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Wed, 12 Jul 2017 20:16:12 +0200 Subject: [PATCH 17/47] Replace akka with typesafe config as a dependency test We need a stable library for scala 2.10 and 2.12. A java lib is more suitable here. --- src/sbt-test/jar/classpath-jar/build.sbt | 6 ++--- .../src/main/scala/test/Test.scala | 25 +++---------------- .../jar/launcher-jar with spaces/build.sbt | 4 +-- .../src/main/scala/test/Test.scala | 17 ++++--------- 4 files changed, 13 insertions(+), 39 deletions(-) diff --git a/src/sbt-test/jar/classpath-jar/build.sbt b/src/sbt-test/jar/classpath-jar/build.sbt index d962541ce..101cdf4da 100644 --- a/src/sbt-test/jar/classpath-jar/build.sbt +++ b/src/sbt-test/jar/classpath-jar/build.sbt @@ -7,16 +7,14 @@ name := "classpath-jar-test" version := "0.1.0" // test dependencies sample -libraryDependencies ++= Seq("com.typesafe.akka" %% "akka-kernel" % "2.3.4") +libraryDependencies += "com.typesafe" % "config" % "1.3.1" TaskKey[Unit]("checkClasspath") := { val dir = (stagingDirectory in Universal).value val bat = IO.read(dir / "bin" / "classpath-jar-test.bat") assert(bat contains "set \"APP_CLASSPATH=%APP_LIB_DIR%\\classpath-jar-test.classpath-jar-test-0.1.0-classpath.jar\"") val jar = new java.util.jar.JarFile(dir / "lib" / "classpath-jar-test.classpath-jar-test-0.1.0-classpath.jar") - assert( - jar.getManifest().getMainAttributes().getValue("Class-Path").toString() contains "com.typesafe.akka.akka-actor" - ) + assert(jar.getManifest().getMainAttributes().getValue("Class-Path").toString() contains "com.typesafe.config") jar close } diff --git a/src/sbt-test/jar/classpath-jar/src/main/scala/test/Test.scala b/src/sbt-test/jar/classpath-jar/src/main/scala/test/Test.scala index 19b48f36e..5d7c8d7c5 100644 --- a/src/sbt-test/jar/classpath-jar/src/main/scala/test/Test.scala +++ b/src/sbt-test/jar/classpath-jar/src/main/scala/test/Test.scala @@ -1,29 +1,12 @@ package test // use dependency library - -import akka.actor._ -import akka.pattern._ -import akka.routing.RoundRobinRouter -import akka.util.Timeout -import scala.concurrent.duration._ - -class PrintActor extends Actor{ - def receive = { - case msg => - println(msg) - context.sender ! "ok" - } -} +import com.typesafe.config._ object Test extends App { - implicit val timeout = Timeout(3 seconds) - val system = ActorSystem("testSystem") - import system.dispatcher + val config = ConfigFactory.load() + + println("SUCCESS!") - val router = system.actorOf(Props[PrintActor]) - (router ? "SUCCESS!!").foreach { _ => - system.shutdown - } } diff --git a/src/sbt-test/jar/launcher-jar with spaces/build.sbt b/src/sbt-test/jar/launcher-jar with spaces/build.sbt index 23a1fc354..8fe21feed 100644 --- a/src/sbt-test/jar/launcher-jar with spaces/build.sbt +++ b/src/sbt-test/jar/launcher-jar with spaces/build.sbt @@ -5,7 +5,7 @@ name := "launcher-jar-test" version := "0.1.0" // test dependencies sample -libraryDependencies ++= Seq("com.typesafe.akka" %% "akka-kernel" % "2.3.4") +libraryDependencies += "com.typesafe" % "config" % "1.3.1" TaskKey[Unit]("checkClasspath") := { val dir = (stagingDirectory in Universal).value @@ -24,7 +24,7 @@ TaskKey[Unit]("checkClasspath") := { val jar = new java.util.jar.JarFile(dir / "lib" / "launcher-jar-test.launcher-jar-test-0.1.0-launcher.jar") val attributes = jar.getManifest().getMainAttributes() assert( - attributes.getValue("Class-Path").toString() contains "com.typesafe.akka.akka-actor", + attributes.getValue("Class-Path").toString() contains "com.typesafe.config", "MANIFEST Class-Path should contain akka-actor:\n" + attributes.getValue("Class-Path").toString() ) assert( diff --git a/src/sbt-test/jar/launcher-jar with spaces/src/main/scala/test/Test.scala b/src/sbt-test/jar/launcher-jar with spaces/src/main/scala/test/Test.scala index 23a87b45e..5d7c8d7c5 100644 --- a/src/sbt-test/jar/launcher-jar with spaces/src/main/scala/test/Test.scala +++ b/src/sbt-test/jar/launcher-jar with spaces/src/main/scala/test/Test.scala @@ -1,19 +1,12 @@ package test // use dependency library +import com.typesafe.config._ -import akka.actor._ -import akka.routing.RoundRobinRouter +object Test extends App { -class PrintActor extends Actor{ - def receive = { - case msg => println(msg) - } -} + val config = ConfigFactory.load() + + println("SUCCESS!") -object Test extends App { - val system = ActorSystem("testSystem") - val router = system.actorOf(Props[PrintActor]) - router ! "SUCCESS!!" - system.shutdown } From abc5590adfe3b269dc1f620cc25b5d96782a00ac Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Wed, 12 Jul 2017 20:16:25 +0200 Subject: [PATCH 18/47] Polyfill new method `withClassifier` on sbt.Artifact --- .../com/typesafe/sbt/packager/Compat.scala | 11 ++++++++++- .../universal/multiproject-classifiers/build.sbt | 4 +++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/Compat.scala b/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/Compat.scala index f5d177289..733137bf3 100644 --- a/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/Compat.scala +++ b/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/Compat.scala @@ -1,6 +1,6 @@ package com.typesafe.sbt.packager -import sbt.{BufferedLogger, FullLogger, Logger} +import sbt.{Artifact, BufferedLogger, FullLogger, Logger} import scala.sys.process.ProcessLogger @@ -34,4 +34,13 @@ object Compat { */ implicit def sbtProcessLogger2ScalaProcessLogger(logger: sbt.ProcessLogger): sys.process.ProcessLogger = ProcessLogger(msg => logger.info(msg), err => logger.error(err)) + + /** + * Use in the scripted `universal/multiproject-classifiers` test. + * @param artifact polyfill new methods + */ + implicit class CompatArtifact(artifact: Artifact) { + def withClassifier(classifier: Option[String]): Artifact = + artifact.copy(classifier = classifier) + } } diff --git a/src/sbt-test/universal/multiproject-classifiers/build.sbt b/src/sbt-test/universal/multiproject-classifiers/build.sbt index 9c97e161d..df7172d2b 100644 --- a/src/sbt-test/universal/multiproject-classifiers/build.sbt +++ b/src/sbt-test/universal/multiproject-classifiers/build.sbt @@ -1,3 +1,5 @@ +import com.typesafe.sbt.packager.Compat._ + lazy val appVersion = "1.0" lazy val mySettings: Seq[Setting[_]] = @@ -17,7 +19,7 @@ lazy val sub = project .settings(mySettings) .settings( ivyConfigurations += assets, - artifact in assets := artifact.value.copy(classifier = Some("assets")), + artifact in assets := artifact.value.withClassifier(classifier = Some("assets")), packagedArtifacts += { val file = target.value / "assets.jar" val assetsDir = baseDirectory.value / "src" / "main" / "assets" From e3cc74288cd977f48f357ca9d6bc1038fdcab7c7 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Wed, 12 Jul 2017 20:42:57 +0200 Subject: [PATCH 19/47] Remove jdk definition --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4e9a47f94..5b6a5a935 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ language: java env: - SBT_VERSION_CMD="++2.10.6" - SBT_VERSION_CMD="++2.12.2 ^^1.0.0-M6" -jdk: oraclejdk8 before_install: - if [[ "$TRAVIS_OS_NAME" = "osx" ]]; then From 4dfcbc5d5b67216e232df4e35a95d9672f55785a Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Wed, 12 Jul 2017 20:45:33 +0200 Subject: [PATCH 20/47] List every test setup explicitly for travis --- .travis.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5b6a5a935..28ce86aa9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,4 @@ language: java -env: - - SBT_VERSION_CMD="++2.10.6" - - SBT_VERSION_CMD="++2.12.2 ^^1.0.0-M6" before_install: - if [[ "$TRAVIS_OS_NAME" = "osx" ]]; then @@ -19,6 +16,13 @@ script: matrix: include: - os: linux + env: SBT_VERSION_CMD="++2.10.6" + jdk: openjdk7 + - os: linux + env: SBT_VERSION_CMD="++2.10.6" + jdk: oraclejdk8 + - os: linux + env: SBT_VERSION_CMD="++2.12.2 ^^1.0.0-M6" jdk: oraclejdk8 # oraclejdk8 is not yet available. # see https://github.com/travis-ci/travis-ci/issues/2316 From b5c528a5941628fcdd19746d7255ff8e3743e5c0 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Wed, 12 Jul 2017 20:46:39 +0200 Subject: [PATCH 21/47] Also set env for the osx build --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 28ce86aa9..127cc055e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,9 +24,13 @@ matrix: - os: linux env: SBT_VERSION_CMD="++2.12.2 ^^1.0.0-M6" jdk: oraclejdk8 + - os: osx + env: SBT_VERSION_CMD="++2.10.6" + jdk: openjdk7 # oraclejdk8 is not yet available. # see https://github.com/travis-ci/travis-ci/issues/2316 - os: osx + env: SBT_VERSION_CMD="++2.12.2 ^^1.0.0-M6" osx_image: xcode8 addons: From 5767bcf29b60f33856c241bf86e00119d838f4f9 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Wed, 12 Jul 2017 22:16:05 +0200 Subject: [PATCH 22/47] Only use java8 for testing and output scripted buffer --- .travis.yml | 6 ------ build.sbt | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 127cc055e..01be4b526 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,18 +15,12 @@ script: matrix: include: - - os: linux - env: SBT_VERSION_CMD="++2.10.6" - jdk: openjdk7 - os: linux env: SBT_VERSION_CMD="++2.10.6" jdk: oraclejdk8 - os: linux env: SBT_VERSION_CMD="++2.12.2 ^^1.0.0-M6" jdk: oraclejdk8 - - os: osx - env: SBT_VERSION_CMD="++2.10.6" - jdk: openjdk7 # oraclejdk8 is not yet available. # see https://github.com/travis-ci/travis-ci/issues/2316 - os: osx diff --git a/build.sbt b/build.sbt index 00adb55c5..b634245cb 100644 --- a/build.sbt +++ b/build.sbt @@ -131,7 +131,7 @@ scalafmtConfig := Some(file(".scalafmt.conf")) // ci commands addCommandAlias( "validate", - "; update ; test ; scripted jdkpackager/test-package-minimal jdkpackager/test-package-mappings" + "; update ; test ; set scriptedBufferLog := false ; scripted jdkpackager/test-package-minimal jdkpackager/test-package-mappings" ) addCommandAlias("validateUnix", "scripted universal/* jar/* bash/* ash/*") From ef89e318fd3da5a63c879e24d44650e8c55cc401 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Sun, 16 Jul 2017 22:12:48 +0200 Subject: [PATCH 23/47] Another approach for travis --- .travis.yml | 36 +++++++++++++++++++++++------------- build.sbt | 29 +++++++++++++++++------------ 2 files changed, 40 insertions(+), 25 deletions(-) diff --git a/.travis.yml b/.travis.yml index 01be4b526..e2e72f804 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,26 +1,36 @@ language: java +os: linux +jdk: oraclejdk8 + +env: + - SBT_TEST_CMD="validate" + - SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validate" + - SBT_TEST_CMD="validateUniversal" + - SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateUniversal" + - SBT_TEST_CMD="validateJar" + - SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateJar" + - SBT_TEST_CMD="validateBash" + - SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateBash" + - SBT_TEST_CMD="validateAsh" + - SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateAsh" + - SBT_TEST_CMD="validateRpm" + - SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateRpm" + - SBT_TEST_CMD="validateDebian" + - SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateDebian" + - SBT_TEST_CMD="validateDocker" + - SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateDocker" + - SBT_TEST_CMD="validateJdkPackager" + - SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateJdkPackager" before_install: - if [[ "$TRAVIS_OS_NAME" = "osx" ]]; then brew update; brew install xz; fi -script: - - if [[ "$TRAVIS_OS_NAME" = "osx" ]]; then - ./sbt "$SBT_VERSION_CMD validateOSX" ; - fi - - if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then - ./sbt "$SBT_VERSION_CMD validateLinux" ; - fi +script: ./sbt "$SBT_TEST_CMD" ; matrix: include: - - os: linux - env: SBT_VERSION_CMD="++2.10.6" - jdk: oraclejdk8 - - os: linux - env: SBT_VERSION_CMD="++2.12.2 ^^1.0.0-M6" - jdk: oraclejdk8 # oraclejdk8 is not yet available. # see https://github.com/travis-ci/travis-ci/issues/2316 - os: osx diff --git a/build.sbt b/build.sbt index b634245cb..7d15c9094 100644 --- a/build.sbt +++ b/build.sbt @@ -129,15 +129,20 @@ bintrayRepository := "sbt-plugin-releases" scalafmtConfig := Some(file(".scalafmt.conf")) // ci commands -addCommandAlias( - "validate", - "; update ; test ; set scriptedBufferLog := false ; scripted jdkpackager/test-package-minimal jdkpackager/test-package-mappings" -) -addCommandAlias("validateUnix", "scripted universal/* jar/* bash/* ash/*") - -addCommandAlias("validateOSX", "; validate ; validateUnix") -addCommandAlias( - "validateLinux", - "; validate ; validateUnix ; scripted rpm/* debian/* docker/staging docker/entrypoint docker/ports docker/volumes" -) -addCommandAlias("validateWindows", ";test-only * -- -n windows;scripted universal/dist universal/stage windows/*") +addCommandAlias("validate", "; clean ; update ; test") + +// List all scripted test separately to schedule them in different travis-ci jobs. +// Travis-CI has hard timeouts for jobs, so we run them in smaller jobs as the scripted +// tests take quite some time to run. +// Ultimatley we should run only those tests that are necessary for a change +addCommandAlias("validateUniversal", "scripted universal/*") +addCommandAlias("validateJar", "scripted jar/*") +addCommandAlias("validateBash", "scripted bash/*") +addCommandAlias("validateAsh", "scripted ash/*") +addCommandAlias("validateRpm", "scripted rpm/*") +addCommandAlias("validateDebian", "scripted debian/*") +addCommandAlias("validateDocker", "scripted docker/*") +addCommandAlias("validateJdkPackager", "scripted docker/*") + +// TODO check the cygwin scripted tests and run them on appveyor +addCommandAlias("validateWindows", "; test-only * -- -n windows;scripted universal/dist universal/stage windows/*") From d9ffbaa42ab18d9c08bc324ffd39aed598569471 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Mon, 17 Jul 2017 19:41:29 +0200 Subject: [PATCH 24/47] Fix rpm scripted tests --- src/sbt-test/rpm/override-loader-functions/build.sbt | 2 +- src/sbt-test/rpm/scriptlets-override-rpm/build.sbt | 2 +- src/sbt-test/rpm/scriptlets-override-rpm/test | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sbt-test/rpm/override-loader-functions/build.sbt b/src/sbt-test/rpm/override-loader-functions/build.sbt index a28a7ba66..65688f54d 100644 --- a/src/sbt-test/rpm/override-loader-functions/build.sbt +++ b/src/sbt-test/rpm/override-loader-functions/build.sbt @@ -25,7 +25,7 @@ rpmGroup := Some("test-group") TaskKey[Unit]("checkLoaderScript") := { val path = target.value / "rpm" / "RPMS" / "noarch" / "rpm-test-0.1.0-1.noarch.rpm" - val scripts = s"rpm -qp --scripts ${path.absolutePath}".!! + val scripts = sys.process.Process(s"rpm -qp --scripts ${path.absolutePath}").!! assert(scripts.contains("# right systemd template"), s"override script wasn't picked, scripts are\n$scripts") assert(!scripts.contains("wrong start template"), s"scripts contained wrong template, scripts are\n$scripts") diff --git a/src/sbt-test/rpm/scriptlets-override-rpm/build.sbt b/src/sbt-test/rpm/scriptlets-override-rpm/build.sbt index 561bb0b8d..895831d8a 100644 --- a/src/sbt-test/rpm/scriptlets-override-rpm/build.sbt +++ b/src/sbt-test/rpm/scriptlets-override-rpm/build.sbt @@ -43,7 +43,7 @@ def countSubstring(str: String, substr: String): Int = def isUnique(str: String, searchstr: String): Boolean = countSubstring(str, searchstr) == 1 -TaskKey[Unit]("unique-scripts-in-spec-file") := { +TaskKey[Unit]("uniqueSccriptsInSpecFile") := { val spec = IO.read(target.value / "rpm" / "SPECS" / "rpm-test.spec") assert(isUnique(spec, "echo postinst"), "'echo 'postinst' not unique in \n" + spec) assert(isUnique(spec, "echo preinst"), "'echo 'preinst' not unique in \n" + spec) diff --git a/src/sbt-test/rpm/scriptlets-override-rpm/test b/src/sbt-test/rpm/scriptlets-override-rpm/test index aa94cde1d..15afea396 100644 --- a/src/sbt-test/rpm/scriptlets-override-rpm/test +++ b/src/sbt-test/rpm/scriptlets-override-rpm/test @@ -23,4 +23,4 @@ $ exists var/run/rpm-test > set NativePackagerKeys.rpmBrpJavaRepackJars := false > checkSpecFile -> unique-scripts-in-spec-file \ No newline at end of file +> uniqueSccriptsInSpecFile \ No newline at end of file From 209e7b81abdf74811d8181a7e3e8f2c8a7929606 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Mon, 17 Jul 2017 19:42:19 +0200 Subject: [PATCH 25/47] Rebase and fix newly added test --- src/sbt-test/rpm/snapshot-override-rpm/build.sbt | 2 +- src/sbt-test/rpm/snapshot-override-rpm/test | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sbt-test/rpm/snapshot-override-rpm/build.sbt b/src/sbt-test/rpm/snapshot-override-rpm/build.sbt index 9eed1209e..fa3da01e4 100644 --- a/src/sbt-test/rpm/snapshot-override-rpm/build.sbt +++ b/src/sbt-test/rpm/snapshot-override-rpm/build.sbt @@ -19,7 +19,7 @@ rpmLicense := Some("BSD") version in Rpm := "1" -TaskKey[Unit]("check-snapshot") := { +TaskKey[Unit]("checkSnapshot") := { assert(rpmRelease.value == "SNAPSHOT", s"RPM has incorrect value ${rpmRelease.value}") assert(rpmMetadata.value.version == "1", s"RPM has incorrect value ${rpmMetadata.value.version}") assert((version in Rpm).value == "1", s"RPM has incorrect value ${(version in Rpm).value}") diff --git a/src/sbt-test/rpm/snapshot-override-rpm/test b/src/sbt-test/rpm/snapshot-override-rpm/test index dbd83ee21..35cf628d9 100644 --- a/src/sbt-test/rpm/snapshot-override-rpm/test +++ b/src/sbt-test/rpm/snapshot-override-rpm/test @@ -1,6 +1,6 @@ # Run the debian packaging. -> rpm:package-bin +> rpm:packageBin $ exists target/rpm/RPMS/noarch/rpm-test-1-SNAPSHOT.noarch.rpm #Check release and version configured correctly -> check-snapshot +> checkSnapshot From b0516b159c27a518434f26a7762fe51dff95ec0c Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Mon, 17 Jul 2017 19:45:15 +0200 Subject: [PATCH 26/47] Fix debian scripted tests --- src/sbt-test/debian/native-build-compress/build.sbt | 3 ++- src/sbt-test/debian/native-build-default/build.sbt | 3 ++- src/sbt-test/debian/override-loader-functions/build.sbt | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/sbt-test/debian/native-build-compress/build.sbt b/src/sbt-test/debian/native-build-compress/build.sbt index a28e64ccc..6653a9d01 100644 --- a/src/sbt-test/debian/native-build-compress/build.sbt +++ b/src/sbt-test/debian/native-build-compress/build.sbt @@ -10,5 +10,6 @@ packageSummary := "Summary" TaskKey[Unit]("checkDebCompression") := { val deb = target.value / s"${(name in Debian).value}_${(version in Debian).value}_all.deb" - assert(Seq("ar", "-t", deb.toString).lines.exists(_.startsWith("data.tar."))) // exact extension varies by dpkg-deb version + val output = sys.process.Process(Seq("ar", "-t", deb.toString)).lines + assert(output.exists(_.startsWith("data.tar."))) // exact extension varies by dpkg-deb version } diff --git a/src/sbt-test/debian/native-build-default/build.sbt b/src/sbt-test/debian/native-build-default/build.sbt index 2c6aa4566..c7eba3928 100644 --- a/src/sbt-test/debian/native-build-default/build.sbt +++ b/src/sbt-test/debian/native-build-default/build.sbt @@ -8,5 +8,6 @@ packageSummary := "Summary" TaskKey[Unit]("checkDebCompression") := { val deb = target.value / s"${(name in Debian).value}_${(version in Debian).value}_all.deb" - assert(Seq("ar", "-t", deb.toString).lines.contains("data.tar")) + val output = sys.process.Process(Seq("ar", "-t", deb.toString)).lines + assert(output.contains("data.tar")) } diff --git a/src/sbt-test/debian/override-loader-functions/build.sbt b/src/sbt-test/debian/override-loader-functions/build.sbt index 8db872a75..6f616c8e9 100644 --- a/src/sbt-test/debian/override-loader-functions/build.sbt +++ b/src/sbt-test/debian/override-loader-functions/build.sbt @@ -17,7 +17,9 @@ packageDescription := """A fun package description of our software, TaskKey[Unit]("checkLoaderFunctions") := { val extracted = target.value / "tmp" / "extracted-package" extracted.mkdirs() - Seq("dpkg-deb", "-e", (target.value / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath).! + sys.process + .Process(Seq("dpkg-deb", "-e", (target.value / "debian-test_0.1.0_all.deb").absolutePath, extracted.absolutePath)) + .! val script = IO.read(extracted / "postinst") From 61869e00e7ccfef49cb48dc5019f378c8fab6084 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Mon, 17 Jul 2017 19:48:11 +0200 Subject: [PATCH 27/47] Run only the script docker tests which don't require docker --- .travis.yml | 6 ++++-- build.sbt | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e2e72f804..47756fdf6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,8 +17,10 @@ env: - SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateRpm" - SBT_TEST_CMD="validateDebian" - SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateDebian" - - SBT_TEST_CMD="validateDocker" - - SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateDocker" + # for now we can't test the docker image generation on travis + - SBT_TEST_CMD="validateDockerUnit" + - SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateDockerUnit" + # jdk packaging is only available on jdk8+ - SBT_TEST_CMD="validateJdkPackager" - SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateJdkPackager" diff --git a/build.sbt b/build.sbt index 7d15c9094..ec4213f9a 100644 --- a/build.sbt +++ b/build.sbt @@ -142,6 +142,7 @@ addCommandAlias("validateAsh", "scripted ash/*") addCommandAlias("validateRpm", "scripted rpm/*") addCommandAlias("validateDebian", "scripted debian/*") addCommandAlias("validateDocker", "scripted docker/*") +addCommandAlias("validateDockerUnit", "scripted docker/staging docker/entrypoint docker/ports docker/volumes") addCommandAlias("validateJdkPackager", "scripted docker/*") // TODO check the cygwin scripted tests and run them on appveyor From bad8d19fda9ceb8c701609607c6f02c0d4150f70 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Mon, 17 Jul 2017 19:49:01 +0200 Subject: [PATCH 28/47] Fix validateJdkPackager and actually run the jdkpackacker scripts --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index ec4213f9a..3a72624f4 100644 --- a/build.sbt +++ b/build.sbt @@ -143,7 +143,7 @@ addCommandAlias("validateRpm", "scripted rpm/*") addCommandAlias("validateDebian", "scripted debian/*") addCommandAlias("validateDocker", "scripted docker/*") addCommandAlias("validateDockerUnit", "scripted docker/staging docker/entrypoint docker/ports docker/volumes") -addCommandAlias("validateJdkPackager", "scripted docker/*") +addCommandAlias("validateJdkPackager", "scripted jdkpackager/*") // TODO check the cygwin scripted tests and run them on appveyor addCommandAlias("validateWindows", "; test-only * -- -n windows;scripted universal/dist universal/stage windows/*") From 1b2b69223793ba26a4ef398fbf0c3e0323901d0c Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Mon, 17 Jul 2017 19:54:57 +0200 Subject: [PATCH 29/47] Explicitly include all the different envs in travis --- .travis.yml | 64 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 24 deletions(-) diff --git a/.travis.yml b/.travis.yml index 47756fdf6..317a6a27b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,38 +1,54 @@ language: java os: linux -jdk: oraclejdk8 - -env: - - SBT_TEST_CMD="validate" - - SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validate" - - SBT_TEST_CMD="validateUniversal" - - SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateUniversal" - - SBT_TEST_CMD="validateJar" - - SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateJar" - - SBT_TEST_CMD="validateBash" - - SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateBash" - - SBT_TEST_CMD="validateAsh" - - SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateAsh" - - SBT_TEST_CMD="validateRpm" - - SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateRpm" - - SBT_TEST_CMD="validateDebian" - - SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateDebian" - # for now we can't test the docker image generation on travis - - SBT_TEST_CMD="validateDockerUnit" - - SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateDockerUnit" - # jdk packaging is only available on jdk8+ - - SBT_TEST_CMD="validateJdkPackager" - - SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateJdkPackager" before_install: - if [[ "$TRAVIS_OS_NAME" = "osx" ]]; then brew update; brew install xz; fi -script: ./sbt "$SBT_TEST_CMD" ; +script: ./sbt "$SBT_TEST_CMD"; +# We explicitly set the matrix to include oraclejdk8 because MacOS X has issues. See comment below matrix: include: + - jdk: oraclejdk8 + env: SBT_TEST_CMD="validate" + - jdk: oraclejdk8 + env: SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validate" + - jdk: oraclejdk8 + env: SBT_TEST_CMD="validateUniversal" + - jdk: oraclejdk8 + env: SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateUniversal" + - jdk: oraclejdk8 + env: SBT_TEST_CMD="validateJar" + - jdk: oraclejdk8 + env: SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateJar" + - jdk: oraclejdk8 + env: SBT_TEST_CMD="validateBash" + - jdk: oraclejdk8 + env: SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateBash" + - jdk: oraclejdk8 + env: SBT_TEST_CMD="validateAsh" + - jdk: oraclejdk8 + env: SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateAsh" + - jdk: oraclejdk8 + env: SBT_TEST_CMD="validateRpm" + - jdk: oraclejdk8 + env: SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateRpm" + - jdk: oraclejdk8 + env: SBT_TEST_CMD="validateDebian" + - jdk: oraclejdk8 + env: SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateDebian" + # for now we can't test the docker image generation on travis + - jdk: oraclejdk8 + env: SBT_TEST_CMD="validateDockerUnit" + - jdk: oraclejdk8 + env: SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateDockerUnit" + # jdk packaging is only available on jdk8+ + - jdk: oraclejdk8 + env: SBT_TEST_CMD="validateJdkPackager" + - jdk: oraclejdk8 + env: SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateJdkPackager" # oraclejdk8 is not yet available. # see https://github.com/travis-ci/travis-ci/issues/2316 - os: osx From 0876ed571503e1b0292874f41019a7668d6210a8 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Tue, 18 Jul 2017 22:52:03 +0200 Subject: [PATCH 30/47] Remove jdkpackager/test-package-image scripted test on travis --- .travis.yml | 4 ++-- build.sbt | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 317a6a27b..ad3ff52dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,9 +46,9 @@ matrix: env: SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateDockerUnit" # jdk packaging is only available on jdk8+ - jdk: oraclejdk8 - env: SBT_TEST_CMD="validateJdkPackager" + env: SBT_TEST_CMD="validateJdkPackagerTravis" - jdk: oraclejdk8 - env: SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateJdkPackager" + env: SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateJdkPackagerTravis" # oraclejdk8 is not yet available. # see https://github.com/travis-ci/travis-ci/issues/2316 - os: osx diff --git a/build.sbt b/build.sbt index 3a72624f4..5cc9e6400 100644 --- a/build.sbt +++ b/build.sbt @@ -144,6 +144,12 @@ addCommandAlias("validateDebian", "scripted debian/*") addCommandAlias("validateDocker", "scripted docker/*") addCommandAlias("validateDockerUnit", "scripted docker/staging docker/entrypoint docker/ports docker/volumes") addCommandAlias("validateJdkPackager", "scripted jdkpackager/*") +// travis ci's jdk8 version doesn't support nested association elements. +// error: Caused by: class com.sun.javafx.tools.ant.Info doesn't support the nested "association" element. +addCommandAlias( + "validateJdkPackagerTravis", + "scripted jdkpackager/test-package-minimal jdkPackager/test-package-mappings" +) // TODO check the cygwin scripted tests and run them on appveyor addCommandAlias("validateWindows", "; test-only * -- -n windows;scripted universal/dist universal/stage windows/*") From 79a53b83ce20ff73a7c2cd8089fd00018f737587 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Tue, 18 Jul 2017 22:54:00 +0200 Subject: [PATCH 31/47] Upgrade to sbt-1.0.0-RC2 and use crossbuil --- .travis.yml | 36 +++++++++--------------------------- build.sbt | 2 +- 2 files changed, 10 insertions(+), 28 deletions(-) diff --git a/.travis.yml b/.travis.yml index ad3ff52dd..9e5f61cfc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,43 +12,25 @@ script: ./sbt "$SBT_TEST_CMD"; matrix: include: - jdk: oraclejdk8 - env: SBT_TEST_CMD="validate" + env: SBT_TEST_CMD="^validate" - jdk: oraclejdk8 - env: SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validate" + env: SBT_TEST_CMD="^validateUniversal" - jdk: oraclejdk8 - env: SBT_TEST_CMD="validateUniversal" + env: SBT_TEST_CMD="^validateJar" - jdk: oraclejdk8 - env: SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateUniversal" + env: SBT_TEST_CMD="^validateBash" - jdk: oraclejdk8 - env: SBT_TEST_CMD="validateJar" + env: SBT_TEST_CMD="^validateAsh" - jdk: oraclejdk8 - env: SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateJar" + env: SBT_TEST_CMD="^validateRpm" - jdk: oraclejdk8 - env: SBT_TEST_CMD="validateBash" - - jdk: oraclejdk8 - env: SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateBash" - - jdk: oraclejdk8 - env: SBT_TEST_CMD="validateAsh" - - jdk: oraclejdk8 - env: SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateAsh" - - jdk: oraclejdk8 - env: SBT_TEST_CMD="validateRpm" - - jdk: oraclejdk8 - env: SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateRpm" - - jdk: oraclejdk8 - env: SBT_TEST_CMD="validateDebian" - - jdk: oraclejdk8 - env: SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateDebian" + env: SBT_TEST_CMD="^validateDebian" # for now we can't test the docker image generation on travis - jdk: oraclejdk8 - env: SBT_TEST_CMD="validateDockerUnit" - - jdk: oraclejdk8 - env: SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateDockerUnit" + env: SBT_TEST_CMD="^validateDockerUnit" # jdk packaging is only available on jdk8+ - jdk: oraclejdk8 - env: SBT_TEST_CMD="validateJdkPackagerTravis" - - jdk: oraclejdk8 - env: SBT_TEST_CMD="++2.12.2 ^^1.0.0-M6 validateJdkPackagerTravis" + env: SBT_TEST_CMD="^validateJdkPackagerTravis" # oraclejdk8 is not yet available. # see https://github.com/travis-ci/travis-ci/issues/2316 - os: osx diff --git a/build.sbt b/build.sbt index 5cc9e6400..5afc17474 100644 --- a/build.sbt +++ b/build.sbt @@ -6,7 +6,7 @@ organization := "com.typesafe.sbt" scalaVersion in Global := "2.10.6" // crossBuildingSettings -crossSbtVersions := Vector("0.13.15", "1.0.0-M6") +crossSbtVersions := Vector("0.13.15", "1.0.0-RC2") scalacOptions in Compile ++= Seq("-deprecation") javacOptions ++= Seq("-source", "1.8", "-target", "1.8") From 46c6f2d971be1ed25d6d09730ea7470a44cb8c4a Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Wed, 19 Jul 2017 19:22:02 +0200 Subject: [PATCH 32/47] Go back to M6 and switch-case the provided dependencies --- build.sbt | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/build.sbt b/build.sbt index 5afc17474..b8c04ccdc 100644 --- a/build.sbt +++ b/build.sbt @@ -6,7 +6,7 @@ organization := "com.typesafe.sbt" scalaVersion in Global := "2.10.6" // crossBuildingSettings -crossSbtVersions := Vector("0.13.15", "1.0.0-RC2") +crossSbtVersions := Vector("0.13.15", "1.0.0-M6") scalacOptions in Compile ++= Seq("-deprecation") javacOptions ++= Seq("-source", "1.8", "-target", "1.8") @@ -17,19 +17,26 @@ libraryDependencies ++= Seq( "org.apache.commons" % "commons-compress" % "1.4.1", // for jdkpackager "org.apache.ant" % "ant" % "1.9.6", - // these dependencies have to be explicitly added by the user - // FIXME temporary remove the 'provided' scope. SBT 1.0.0-M6 changed the resolving somehow - "com.spotify" % "docker-client" % "3.5.13" /* % "provided" */, - // FIXME temporary remove the 'provided' scope. SBT 1.0.0-M6 changed the resolving somehow - "org.vafer" % "jdeb" % "1.3" /*% "provided"*/ artifacts Artifact("jdeb", "jar", "jar"), "org.scalatest" %% "scalatest" % "3.0.3" % "test" ) // sbt dependend libraries libraryDependencies ++= { sbtVersion.value match { - case v if v.startsWith("1.") => Seq("org.scala-sbt" %% "io" % "1.0.0-M11") - case _ => Nil + case v if v.startsWith("1.") => + Seq( + "org.scala-sbt" %% "io" % "1.0.0-M13", + // these dependencies have to be explicitly added by the user + // FIXME temporary remove the 'provided' scope. SBT 1.0.0-M6 changed the resolving somehow + "com.spotify" % "docker-client" % "3.5.13" /* % "provided" */, + "org.vafer" % "jdeb" % "1.3" /*% "provided"*/ artifacts Artifact("jdeb", "jar", "jar") + ) + case _ => + Seq( + // these dependencies have to be explicitly added by the user + "com.spotify" % "docker-client" % "3.5.13" % "provided", + "org.vafer" % "jdeb" % "1.3" % "provided" artifacts Artifact("jdeb", "jar", "jar") + ) } } From 37657f6a3a6ce38c57106987ebd0a4c076d33bb4 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Wed, 19 Jul 2017 19:22:12 +0200 Subject: [PATCH 33/47] Run actual tests on MacOS X --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9e5f61cfc..90017136e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,7 @@ matrix: # oraclejdk8 is not yet available. # see https://github.com/travis-ci/travis-ci/issues/2316 - os: osx - env: SBT_VERSION_CMD="++2.12.2 ^^1.0.0-M6" + env: SBT_VERSION_CMD="^validate ^validateUniversal" osx_image: xcode8 addons: From 4c7e4bf5b35a4cf106ef85b832a3aebe87eda1aa Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Sat, 22 Jul 2017 12:20:36 +0200 Subject: [PATCH 34/47] use sbtVersion in pluginCrossBuild and downgrade to sbt-io M11 --- build.sbt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index b8c04ccdc..d3ffd95fe 100644 --- a/build.sbt +++ b/build.sbt @@ -22,10 +22,10 @@ libraryDependencies ++= Seq( // sbt dependend libraries libraryDependencies ++= { - sbtVersion.value match { + (sbtVersion in pluginCrossBuild).value match { case v if v.startsWith("1.") => Seq( - "org.scala-sbt" %% "io" % "1.0.0-M13", + "org.scala-sbt" %% "io" % "1.0.0-M11", // these dependencies have to be explicitly added by the user // FIXME temporary remove the 'provided' scope. SBT 1.0.0-M6 changed the resolving somehow "com.spotify" % "docker-client" % "3.5.13" /* % "provided" */, From 0d1934a87e910f44ce7158e6778603ce1866066e Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Sat, 22 Jul 2017 15:52:55 +0200 Subject: [PATCH 35/47] Fix scripted camelCase jdkpackager --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index d3ffd95fe..345312639 100644 --- a/build.sbt +++ b/build.sbt @@ -155,7 +155,7 @@ addCommandAlias("validateJdkPackager", "scripted jdkpackager/*") // error: Caused by: class com.sun.javafx.tools.ant.Info doesn't support the nested "association" element. addCommandAlias( "validateJdkPackagerTravis", - "scripted jdkpackager/test-package-minimal jdkPackager/test-package-mappings" + "scripted jdkpackager/test-package-minimal jdkpackager/test-package-mappings" ) // TODO check the cygwin scripted tests and run them on appveyor From 441fb673efeee4c561484108d5479f7df82f4ac6 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Mon, 24 Jul 2017 21:37:32 +0200 Subject: [PATCH 36/47] Try to upgrade to 1.0.0-RC2 --- build.sbt | 47 +----------- project/build.properties | 2 +- .../sbt/packager/SettingsHelper.scala | 62 ---------------- .../com/typesafe/sbt/packager/Compat.scala | 7 +- .../sbt/packager/MappingsHelper.scala | 0 .../sbt/packager/SettingsHelper.scala | 74 +++++++++++++++++++ 6 files changed, 79 insertions(+), 113 deletions(-) delete mode 100644 src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/SettingsHelper.scala rename src/main/{scala-sbt-1.0.0-M6 => scala-sbt-1.0}/com/typesafe/sbt/packager/Compat.scala (82%) rename src/main/{scala-sbt-1.0.0-M6 => scala-sbt-1.0}/com/typesafe/sbt/packager/MappingsHelper.scala (100%) create mode 100644 src/main/scala-sbt-1.0/com/typesafe/sbt/packager/SettingsHelper.scala diff --git a/build.sbt b/build.sbt index 345312639..713861dda 100644 --- a/build.sbt +++ b/build.sbt @@ -6,7 +6,7 @@ organization := "com.typesafe.sbt" scalaVersion in Global := "2.10.6" // crossBuildingSettings -crossSbtVersions := Vector("0.13.15", "1.0.0-M6") +crossSbtVersions := Vector("0.13.15", "1.0.0-RC2") scalacOptions in Compile ++= Seq("-deprecation") javacOptions ++= Seq("-source", "1.8", "-target", "1.8") @@ -63,51 +63,6 @@ git.remoteRepo := "git@github.com:sbt/sbt-native-packager.git" scriptedSettings scriptedLaunchOpts += "-Dproject.version=" + version.value -// Temporary fix for issue sbt/sbt/issues/3245 -scripted := { - val args = ScriptedPlugin - .asInstanceOf[{ - def scriptedParser(f: File): complete.Parser[Seq[String]] - } - ] - .scriptedParser(sbtTestDirectory.value) - .parsed - val prereq: Unit = scriptedDependencies.value - try { - if ((sbtVersion in pluginCrossBuild).value == "1.0.0-M6") { - ScriptedPlugin.scriptedTests.value - .asInstanceOf[{ - def run(x1: File, x2: Boolean, x3: Array[String], x4: File, x5: Array[String], x6: java.util.List[File]) - : Unit - } - ] - .run( - sbtTestDirectory.value, - scriptedBufferLog.value, - args.toArray, - sbtLauncher.value, - scriptedLaunchOpts.value.toArray, - new java.util.ArrayList() - ) - } else { - ScriptedPlugin.scriptedTests.value - .asInstanceOf[{ - def run(x1: File, x2: Boolean, x3: Array[String], x4: File, x5: Array[String]): Unit - } - ] - .run( - sbtTestDirectory.value, - scriptedBufferLog.value, - args.toArray, - sbtLauncher.value, - scriptedLaunchOpts.value.toArray - ) - } - } catch { - case e: java.lang.reflect.InvocationTargetException => throw e.getCause - } -} - // Release configurationr releasePublishArtifactsAction := PgpKeys.publishSigned.value publishMavenStyle := false diff --git a/project/build.properties b/project/build.properties index d9654cdc2..ead2472b0 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.16-M1 +sbt.version=0.13.16-RC1 diff --git a/src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/SettingsHelper.scala b/src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/SettingsHelper.scala deleted file mode 100644 index 469b045e2..000000000 --- a/src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/SettingsHelper.scala +++ /dev/null @@ -1,62 +0,0 @@ -package com.typesafe.sbt.packager - -import sbt.Keys._ -import sbt._ -import com.typesafe.sbt.packager.Compat._ - -object SettingsHelper { - - def addPackage(config: Configuration, - packageTask: TaskKey[File], - extension: String, - classifier: Option[String] = None): Seq[Setting[_]] = - inConfig(config)( - addArtifact( - name apply (Artifact( - _, - extension, - extension, - classifier = classifier, - configurations = Vector.empty, - url = None - )), - packageTask - ) - ) - - def makeDeploymentSettings(config: Configuration, - packageTask: TaskKey[File], - extension: String, - classifier: Option[String] = None): Seq[Setting[_]] = - inConfig(config)(Classpaths.ivyPublishSettings ++ Classpaths.jvmPublishSettings) ++ inConfig(config)( - Seq( - artifacts := Seq.empty, - packagedArtifacts := Map.empty, - projectID := ModuleID(organization.value, name.value, version.value), - // TODO find out why we have this InlineConfiguration here - moduleSettings := InlineConfiguration(true, ivyScala.value, projectID.value, projectInfo.value, Vector.empty), - ivyModule := { - val ivy = ivySbt.value - new ivy.Module(moduleSettings.value) - }, - deliverLocalConfiguration := Classpaths.deliverConfig(crossTarget.value, logging = ivyLoggingLevel.value), - deliverConfiguration := deliverLocalConfiguration.value, - publishConfiguration := new PublishConfiguration( - ivyFile = None, - resolverName = Classpaths.getPublishTo(publishTo.value).name, - artifacts = packagedArtifacts.value, - checksums = checksums.value.toVector, - logging = UpdateLogging.DownloadOnly, - overwrite = isSnapshot.value - ), - publishLocalConfiguration := new PublishConfiguration( - ivyFile = None, - resolverName = "local", - artifacts = packagedArtifacts.value, - checksums = checksums.value.toVector, - logging = UpdateLogging.DownloadOnly, - overwrite = isSnapshot.value - ) - ) - ) ++ addPackage(config, packageTask, extension, classifier) -} diff --git a/src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/Compat.scala b/src/main/scala-sbt-1.0/com/typesafe/sbt/packager/Compat.scala similarity index 82% rename from src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/Compat.scala rename to src/main/scala-sbt-1.0/com/typesafe/sbt/packager/Compat.scala index 63e7e31e4..1cdc5ca1d 100644 --- a/src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/Compat.scala +++ b/src/main/scala-sbt-1.0/com/typesafe/sbt/packager/Compat.scala @@ -6,12 +6,11 @@ import sbt.util.CacheStore object Compat { val IvyActions = ilm.IvyActions - type PublishConfiguration = ilm.PublishConfiguration type IvySbt = ilm.IvySbt - type IvyScala = lm.IvyScala + type IvyScala = sbt.librarymanagement.ScalaModuleInfo + val IvyScala = sbt.librarymanagement.ScalaModuleInfo + type UpdateConfiguration = lm.UpdateConfiguration - type InlineConfiguration = ilm.InlineConfiguration - val InlineConfiguration = ilm.InlineConfiguration /** * Used in diff --git a/src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/MappingsHelper.scala b/src/main/scala-sbt-1.0/com/typesafe/sbt/packager/MappingsHelper.scala similarity index 100% rename from src/main/scala-sbt-1.0.0-M6/com/typesafe/sbt/packager/MappingsHelper.scala rename to src/main/scala-sbt-1.0/com/typesafe/sbt/packager/MappingsHelper.scala diff --git a/src/main/scala-sbt-1.0/com/typesafe/sbt/packager/SettingsHelper.scala b/src/main/scala-sbt-1.0/com/typesafe/sbt/packager/SettingsHelper.scala new file mode 100644 index 000000000..490fb10dd --- /dev/null +++ b/src/main/scala-sbt-1.0/com/typesafe/sbt/packager/SettingsHelper.scala @@ -0,0 +1,74 @@ +package com.typesafe.sbt.packager + +import sbt._ +import sbt.Keys._ +import sbt.librarymanagement.{IvyFileConfiguration, PublishConfiguration} +import com.typesafe.sbt.packager.Compat._ + +/** + * TODO write tests for the SettingsHelper + * TODO document methods properly + * TODO document the sbt internal stuff that is used + */ +object SettingsHelper { + + def addPackage(config: Configuration, + packageTask: TaskKey[File], + extension: String, + classifier: Option[String] = None): Seq[Setting[_]] = inConfig(config)( + addArtifact( + name apply (Artifact( + _, + extension, + extension, + classifier = classifier, + configurations = Vector.empty, + url = None + )), + packageTask + ) + ) + + def makeDeploymentSettings(config: Configuration, + packageTask: TaskKey[File], + extension: String, + classifier: Option[String] = None): Seq[Setting[_]] = + // Why do we need the ivyPublishSettings and jvmPublishSettings ? + inConfig(config)(Classpaths.ivyPublishSettings ++ Classpaths.jvmPublishSettings) ++ inConfig(config)( + Seq( + artifacts := Seq.empty, + packagedArtifacts := Map.empty, + projectID := ModuleID(organization.value, name.value, version.value), + // Why do we need a custom ModuleConfiguration for a package type? + moduleSettings := IvyFileConfiguration( + validate = true, + scalaModuleInfo = scalaModuleInfo.value, + file = packageTask.value, + autoScalaTools = false + ), + // Why do we have change the ivyModule? + ivyModule := { + val ivy = ivySbt.value + new ivy.Module(moduleSettings.value) + }, + // Where have these settings gone? + // ------------------------------- + // deliverLocalConfiguration := Classpaths.deliverConfig(crossTarget.value, logging = ivyLoggingLevel.value) + // deliverConfiguration := deliverLocalConfiguration.value, + // ------------------------------- + publishConfiguration := PublishConfiguration() + .withResolverName(Classpaths.getPublishTo(publishTo.value).name) + .withArtifacts(packagedArtifacts.value.toVector) + .withChecksums(checksums.value.toVector) + .withOverwrite(isSnapshot.value) + .withLogging(UpdateLogging.DownloadOnly), + publishLocalConfiguration := PublishConfiguration() + .withResolverName("local") + .withArtifacts(packagedArtifacts.value.toVector) + .withChecksums(checksums.value.toVector) + .withOverwrite(isSnapshot.value) + .withLogging(UpdateLogging.DownloadOnly) + ) + ) ++ addPackage(config, packageTask, extension, classifier) + +} From 65622f39a0a507861a7c76d717868e1e1e0553c3 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Thu, 27 Jul 2017 20:04:31 +0200 Subject: [PATCH 37/47] Build with 0.13.16 --- build.sbt | 2 +- project/build.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 713861dda..c8557add7 100644 --- a/build.sbt +++ b/build.sbt @@ -6,7 +6,7 @@ organization := "com.typesafe.sbt" scalaVersion in Global := "2.10.6" // crossBuildingSettings -crossSbtVersions := Vector("0.13.15", "1.0.0-RC2") +crossSbtVersions := Vector("0.13.16", "1.0.0-RC2") scalacOptions in Compile ++= Seq("-deprecation") javacOptions ++= Seq("-source", "1.8", "-target", "1.8") diff --git a/project/build.properties b/project/build.properties index ead2472b0..c091b86ca 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.16-RC1 +sbt.version=0.13.16 From 558ea28a708a5477ee9389e1cd976a00c2091eeb Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Fri, 28 Jul 2017 13:18:44 +0200 Subject: [PATCH 38/47] Upgrade sbt-io --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index c8557add7..a7d472eab 100644 --- a/build.sbt +++ b/build.sbt @@ -25,7 +25,7 @@ libraryDependencies ++= { (sbtVersion in pluginCrossBuild).value match { case v if v.startsWith("1.") => Seq( - "org.scala-sbt" %% "io" % "1.0.0-M11", + "org.scala-sbt" %% "io" % "1.0.0-M13", // these dependencies have to be explicitly added by the user // FIXME temporary remove the 'provided' scope. SBT 1.0.0-M6 changed the resolving somehow "com.spotify" % "docker-client" % "3.5.13" /* % "provided" */, From a7cc3e88bc49a2b8beeb04ccd6053bbe30d8a410 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Sat, 29 Jul 2017 13:42:58 +0200 Subject: [PATCH 39/47] Fix linting error for ivy configs --- .../universal/multiproject-classifiers/build.sbt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/sbt-test/universal/multiproject-classifiers/build.sbt b/src/sbt-test/universal/multiproject-classifiers/build.sbt index df7172d2b..b75d1f2f8 100644 --- a/src/sbt-test/universal/multiproject-classifiers/build.sbt +++ b/src/sbt-test/universal/multiproject-classifiers/build.sbt @@ -11,27 +11,27 @@ lazy val mySettings: Seq[Setting[_]] = } }) -lazy val assets = config("assets") +lazy val Assets = config("Assets") lazy val sub = project .in(file("sub")) .enablePlugins(JavaAppPackaging) .settings(mySettings) .settings( - ivyConfigurations += assets, - artifact in assets := artifact.value.withClassifier(classifier = Some("assets")), + ivyConfigurations += Assets, + artifact in Assets := artifact.value.withClassifier(classifier = Some("assets")), packagedArtifacts += { val file = target.value / "assets.jar" val assetsDir = baseDirectory.value / "src" / "main" / "assets" val sources = assetsDir.**(AllPassFilter).filter(_.isFile) pair (file => IO.relativize(assetsDir, file)) IO.zip(sources, file) - (artifact in assets).value -> file + (artifact in Assets).value -> file }, - exportedProducts in assets := { + exportedProducts in Assets := { Seq( Attributed .blank(baseDirectory.value / "src" / "main" / "assets") - .put(artifact.key, (artifact in assets).value) + .put(artifact.key, (artifact in Assets).value) .put(AttributeKey[ModuleID]("module-id"), projectID.value) ) } From 0dc9c581c56a6732f467fe399907408555fa043f Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Sat, 29 Jul 2017 13:43:20 +0200 Subject: [PATCH 40/47] Upgrade to 1.0.0-RC3 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index a7d472eab..6e5555918 100644 --- a/build.sbt +++ b/build.sbt @@ -6,7 +6,7 @@ organization := "com.typesafe.sbt" scalaVersion in Global := "2.10.6" // crossBuildingSettings -crossSbtVersions := Vector("0.13.16", "1.0.0-RC2") +crossSbtVersions := Vector("0.13.16", "1.0.0-RC3") scalacOptions in Compile ++= Seq("-deprecation") javacOptions ++= Seq("-source", "1.8", "-target", "1.8") From 8dc7fbf474743f2371c79b09779583c7fc9522b1 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Sat, 5 Aug 2017 18:25:31 +0200 Subject: [PATCH 41/47] Fix jar names in JavaAppPackaging. See sbt/sbt/issues/3388 --- .../sbt/packager/archetypes/JavaAppPackaging.scala | 6 +++++- src/sbt-test/jar/classpath-jar/build.sbt | 2 +- src/sbt-test/jar/launcher-jar with spaces/build.sbt | 2 +- src/sbt-test/jar/launcher-jar/build.sbt | 8 ++++---- src/sbt-test/universal/multiproject-classifiers/build.sbt | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaAppPackaging.scala b/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaAppPackaging.scala index 1cc134e35..9e808a888 100644 --- a/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaAppPackaging.scala +++ b/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaAppPackaging.scala @@ -103,7 +103,11 @@ object JavaAppPackaging extends AutoPlugin { // ivy metadata if available. private def getJarFullFilename(dep: Attributed[File]): String = { val filename: Option[String] = for { - module <- dep.metadata.get(AttributeKey[ModuleID]("module-id")) + module <- dep.metadata + // sbt 0.13.x key + .get(AttributeKey[ModuleID]("module-id")) + // sbt 1.x key + .orElse(dep.metadata.get(AttributeKey[ModuleID]("moduleID"))) artifact <- dep.metadata.get(AttributeKey[Artifact]("artifact")) } yield makeJarName(module.organization, module.name, module.revision, artifact.name, artifact.classifier) filename.getOrElse(dep.data.getName) diff --git a/src/sbt-test/jar/classpath-jar/build.sbt b/src/sbt-test/jar/classpath-jar/build.sbt index 101cdf4da..798d57d0d 100644 --- a/src/sbt-test/jar/classpath-jar/build.sbt +++ b/src/sbt-test/jar/classpath-jar/build.sbt @@ -14,7 +14,7 @@ TaskKey[Unit]("checkClasspath") := { val bat = IO.read(dir / "bin" / "classpath-jar-test.bat") assert(bat contains "set \"APP_CLASSPATH=%APP_LIB_DIR%\\classpath-jar-test.classpath-jar-test-0.1.0-classpath.jar\"") val jar = new java.util.jar.JarFile(dir / "lib" / "classpath-jar-test.classpath-jar-test-0.1.0-classpath.jar") - assert(jar.getManifest().getMainAttributes().getValue("Class-Path").toString() contains "com.typesafe.config") + assert(jar.getManifest().getMainAttributes().getValue("Class-Path") contains "com.typesafe.config") jar close } diff --git a/src/sbt-test/jar/launcher-jar with spaces/build.sbt b/src/sbt-test/jar/launcher-jar with spaces/build.sbt index 8fe21feed..58578eb9f 100644 --- a/src/sbt-test/jar/launcher-jar with spaces/build.sbt +++ b/src/sbt-test/jar/launcher-jar with spaces/build.sbt @@ -25,7 +25,7 @@ TaskKey[Unit]("checkClasspath") := { val attributes = jar.getManifest().getMainAttributes() assert( attributes.getValue("Class-Path").toString() contains "com.typesafe.config", - "MANIFEST Class-Path should contain akka-actor:\n" + attributes.getValue("Class-Path").toString() + "MANIFEST Class-Path should contain com.typesafe.config:\n" + attributes.getValue("Class-Path").toString() ) assert( attributes.getValue("Main-Class").toString() contains "test.Test", diff --git a/src/sbt-test/jar/launcher-jar/build.sbt b/src/sbt-test/jar/launcher-jar/build.sbt index d6268a5a8..2a8c6c3ff 100644 --- a/src/sbt-test/jar/launcher-jar/build.sbt +++ b/src/sbt-test/jar/launcher-jar/build.sbt @@ -26,12 +26,12 @@ TaskKey[Unit]("checkClasspath") := { val jar = new java.util.jar.JarFile(dir / "lib" / "launcher-jar-test.launcher-jar-test-0.1.0-launcher.jar") val attributes = jar.getManifest().getMainAttributes() assert( - attributes.getValue("Class-Path").toString() contains "com.typesafe.config", - "MANIFEST Class-Path should contain akka-actor:\n" + attributes.getValue("Class-Path").toString() + attributes.getValue("Class-Path") contains "com.typesafe.config", + "MANIFEST Class-Path should contain 'com.typesafe.config':\n" + attributes.getValue("Class-Path") ) assert( - attributes.getValue("Main-Class").toString() contains "test.Test", - "MANIFEST Main-Class should contain test.Test:\n" + attributes.getValue("Main-Class").toString() + attributes.getValue("Main-Class") contains "test.Test", + "MANIFEST Main-Class should contain test.Test:\n" + attributes.getValue("Main-Class") ) jar close } diff --git a/src/sbt-test/universal/multiproject-classifiers/build.sbt b/src/sbt-test/universal/multiproject-classifiers/build.sbt index b75d1f2f8..70d5bb7e3 100644 --- a/src/sbt-test/universal/multiproject-classifiers/build.sbt +++ b/src/sbt-test/universal/multiproject-classifiers/build.sbt @@ -11,7 +11,7 @@ lazy val mySettings: Seq[Setting[_]] = } }) -lazy val Assets = config("Assets") +lazy val Assets = config("assets") lazy val sub = project .in(file("sub")) From 38b27b8877e8a13352a15f88da83dc1fc1a13f83 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Sun, 6 Aug 2017 11:34:12 +0200 Subject: [PATCH 42/47] Formatting SettingsHelper From 88233b3b8ec3aef45ed3d93b6e0b6118e6748b05 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Sun, 6 Aug 2017 12:13:40 +0200 Subject: [PATCH 43/47] Adding the correct moduleSettings See sbt/librarymanagement/issues/154 --- .../com/typesafe/sbt/packager/SettingsHelper.scala | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/scala-sbt-1.0/com/typesafe/sbt/packager/SettingsHelper.scala b/src/main/scala-sbt-1.0/com/typesafe/sbt/packager/SettingsHelper.scala index 490fb10dd..e8f648851 100644 --- a/src/main/scala-sbt-1.0/com/typesafe/sbt/packager/SettingsHelper.scala +++ b/src/main/scala-sbt-1.0/com/typesafe/sbt/packager/SettingsHelper.scala @@ -39,14 +39,9 @@ object SettingsHelper { artifacts := Seq.empty, packagedArtifacts := Map.empty, projectID := ModuleID(organization.value, name.value, version.value), - // Why do we need a custom ModuleConfiguration for a package type? - moduleSettings := IvyFileConfiguration( - validate = true, - scalaModuleInfo = scalaModuleInfo.value, - file = packageTask.value, - autoScalaTools = false - ), - // Why do we have change the ivyModule? + // Custom module settings to skip the ivy XmlModuleDescriptorParser + moduleSettings := ModuleDescriptorConfiguration(projectID.value, projectInfo.value) + .withScalaModuleInfo(scalaModuleInfo.value), ivyModule := { val ivy = ivySbt.value new ivy.Module(moduleSettings.value) From 748d3af7e552c1983b92c6321a250647365275c3 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Mon, 7 Aug 2017 20:43:38 +0200 Subject: [PATCH 44/47] Upgrade scalafmt --- build.sbt | 24 +++-- project/plugins.sbt | 2 +- .../sbt/packager/MappingsHelper.scala | 10 +- .../sbt/packager/SettingsHelper.scala | 84 ++++++++--------- .../sbt/packager/SettingsHelper.scala | 78 +++++++-------- .../archetypes/JavaAppPackaging.scala | 32 +++---- .../archetypes/JavaServerApplication.scala | 14 +-- .../archetypes/scripts/AshScriptPlugin.scala | 8 +- .../scripts/BashStartScriptPlugin.scala | 46 ++++----- .../debian/DebianNativePackaging.scala | 6 +- .../sbt/packager/debian/DebianPlugin.scala | 34 +++---- .../sbt/packager/debian/JDebPackaging.scala | 8 +- .../sbt/packager/docker/DockerPlugin.scala | 38 ++++---- .../sbt/packager/jar/ClasspathJarPlugin.scala | 18 ++-- .../sbt/packager/jar/LauncherJarPlugin.scala | 22 ++--- .../jdkpackager/JDKPackagerPlugin.scala | 94 +++++++++---------- .../sbt/packager/linux/LinuxMappingDSL.scala | 2 +- .../packager/linux/LinuxPackageMapping.scala | 2 +- .../typesafe/sbt/packager/rpm/RpmHelper.scala | 2 +- .../sbt/packager/rpm/RpmMetadata.scala | 16 ++-- .../sbt/packager/universal/Archives.scala | 4 +- .../sbt/packager/windows/WindowsPlugin.scala | 6 +- .../sbt/packager/windows/WixHelper.scala | 2 +- .../src/main/scala/test/Test.scala | 6 +- src/sbt-test/rpm/scriptlets-rpm/build.sbt | 4 +- src/sbt-test/rpm/setarch-rpm/build.sbt | 4 +- .../multiproject-classifiers/build.sbt | 8 +- version.sbt | 2 +- 28 files changed, 290 insertions(+), 286 deletions(-) diff --git a/build.sbt b/build.sbt index 6e5555918..68c94b580 100644 --- a/build.sbt +++ b/build.sbt @@ -25,17 +25,17 @@ libraryDependencies ++= { (sbtVersion in pluginCrossBuild).value match { case v if v.startsWith("1.") => Seq( - "org.scala-sbt" %% "io" % "1.0.0-M13", - // these dependencies have to be explicitly added by the user - // FIXME temporary remove the 'provided' scope. SBT 1.0.0-M6 changed the resolving somehow - "com.spotify" % "docker-client" % "3.5.13" /* % "provided" */, - "org.vafer" % "jdeb" % "1.3" /*% "provided"*/ artifacts Artifact("jdeb", "jar", "jar") + "org.scala-sbt" %% "io" % "1.0.0-M13", + // these dependencies have to be explicitly added by the user + // FIXME temporary remove the 'provided' scope. SBT 1.0.0-M6 changed the resolving somehow + "com.spotify" % "docker-client" % "3.5.13" /* % "provided" */, + "org.vafer" % "jdeb" % "1.3" /*% "provided"*/ artifacts Artifact("jdeb", "jar", "jar") ) case _ => Seq( - // these dependencies have to be explicitly added by the user - "com.spotify" % "docker-client" % "3.5.13" % "provided", - "org.vafer" % "jdeb" % "1.3" % "provided" artifacts Artifact("jdeb", "jar", "jar") + // these dependencies have to be explicitly added by the user + "com.spotify" % "docker-client" % "3.5.13" % "provided", + "org.vafer" % "jdeb" % "1.3" % "provided" artifacts Artifact("jdeb", "jar", "jar") ) } } @@ -46,8 +46,8 @@ libraryDependencies ++= { case "2.10" => Nil case _ => Seq( - "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.6", - "org.scala-lang.modules" %% "scala-xml" % "1.0.6" + "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.6", + "org.scala-lang.modules" %% "scala-xml" % "1.0.6" ) } @@ -87,10 +87,8 @@ releaseProcess := Seq[ReleaseStep]( bintrayOrganization := Some("sbt") bintrayRepository := "sbt-plugin-releases" -// scalafmt -scalafmtConfig := Some(file(".scalafmt.conf")) - // ci commands +addCommandAlias("validateFormatting", "; scalafmt::test ; test:scalafmt::test ; sbt:scalafmt::test") addCommandAlias("validate", "; clean ; update ; test") // List all scripted test separately to schedule them in different travis-ci jobs. diff --git a/project/plugins.sbt b/project/plugins.sbt index a91cecbcf..d61d9f384 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -12,4 +12,4 @@ libraryDependencies += "jline" % "jline" % "2.11" addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0") // For code formatting -addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "0.4.8") +addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.10") diff --git a/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/MappingsHelper.scala b/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/MappingsHelper.scala index fd38a91ba..0db096bbf 100644 --- a/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/MappingsHelper.scala +++ b/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/MappingsHelper.scala @@ -102,13 +102,13 @@ object MappingsHelper { * @param includeOnNoArtifact default is false. When there's no Artifact meta data remove it */ def fromClasspath(entries: Seq[Attributed[File]], - target: String, - includeArtifact: Artifact => Boolean, - includeOnNoArtifact: Boolean = false): Seq[(File, String)] = + target: String, + includeArtifact: Artifact => Boolean, + includeOnNoArtifact: Boolean = false): Seq[(File, String)] = entries.filter(attr => attr.get(sbt.Keys.artifact.key) map includeArtifact getOrElse includeOnNoArtifact).map { attribute => - val file = attribute.data - file -> s"$target/${file.getName}" + val file = attribute.data + file -> s"$target/${file.getName}" } } diff --git a/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/SettingsHelper.scala b/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/SettingsHelper.scala index 7043caefb..75f59c226 100644 --- a/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/SettingsHelper.scala +++ b/src/main/scala-sbt-0.13/com/typesafe/sbt/packager/SettingsHelper.scala @@ -6,56 +6,56 @@ import sbt._ object SettingsHelper { def addPackage(config: Configuration, - packageTask: TaskKey[File], - extension: String, - classifier: Option[String] = None): Seq[Setting[_]] = + packageTask: TaskKey[File], + extension: String, + classifier: Option[String] = None): Seq[Setting[_]] = inConfig(config)( addArtifact( - name apply (Artifact( - _, - extension, - extension, - classifier = classifier, - configurations = Iterable.empty, - url = None, - extraAttributes = Map.empty - )), - packageTask + name apply (Artifact( + _, + extension, + extension, + classifier = classifier, + configurations = Iterable.empty, + url = None, + extraAttributes = Map.empty + )), + packageTask ) ) def makeDeploymentSettings(config: Configuration, - packageTask: TaskKey[File], - extension: String, - classifier: Option[String] = None): Seq[Setting[_]] = + packageTask: TaskKey[File], + extension: String, + classifier: Option[String] = None): Seq[Setting[_]] = inConfig(config)(Classpaths.ivyPublishSettings ++ Classpaths.jvmPublishSettings) ++ inConfig(config)( Seq( - artifacts := Seq.empty, - packagedArtifacts := Map.empty, - projectID := ModuleID(organization.value, name.value, version.value), - moduleSettings := InlineConfiguration(projectID.value, projectInfo.value, Seq.empty), - ivyModule := { - val ivy = ivySbt.value - new ivy.Module(moduleSettings.value) - }, - deliverLocalConfiguration := Classpaths.deliverConfig(crossTarget.value, logging = ivyLoggingLevel.value), - deliverConfiguration := deliverLocalConfiguration.value, - publishConfiguration := new PublishConfiguration( - ivyFile = None, - resolverName = Classpaths.getPublishTo(publishTo.value).name, - artifacts = packagedArtifacts.value, - checksums = checksums.value, - logging = UpdateLogging.DownloadOnly, - overwrite = isSnapshot.value - ), - publishLocalConfiguration := new PublishConfiguration( - ivyFile = None, - resolverName = "local", - artifacts = packagedArtifacts.value, - checksums = checksums.value, - logging = UpdateLogging.DownloadOnly, - overwrite = isSnapshot.value - ) + artifacts := Seq.empty, + packagedArtifacts := Map.empty, + projectID := ModuleID(organization.value, name.value, version.value), + moduleSettings := InlineConfiguration(projectID.value, projectInfo.value, Seq.empty), + ivyModule := { + val ivy = ivySbt.value + new ivy.Module(moduleSettings.value) + }, + deliverLocalConfiguration := Classpaths.deliverConfig(crossTarget.value, logging = ivyLoggingLevel.value), + deliverConfiguration := deliverLocalConfiguration.value, + publishConfiguration := new PublishConfiguration( + ivyFile = None, + resolverName = Classpaths.getPublishTo(publishTo.value).name, + artifacts = packagedArtifacts.value, + checksums = checksums.value, + logging = UpdateLogging.DownloadOnly, + overwrite = isSnapshot.value + ), + publishLocalConfiguration := new PublishConfiguration( + ivyFile = None, + resolverName = "local", + artifacts = packagedArtifacts.value, + checksums = checksums.value, + logging = UpdateLogging.DownloadOnly, + overwrite = isSnapshot.value + ) ) ) ++ addPackage(config, packageTask, extension, classifier) } diff --git a/src/main/scala-sbt-1.0/com/typesafe/sbt/packager/SettingsHelper.scala b/src/main/scala-sbt-1.0/com/typesafe/sbt/packager/SettingsHelper.scala index e8f648851..565dfdc60 100644 --- a/src/main/scala-sbt-1.0/com/typesafe/sbt/packager/SettingsHelper.scala +++ b/src/main/scala-sbt-1.0/com/typesafe/sbt/packager/SettingsHelper.scala @@ -13,56 +13,56 @@ import com.typesafe.sbt.packager.Compat._ object SettingsHelper { def addPackage(config: Configuration, - packageTask: TaskKey[File], - extension: String, - classifier: Option[String] = None): Seq[Setting[_]] = inConfig(config)( + packageTask: TaskKey[File], + extension: String, + classifier: Option[String] = None): Seq[Setting[_]] = inConfig(config)( addArtifact( name apply (Artifact( - _, - extension, - extension, - classifier = classifier, - configurations = Vector.empty, - url = None + _, + extension, + extension, + classifier = classifier, + configurations = Vector.empty, + url = None )), packageTask ) ) def makeDeploymentSettings(config: Configuration, - packageTask: TaskKey[File], - extension: String, - classifier: Option[String] = None): Seq[Setting[_]] = + packageTask: TaskKey[File], + extension: String, + classifier: Option[String] = None): Seq[Setting[_]] = // Why do we need the ivyPublishSettings and jvmPublishSettings ? inConfig(config)(Classpaths.ivyPublishSettings ++ Classpaths.jvmPublishSettings) ++ inConfig(config)( Seq( - artifacts := Seq.empty, - packagedArtifacts := Map.empty, - projectID := ModuleID(organization.value, name.value, version.value), - // Custom module settings to skip the ivy XmlModuleDescriptorParser - moduleSettings := ModuleDescriptorConfiguration(projectID.value, projectInfo.value) - .withScalaModuleInfo(scalaModuleInfo.value), - ivyModule := { - val ivy = ivySbt.value - new ivy.Module(moduleSettings.value) - }, - // Where have these settings gone? - // ------------------------------- - // deliverLocalConfiguration := Classpaths.deliverConfig(crossTarget.value, logging = ivyLoggingLevel.value) - // deliverConfiguration := deliverLocalConfiguration.value, - // ------------------------------- - publishConfiguration := PublishConfiguration() - .withResolverName(Classpaths.getPublishTo(publishTo.value).name) - .withArtifacts(packagedArtifacts.value.toVector) - .withChecksums(checksums.value.toVector) - .withOverwrite(isSnapshot.value) - .withLogging(UpdateLogging.DownloadOnly), - publishLocalConfiguration := PublishConfiguration() - .withResolverName("local") - .withArtifacts(packagedArtifacts.value.toVector) - .withChecksums(checksums.value.toVector) - .withOverwrite(isSnapshot.value) - .withLogging(UpdateLogging.DownloadOnly) + artifacts := Seq.empty, + packagedArtifacts := Map.empty, + projectID := ModuleID(organization.value, name.value, version.value), + // Custom module settings to skip the ivy XmlModuleDescriptorParser + moduleSettings := ModuleDescriptorConfiguration(projectID.value, projectInfo.value) + .withScalaModuleInfo(scalaModuleInfo.value), + ivyModule := { + val ivy = ivySbt.value + new ivy.Module(moduleSettings.value) + }, + // Where have these settings gone? + // ------------------------------- + // deliverLocalConfiguration := Classpaths.deliverConfig(crossTarget.value, logging = ivyLoggingLevel.value) + // deliverConfiguration := deliverLocalConfiguration.value, + // ------------------------------- + publishConfiguration := PublishConfiguration() + .withResolverName(Classpaths.getPublishTo(publishTo.value).name) + .withArtifacts(packagedArtifacts.value.toVector) + .withChecksums(checksums.value.toVector) + .withOverwrite(isSnapshot.value) + .withLogging(UpdateLogging.DownloadOnly), + publishLocalConfiguration := PublishConfiguration() + .withResolverName("local") + .withArtifacts(packagedArtifacts.value.toVector) + .withChecksums(checksums.value.toVector) + .withOverwrite(isSnapshot.value) + .withLogging(UpdateLogging.DownloadOnly) ) ) ++ addPackage(config, packageTask, extension, classifier) diff --git a/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaAppPackaging.scala b/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaAppPackaging.scala index 9e808a888..7dd71df09 100644 --- a/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaAppPackaging.scala +++ b/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaAppPackaging.scala @@ -105,9 +105,9 @@ object JavaAppPackaging extends AutoPlugin { val filename: Option[String] = for { module <- dep.metadata // sbt 0.13.x key - .get(AttributeKey[ModuleID]("module-id")) - // sbt 1.x key - .orElse(dep.metadata.get(AttributeKey[ModuleID]("moduleID"))) + .get(AttributeKey[ModuleID]("module-id")) + // sbt 1.x key + .orElse(dep.metadata.get(AttributeKey[ModuleID]("moduleID"))) artifact <- dep.metadata.get(AttributeKey[Artifact]("artifact")) } yield makeJarName(module.organization, module.name, module.revision, artifact.name, artifact.classifier) filename.getOrElse(dep.data.getName) @@ -127,20 +127,20 @@ object JavaAppPackaging extends AutoPlugin { private def findProjectDependencyArtifacts: Def.Initialize[Task[Seq[Attributed[File]]]] = 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) + 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) } - val allArtifactsTask: Task[Seq[Attributed[File]]] = - artTasks.fold[Task[Seq[Attributed[File]]]](task(Nil)) { (previous, next) => - for { - p <- previous - n <- next - } yield p ++ n.filter(isRuntimeArtifact) - } - allArtifactsTask + val allArtifactsTask: Task[Seq[Attributed[File]]] = + artTasks.fold[Task[Seq[Attributed[File]]]](task(Nil)) { (previous, next) => + for { + p <- previous + n <- next + } yield p ++ n.filter(isRuntimeArtifact) + } + allArtifactsTask } .flatMap(identity) diff --git a/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaServerApplication.scala b/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaServerApplication.scala index 929139eef..c551614ea 100644 --- a/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaServerApplication.scala +++ b/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaServerApplication.scala @@ -158,12 +158,14 @@ object JavaServerAppPackaging extends AutoPlugin { */ private[this] def getEtcTemplateSource(sourceDirectory: File, loader: Option[ServerLoader]): java.net.URL = { val defaultTemplate = getClass.getResource(ETC_DEFAULT + "-template") - val (suffix, default) = loader.map { - case Upstart => ("-upstart", defaultTemplate) - case SystemV => ("-systemv", defaultTemplate) - case Systemd => - ("-systemd", getClass.getResource(ETC_DEFAULT + "-systemd-template")) - }.getOrElse(("", defaultTemplate)) + val (suffix, default) = loader + .map { + case Upstart => ("-upstart", defaultTemplate) + case SystemV => ("-systemv", defaultTemplate) + case Systemd => + ("-systemd", getClass.getResource(ETC_DEFAULT + "-systemd-template")) + } + .getOrElse(("", defaultTemplate)) val overrides = List[File](sourceDirectory / "templates" / (ETC_DEFAULT + suffix), sourceDirectory / "templates" / ETC_DEFAULT) diff --git a/src/main/scala/com/typesafe/sbt/packager/archetypes/scripts/AshScriptPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/archetypes/scripts/AshScriptPlugin.scala index 678769fb8..e8a4da4d0 100644 --- a/src/main/scala/com/typesafe/sbt/packager/archetypes/scripts/AshScriptPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/archetypes/scripts/AshScriptPlugin.scala @@ -97,9 +97,11 @@ object AshScriptPlugin extends AutoPlugin { (configFile map configFileDefine).toSeq ++ Seq(makeClasspathDefine(appClasspath)) private[this] def makeClasspathDefine(cp: Seq[String]): String = { - val fullString = cp map (n => - if (n.startsWith(File.separator)) n - else "$lib_dir/" + n) mkString ":" + val fullString = cp map ( + n => + if (n.startsWith(File.separator)) n + else "$lib_dir/" + n + ) mkString ":" "app_classpath=\"" + fullString + "\"\n" } diff --git a/src/main/scala/com/typesafe/sbt/packager/archetypes/scripts/BashStartScriptPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/archetypes/scripts/BashStartScriptPlugin.scala index c383a0fc2..d47652b2a 100644 --- a/src/main/scala/com/typesafe/sbt/packager/archetypes/scripts/BashStartScriptPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/archetypes/scripts/BashStartScriptPlugin.scala @@ -90,24 +90,26 @@ object BashStartScriptPlugin extends AutoPlugin { bashScriptConfigLocation: Option[String], tmpDir: File, log: Logger): Seq[(File, String)] = - bashScriptConfigLocation.collect { - case location if javaOptions.nonEmpty => - val configFile = tmpDir / "tmp" / "conf" / "application.ini" - //Do not use writeLines here because of issue #637 - IO.write(configFile, ("# options from build" +: javaOptions).mkString("\n")) - val filteredMappings = universalMappings.filter { - case (file, path) => path != appIniLocation - } - // Warn the user if he tries to specify options - if (filteredMappings.size < universalMappings.size) { - log.warn("--------!!! JVM Options are defined twice !!!-----------") - log.warn( - "application.ini is already present in output package. Will be overridden by 'javaOptions in Universal'" - ) - } - (configFile -> cleanApplicationIniPath(location)) +: filteredMappings - - }.getOrElse(universalMappings) + bashScriptConfigLocation + .collect { + case location if javaOptions.nonEmpty => + val configFile = tmpDir / "tmp" / "conf" / "application.ini" + //Do not use writeLines here because of issue #637 + IO.write(configFile, ("# options from build" +: javaOptions).mkString("\n")) + val filteredMappings = universalMappings.filter { + case (file, path) => path != appIniLocation + } + // Warn the user if he tries to specify options + if (filteredMappings.size < universalMappings.size) { + log.warn("--------!!! JVM Options are defined twice !!!-----------") + log.warn( + "application.ini is already present in output package. Will be overridden by 'javaOptions in Universal'" + ) + } + (configFile -> cleanApplicationIniPath(location)) +: filteredMappings + + } + .getOrElse(universalMappings) private[this] def generateStartScripts(config: BashScriptConfig, mainClass: Option[String], @@ -170,9 +172,11 @@ object BashStartScriptPlugin extends AutoPlugin { (configFile map configFileDefine).toSeq ++ Seq(makeClasspathDefine(appClasspath)) private[this] def makeClasspathDefine(cp: Seq[String]): String = { - val fullString = cp map (n => - if (n.startsWith(File.separator)) n - else "$lib_dir/" + n) mkString ":" + val fullString = cp map ( + n => + if (n.startsWith(File.separator)) n + else "$lib_dir/" + n + ) mkString ":" "declare -r app_classpath=\"" + fullString + "\"\n" } diff --git a/src/main/scala/com/typesafe/sbt/packager/debian/DebianNativePackaging.scala b/src/main/scala/com/typesafe/sbt/packager/debian/DebianNativePackaging.scala index 222338e1e..b816744ca 100644 --- a/src/main/scala/com/typesafe/sbt/packager/debian/DebianNativePackaging.scala +++ b/src/main/scala/com/typesafe/sbt/packager/debian/DebianNativePackaging.scala @@ -50,7 +50,7 @@ trait DebianNativePackaging extends DebianPluginLike { val deb = packageBin.value val role = debianSignRole.value val log = streams.value.log - sys.process.Process(Seq("dpkg-sig", "-s", role, deb.getAbsolutePath), Some(deb.getParentFile)) ! log match { + sys.process.Process(Seq("dpkg-sig", "-s", role, deb.getAbsolutePath), Some(deb.getParentFile)) ! log match { case 0 => () case x => sys.error("Failed to sign debian package! exit code: " + x) @@ -59,7 +59,7 @@ trait DebianNativePackaging extends DebianPluginLike { }, lintian := { val file = packageBin.value - sys.process.Process(Seq("lintian", "-c", "-v", file.getName), Some(file.getParentFile)).! + sys.process.Process(Seq("lintian", "-c", "-v", file.getName), Some(file.getParentFile)).! }, /** Implementation of the actual packaging */ packageBin := buildPackage( @@ -89,7 +89,7 @@ trait DebianNativePackaging extends DebianPluginLike { val changesFileName = debFile.getName.replaceAll("deb$", "changes") val changesFile: File = targetDir / ".." / changesFileName try { - val changes = sys.process.Process(Seq("dpkg-genchanges", "-b"), Some(targetDir / "../tmp")).!! + val changes = sys.process.Process(Seq("dpkg-genchanges", "-b"), Some(targetDir / "../tmp")).!! val allChanges = List(changes) IO.writeLines(changesFile, allChanges) } catch { diff --git a/src/main/scala/com/typesafe/sbt/packager/debian/DebianPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/debian/DebianPlugin.scala index 7c111fec1..9d3eb4fe7 100644 --- a/src/main/scala/com/typesafe/sbt/packager/debian/DebianPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/debian/DebianPlugin.scala @@ -134,12 +134,12 @@ object DebianPlugin extends AutoPlugin with DebianNativePackaging { // override and merge with the user defined scripts. Will change in the future val controlScriptsDir = debianControlScriptsDirectory.value val overridenScripts = scripts ++ readContent( - Seq( - scriptMapping(Names.Prerm, debianMakePrermScript.value, controlScriptsDir), - scriptMapping(Names.Preinst, debianMakePreinstScript.value, controlScriptsDir), - scriptMapping(Names.Postinst, debianMakePostinstScript.value, controlScriptsDir), - scriptMapping(Names.Postrm, debianMakePostrmScript.value, controlScriptsDir) - ).flatten + Seq( + scriptMapping(Names.Prerm, debianMakePrermScript.value, controlScriptsDir), + scriptMapping(Names.Preinst, debianMakePreinstScript.value, controlScriptsDir), + scriptMapping(Names.Postinst, debianMakePostinstScript.value, controlScriptsDir), + scriptMapping(Names.Postrm, debianMakePostrmScript.value, controlScriptsDir) + ).flatten ) // --- legacy ends @@ -428,22 +428,22 @@ trait DebianPluginLike { // filter all root mappings, map to (user,group) key, group by, append everything val chowns = mappings .filter { - case LinuxPackageMapping(_, LinuxFileMetaData(Users.Root, Users.Root, _, _, _), _) => - false - case _ => true + case LinuxPackageMapping(_, LinuxFileMetaData(Users.Root, Users.Root, _, _, _), _) => + false + case _ => true } .map { - case LinuxPackageMapping(paths, meta, _) => - (meta.user, meta.group) -> paths + case LinuxPackageMapping(paths, meta, _) => + (meta.user, meta.group) -> paths } .groupBy(_._1) .map { - case ((user, group), pathList) => - validateUserGroupNames(user, streams) - validateUserGroupNames(group, streams) - val chown = chownCmd(user, group) _ - // remove key, flatten it and then use mapping path (_.2) to create chown command - pathList.flatMap(_._2).map(m => chown(m._2)) + case ((user, group), pathList) => + validateUserGroupNames(user, streams) + validateUserGroupNames(group, streams) + val chown = chownCmd(user, group) _ + // remove key, flatten it and then use mapping path (_.2) to create chown command + pathList.flatMap(_._2).map(m => chown(m._2)) } val replacement = header :: chowns.flatten.toList mkString "\n" DebianPlugin.CHOWN_REPLACEMENT -> replacement diff --git a/src/main/scala/com/typesafe/sbt/packager/debian/JDebPackaging.scala b/src/main/scala/com/typesafe/sbt/packager/debian/JDebPackaging.scala index 7af1c5dfb..2f8f28eee 100644 --- a/src/main/scala/com/typesafe/sbt/packager/debian/JDebPackaging.scala +++ b/src/main/scala/com/typesafe/sbt/packager/debian/JDebPackaging.scala @@ -6,10 +6,10 @@ import sbt._ import sbt.Keys.{classpathTypes, normalizedName, packageBin, streams, target, version} import com.typesafe.sbt.packager.linux.{LinuxFileMetaData, LinuxPackageMapping, LinuxSymlink} import com.typesafe.sbt.packager.linux.LinuxPlugin.autoImport.{ -linuxPackageMappings, -linuxPackageSymlinks, -linuxScriptReplacements, -packageArchitecture + linuxPackageMappings, + linuxPackageSymlinks, + linuxScriptReplacements, + packageArchitecture } import scala.collection.JavaConversions._ import org.vafer.jdeb.{DataProducer, DebMaker} diff --git a/src/main/scala/com/typesafe/sbt/packager/docker/DockerPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/docker/DockerPlugin.scala index 8551efc50..b64c96fef 100644 --- a/src/main/scala/com/typesafe/sbt/packager/docker/DockerPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/docker/DockerPlugin.scala @@ -82,9 +82,9 @@ object DockerPlugin extends AutoPlugin { dockerExecCommand := Seq("docker"), dockerBuildOptions := Seq("--force-rm") ++ Seq("-t", dockerAlias.value.versioned) ++ ( if (dockerUpdateLatest.value) - Seq("-t", dockerAlias.value.latest) + Seq("-t", dockerAlias.value.latest) else - Seq() + Seq() ), dockerRmiCommand := dockerExecCommand.value ++ Seq("rmi"), dockerBuildCommand := dockerExecCommand.value ++ Seq("build") ++ dockerBuildOptions.value ++ Seq("."), @@ -107,8 +107,8 @@ object DockerPlugin extends AutoPlugin { executableScriptName := executableScriptName.value, mappings ++= dockerPackageMappings.value, mappings ++= { - val baseDir = target.value - Seq(dockerGenerateConfig.value) pair (file => IO.relativize(baseDir, file)) + val baseDir = target.value + Seq(dockerGenerateConfig.value) pair (file => IO.relativize(baseDir, file)) }, name := name.value, packageName := packageName.value, @@ -121,20 +121,20 @@ object DockerPlugin extends AutoPlugin { val _ = publishLocal.value val alias = dockerAlias.value val log = streams.value.log - val execCommand = dockerExecCommand.value - publishDocker(execCommand, alias.versioned, log) + val execCommand = dockerExecCommand.value + publishDocker(execCommand, alias.versioned, log) if (dockerUpdateLatest.value) { - publishDocker(execCommand, alias.latest, log) + publishDocker(execCommand, alias.latest, log) } }, clean := { val alias = dockerAlias.value val log = streams.value.log - val rmiCommand = dockerRmiCommand.value - // clean up images - rmiDocker(rmiCommand, alias.versioned, log) + val rmiCommand = dockerRmiCommand.value + // clean up images + rmiDocker(rmiCommand, alias.versioned, log) if (dockerUpdateLatest.value) { - rmiDocker(rmiCommand, alias.latest, log) + rmiDocker(rmiCommand, alias.latest, log) } }, sourceDirectory := sourceDirectory.value / "docker", @@ -300,12 +300,12 @@ object DockerPlugin extends AutoPlugin { case s if s.startsWith("Sending build context") => log.debug(s) // 1.0 case s if !s.trim.isEmpty => log.error(s) - case s => + case s => } override def out(inf: => String): Unit = inf match { case s if !s.trim.isEmpty => log.info(s) - case s => + case s => } override def buffer[T](f: => T): T = f @@ -325,7 +325,7 @@ object DockerPlugin extends AutoPlugin { def rmiDockerLogger(log: Logger) = new sys.process.ProcessLogger { override def err(err: => String): Unit = err match { case s if !s.trim.isEmpty => log.error(s) - case s => + case s => } override def out(inf: => String): Unit = log.info(inf) @@ -350,20 +350,20 @@ object DockerPlugin extends AutoPlugin { def publishLogger(log: Logger) = new sys.process.ProcessLogger { - override def err(err: => String): Unit = err match { + override def err(err: => String): Unit = err match { case s if !s.trim.isEmpty => log.error(s) - case s => + case s => } - override def out(inf: => String): Unit = + override def out(inf: => String): Unit = inf match { case s if s.startsWith("Please login") => loginRequired.compareAndSet(false, true) case s if !loginRequired.get && !s.trim.isEmpty => log.info(s) - case s => + case s => } - override def buffer[T](f: => T): T = f + override def buffer[T](f: => T): T = f } val cmd = execCommand ++ Seq("push", tag) diff --git a/src/main/scala/com/typesafe/sbt/packager/jar/ClasspathJarPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/jar/ClasspathJarPlugin.scala index 134726a49..26aba10dd 100644 --- a/src/main/scala/com/typesafe/sbt/packager/jar/ClasspathJarPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/jar/ClasspathJarPlugin.scala @@ -23,23 +23,23 @@ object ClasspathJarPlugin extends AutoPlugin { override def requires = JavaAppPackaging override lazy val projectSettings: Seq[Setting[_]] = Defaults - .packageTaskSettings(packageJavaClasspathJar, mappings in packageJavaClasspathJar) ++ Seq( - mappings in packageJavaClasspathJar := Nil, - artifactClassifier in packageJavaClasspathJar := Option("classpath"), - packageOptions in packageJavaClasspathJar := { + .packageTaskSettings(packageJavaClasspathJar, mappings in packageJavaClasspathJar) ++ Seq( + mappings in packageJavaClasspathJar := Nil, + artifactClassifier in packageJavaClasspathJar := Option("classpath"), + packageOptions in packageJavaClasspathJar := { val classpath = (scriptClasspath in packageJavaClasspathJar).value val manifestClasspath = Attributes.Name.CLASS_PATH -> classpath.mkString(" ") Seq(ManifestAttributes(manifestClasspath)) }, - artifactName in packageJavaClasspathJar := { (scalaVersion, moduleId, artifact) => + artifactName in packageJavaClasspathJar := { (scalaVersion, moduleId, artifact) => moduleId.organization + "." + artifact.name + "-" + moduleId.revision + artifact.classifier.fold("")("-" + _) + "." + artifact.extension }, - scriptClasspath in bashScriptDefines := Seq((artifactPath in packageJavaClasspathJar).value.getName), - scriptClasspath in batScriptReplacements := Seq((artifactPath in packageJavaClasspathJar).value.getName), - mappings in Universal += { + scriptClasspath in bashScriptDefines := Seq((artifactPath in packageJavaClasspathJar).value.getName), + scriptClasspath in batScriptReplacements := Seq((artifactPath in packageJavaClasspathJar).value.getName), + mappings in Universal += { val classpathJar = packageJavaClasspathJar.value classpathJar -> ("lib/" + classpathJar.getName) } - ) + ) } diff --git a/src/main/scala/com/typesafe/sbt/packager/jar/LauncherJarPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/jar/LauncherJarPlugin.scala index edd244b9b..8db6e42ef 100644 --- a/src/main/scala/com/typesafe/sbt/packager/jar/LauncherJarPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/jar/LauncherJarPlugin.scala @@ -24,31 +24,31 @@ object LauncherJarPlugin extends AutoPlugin { override def requires = JavaAppPackaging override lazy val projectSettings: Seq[Setting[_]] = Defaults - .packageTaskSettings(packageJavaLauncherJar, mappings in packageJavaLauncherJar) ++ Seq( - mappings in packageJavaLauncherJar := Nil, - artifactClassifier in packageJavaLauncherJar := Option("launcher"), - packageOptions in packageJavaLauncherJar := { + .packageTaskSettings(packageJavaLauncherJar, mappings in packageJavaLauncherJar) ++ Seq( + mappings in packageJavaLauncherJar := Nil, + artifactClassifier in packageJavaLauncherJar := Option("launcher"), + packageOptions in packageJavaLauncherJar := { val classpath = (scriptClasspath in packageJavaLauncherJar).value val manifestClasspath = Attributes.Name.CLASS_PATH -> classpath.mkString(" ") val manifestMainClass = (mainClass in (Compile, packageJavaLauncherJar)).value.map(Attributes.Name.MAIN_CLASS -> _) Seq(ManifestAttributes(manifestMainClass.toSeq :+ manifestClasspath: _*)) }, - artifactName in packageJavaLauncherJar := { (scalaVersion, moduleId, artifact) => + artifactName in packageJavaLauncherJar := { (scalaVersion, moduleId, artifact) => moduleId.organization + "." + artifact.name + "-" + moduleId.revision + artifact.classifier.fold("")("-" + _) + "." + artifact.extension }, - mainClass in (Compile, bashScriptDefines) := { + mainClass in (Compile, bashScriptDefines) := { Some("-jar $lib_dir/" + (artifactPath in packageJavaLauncherJar).value.getName) }, - scriptClasspath in bashScriptDefines := Nil, - mainClass in (Compile, batScriptReplacements) := { + scriptClasspath in bashScriptDefines := Nil, + mainClass in (Compile, batScriptReplacements) := { Some("-jar %APP_LIB_DIR%\\" + (artifactPath in packageJavaLauncherJar).value.getName) }, - scriptClasspath in batScriptReplacements := Nil, - mappings in Universal += { + scriptClasspath in batScriptReplacements := Nil, + mappings in Universal += { val javaLauncher = packageJavaLauncherJar.value javaLauncher -> ("lib/" + javaLauncher.getName) } - ) + ) } diff --git a/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerPlugin.scala index 856573178..b41943202 100644 --- a/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerPlugin.scala @@ -33,59 +33,53 @@ object JDKPackagerPlugin extends AutoPlugin { override def projectConfigurations: Seq[Configuration] = Seq(JDKPackager) override lazy val projectSettings: Seq[Setting[_]] = Seq( - jdkAppIcon := None, - jdkPackagerType := "installer", - jdkPackagerBasename := packageName.value + "-pkg", - jdkPackagerToolkit := JavaFXToolkit, - jdkPackagerJVMArgs := Seq("-Xmx768m"), - jdkPackagerAppArgs := Seq.empty, - jdkPackagerProperties := Map.empty, - jdkPackagerAssociations := Seq.empty - ) ++ inConfig(JDKPackager)( - Seq( - sourceDirectory := sourceDirectory.value / "deploy", - target := target.value / dirname, - mainClass := (mainClass in Runtime).value, - name := name.value, - packageName := packageName.value, - maintainer := maintainer.value, - packageSummary := packageSummary.value, - packageDescription := packageDescription.value, - mappings := (mappings in Universal).value, - antPackagerTasks := locateAntTasks(javaHome.value, sLog.value), - antExtraClasspath := Seq(sourceDirectory.value, target.value), - antBuildDefn := makeAntBuild( - antPackagerTasks.value, - antExtraClasspath.value, - name.value, - (stage in Universal).value, - mappings.value, - platformDOM(jdkPackagerJVMArgs.value, jdkPackagerProperties.value), - applicationDOM( + jdkAppIcon := None, + jdkPackagerType := "installer", + jdkPackagerBasename := packageName.value + "-pkg", + jdkPackagerToolkit := JavaFXToolkit, + jdkPackagerJVMArgs := Seq("-Xmx768m"), + jdkPackagerAppArgs := Seq.empty, + jdkPackagerProperties := Map.empty, + jdkPackagerAssociations := Seq.empty + ) ++ inConfig(JDKPackager)( + Seq( + sourceDirectory := sourceDirectory.value / "deploy", + target := target.value / dirname, + mainClass := (mainClass in Runtime).value, + name := name.value, + packageName := packageName.value, + maintainer := maintainer.value, + packageSummary := packageSummary.value, + packageDescription := packageDescription.value, + mappings := (mappings in Universal).value, + antPackagerTasks := locateAntTasks(javaHome.value, sLog.value), + antExtraClasspath := Seq(sourceDirectory.value, target.value), + antBuildDefn := makeAntBuild( + antPackagerTasks.value, + antExtraClasspath.value, + name.value, + (stage in Universal).value, + mappings.value, + platformDOM(jdkPackagerJVMArgs.value, jdkPackagerProperties.value), + applicationDOM(name.value, version.value, mainClass.value, jdkPackagerToolkit.value, jdkPackagerAppArgs.value), + deployDOM( + jdkPackagerBasename.value, + jdkPackagerType.value, + (artifactPath in LauncherJarPlugin.autoImport.packageJavaLauncherJar).value, + target.value, + infoDOM( name.value, - version.value, - mainClass.value, - jdkPackagerToolkit.value, - jdkPackagerAppArgs.value - ), - deployDOM( - jdkPackagerBasename.value, - jdkPackagerType.value, - (artifactPath in LauncherJarPlugin.autoImport.packageJavaLauncherJar).value, - target.value, - infoDOM( - name.value, - packageDescription.value, - maintainer.value, - jdkAppIcon.value, - jdkPackagerAssociations.value - ) + packageDescription.value, + maintainer.value, + jdkAppIcon.value, + jdkPackagerAssociations.value ) - ), - writeAntBuild := writeAntFile(target.value, antBuildDefn.value, streams.value), - packageBin := buildPackageWithAnt(writeAntBuild.value, target.value, streams.value) - ) + ) + ), + writeAntBuild := writeAntFile(target.value, antBuildDefn.value, streams.value), + packageBin := buildPackageWithAnt(writeAntBuild.value, target.value, streams.value) ) + ) } diff --git a/src/main/scala/com/typesafe/sbt/packager/linux/LinuxMappingDSL.scala b/src/main/scala/com/typesafe/sbt/packager/linux/LinuxMappingDSL.scala index cf7f5cda2..175e03fa0 100644 --- a/src/main/scala/com/typesafe/sbt/packager/linux/LinuxMappingDSL.scala +++ b/src/main/scala/com/typesafe/sbt/packager/linux/LinuxMappingDSL.scala @@ -45,7 +45,7 @@ trait LinuxMappingDSL { def configWithNoReplace(mappings: Seq[LinuxPackageMapping]): Seq[LinuxPackageMapping] = mappings.map { case mapping if mapping.fileData.config != "false" => mapping.withConfig("noreplace") - case mapping => mapping + case mapping => mapping } } diff --git a/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPackageMapping.scala b/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPackageMapping.scala index 380906dd9..66ce1b0df 100644 --- a/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPackageMapping.scala +++ b/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPackageMapping.scala @@ -77,7 +77,7 @@ object LinuxSymlink { // from ln man page // -f --force remove existing destination files if (!to.exists) - sys.process.Process(Seq("ln", "-sf", linkFinal, name), linkDir).! match { + sys.process.Process(Seq("ln", "-sf", linkFinal, name), linkDir).! match { case 0 => () case n => sys.error("Failed to symlink " + link.destination + " to " + to) diff --git a/src/main/scala/com/typesafe/sbt/packager/rpm/RpmHelper.scala b/src/main/scala/com/typesafe/sbt/packager/rpm/RpmHelper.scala index 27a5268fb..b6d40c95f 100644 --- a/src/main/scala/com/typesafe/sbt/packager/rpm/RpmHelper.scala +++ b/src/main/scala/com/typesafe/sbt/packager/rpm/RpmHelper.scala @@ -85,7 +85,7 @@ object RpmHelper { IO.withTemporaryDirectory { tmpRpmBuildDir => val args: Seq[String] = (spec.setarch match { case Some(arch) => Seq("setarch", arch) - case None => Seq() + case None => Seq() }) ++ Seq( "rpmbuild", "-bb", diff --git a/src/main/scala/com/typesafe/sbt/packager/rpm/RpmMetadata.scala b/src/main/scala/com/typesafe/sbt/packager/rpm/RpmMetadata.scala index 779eea4a5..9d3f6fdf1 100644 --- a/src/main/scala/com/typesafe/sbt/packager/rpm/RpmMetadata.scala +++ b/src/main/scala/com/typesafe/sbt/packager/rpm/RpmMetadata.scala @@ -301,9 +301,11 @@ case class RpmSpec(meta: RpmMetadata, if (symlinks.isEmpty) None else { - val relocateLinks = symlinks.map { symlink => - s"""rm -rf $$(relocateLink ${symlink.link} $installDir $appName $$RPM_INSTALL_PREFIX) && ln -s $$(relocateLink ${symlink.destination} $installDir $appName $$RPM_INSTALL_PREFIX) $$(relocateLink ${symlink.link} $installDir $appName $$RPM_INSTALL_PREFIX)""" - }.mkString("\n") + val relocateLinks = symlinks + .map { symlink => + s"""rm -rf $$(relocateLink ${symlink.link} $installDir $appName $$RPM_INSTALL_PREFIX) && ln -s $$(relocateLink ${symlink.destination} $installDir $appName $$RPM_INSTALL_PREFIX) $$(relocateLink ${symlink.link} $installDir $appName $$RPM_INSTALL_PREFIX)""" + } + .mkString("\n") Some(relocateLinkFunction + "\n" + relocateLinks) } @@ -315,9 +317,11 @@ case class RpmSpec(meta: RpmMetadata, val checkUninstall = "if [ $1 -eq 0 ] ;\nthen" val sourceAppConfig = s""" [ -e /etc/sysconfig/$appName ] && . /etc/sysconfig/$appName""" - val cleanupLinks = symlinks.map { symlink => - s""" rm -rf $$(relocateLink ${symlink.link} $installDir $appName $$PACKAGE_PREFIX)""" - }.mkString("\n") + val cleanupLinks = symlinks + .map { symlink => + s""" rm -rf $$(relocateLink ${symlink.link} $installDir $appName $$PACKAGE_PREFIX)""" + } + .mkString("\n") Some(relocateLinkFunction + "\n" + checkUninstall + "\n" + sourceAppConfig + "\n" + cleanupLinks + "\nfi") } diff --git a/src/main/scala/com/typesafe/sbt/packager/universal/Archives.scala b/src/main/scala/com/typesafe/sbt/packager/universal/Archives.scala index deefa924a..bf2e20bb4 100644 --- a/src/main/scala/com/typesafe/sbt/packager/universal/Archives.scala +++ b/src/main/scala/com/typesafe/sbt/packager/universal/Archives.scala @@ -136,8 +136,8 @@ object Archives { // Create the DMG file: sys.process .Process( - Seq("hdiutil", "create", "-megabytes", "%d" format neededMegabytes, "-fs", "HFS+", "-volname", name, name), - Some(target) + Seq("hdiutil", "create", "-megabytes", "%d" format neededMegabytes, "-fs", "HFS+", "-volname", name, name), + Some(target) ) .! match { case 0 => () diff --git a/src/main/scala/com/typesafe/sbt/packager/windows/WindowsPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/windows/WindowsPlugin.scala index ce6f54d71..0931297c2 100644 --- a/src/main/scala/com/typesafe/sbt/packager/windows/WindowsPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/windows/WindowsPlugin.scala @@ -106,12 +106,12 @@ object WindowsPlugin extends AutoPlugin { IO.copy(for ((f, to) <- mappings.value) yield (f, target.value / to)) // Now compile WIX val wixdir = Option(System.getenv("WIX")) getOrElse sys.error( - "WIX environment not found. Please ensure WIX is installed on this computer." + "WIX environment not found. Please ensure WIX is installed on this computer." ) val candleCmd = Seq(wixdir + "\\bin\\candle.exe", wix.getAbsolutePath) ++ candleOptions.value streams.value.log.debug(candleCmd mkString " ") sys.process.Process(candleCmd, Some(target.value)) ! streams.value.log match { - case 0 => () + case 0 => () case exitCode => sys.error(s"Unable to run WIX compilation to wixobj. Exited with ${exitCode}") } // Now create MSI @@ -119,7 +119,7 @@ object WindowsPlugin extends AutoPlugin { val lightCmd = Seq(wixdir + "\\bin\\light.exe", wixobj.getAbsolutePath) ++ lightOptions.value streams.value.log.debug(lightCmd mkString " ") sys.process.Process(lightCmd, Some(target.value)) ! streams.value.log match { - case 0 => () + case 0 => () case exitCode => sys.error(s"Unable to run build msi. Exited with ${exitCode}") } msi diff --git a/src/main/scala/com/typesafe/sbt/packager/windows/WixHelper.scala b/src/main/scala/com/typesafe/sbt/packager/windows/WixHelper.scala index c79482a86..15b2c5f12 100644 --- a/src/main/scala/com/typesafe/sbt/packager/windows/WixHelper.scala +++ b/src/main/scala/com/typesafe/sbt/packager/windows/WixHelper.scala @@ -258,7 +258,7 @@ object WixHelper { */ def cleanStringForId(n: String) = { val x = n.replaceAll("[^0-9a-zA-Z_]", "_").takeRight(59) + (math.abs(n.hashCode).toString + "xxxxxxxxx") - .substring(0, 9) + .substring(0, 9) if (x startsWith "_") x else "_" + x } diff --git a/src/sbt-test/debian/java-app-archetype/src/main/scala/test/Test.scala b/src/sbt-test/debian/java-app-archetype/src/main/scala/test/Test.scala index b65353426..e7948961b 100644 --- a/src/sbt-test/debian/java-app-archetype/src/main/scala/test/Test.scala +++ b/src/sbt-test/debian/java-app-archetype/src/main/scala/test/Test.scala @@ -2,8 +2,8 @@ package test object Test extends App { Option(sys.props("result.string")) match { - case Some(value) => println(value) - case _ => println("SUCCESS!") + case Some(value) => println(value) + case _ => println("SUCCESS!") } - + } diff --git a/src/sbt-test/rpm/scriptlets-rpm/build.sbt b/src/sbt-test/rpm/scriptlets-rpm/build.sbt index 1ae0e3830..70cc14f59 100644 --- a/src/sbt-test/rpm/scriptlets-rpm/build.sbt +++ b/src/sbt-test/rpm/scriptlets-rpm/build.sbt @@ -93,8 +93,8 @@ TaskKey[Unit]("checkRpmVersion") := { val rpmVersion = fullRpmVersion substring firstDigit streams.value.log.info("Found rpmVersion: " + rpmVersion) val (major, minor, patch) = rpmVersion.trim.split("\\.").map(_.toInt) match { - case Array(major) => (major, 0, 0) - case Array(major, minor) => (major, minor, 0) + case Array(major) => (major, 0, 0) + case Array(major, minor) => (major, minor, 0) case Array(major, minor, patch, _ *) => (major, minor, patch) } assert(major >= 4, "RPM version must be greater than than 4.x.x. Is " + fullRpmVersion) diff --git a/src/sbt-test/rpm/setarch-rpm/build.sbt b/src/sbt-test/rpm/setarch-rpm/build.sbt index 94dba6fc2..2cc6f4120 100644 --- a/src/sbt-test/rpm/setarch-rpm/build.sbt +++ b/src/sbt-test/rpm/setarch-rpm/build.sbt @@ -21,8 +21,8 @@ rpmSetarch := Some("i386") linuxPackageMappings := { val helloMapping = LinuxPackageMapping( - Seq(((resourceDirectory in Compile).value / "hello-32bit", "/usr/share/rpm-package/libexec/hello-32bit")) - ) withPerms "0755" + Seq(((resourceDirectory in Compile).value / "hello-32bit", "/usr/share/rpm-package/libexec/hello-32bit")) + ) withPerms "0755" linuxPackageMappings.value :+ helloMapping } diff --git a/src/sbt-test/universal/multiproject-classifiers/build.sbt b/src/sbt-test/universal/multiproject-classifiers/build.sbt index 70d5bb7e3..9d8c42d88 100644 --- a/src/sbt-test/universal/multiproject-classifiers/build.sbt +++ b/src/sbt-test/universal/multiproject-classifiers/build.sbt @@ -29,10 +29,10 @@ lazy val sub = project }, exportedProducts in Assets := { Seq( - Attributed - .blank(baseDirectory.value / "src" / "main" / "assets") - .put(artifact.key, (artifact in Assets).value) - .put(AttributeKey[ModuleID]("module-id"), projectID.value) + Attributed + .blank(baseDirectory.value / "src" / "main" / "assets") + .put(artifact.key, (artifact in Assets).value) + .put(AttributeKey[ModuleID]("module-id"), projectID.value) ) } ) diff --git a/version.sbt b/version.sbt index f318f440f..b4bf19689 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -version in ThisBuild := "1.2.2-SNAPSHOT" \ No newline at end of file +version in ThisBuild := "1.2.2-SNAPSHOT" From fb70c5610f2f62130872221ac21b101b55e44c6d Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Mon, 7 Aug 2017 20:45:44 +0200 Subject: [PATCH 45/47] Upgrade sbt-release process --- build.sbt | 8 ++++---- project/plugins.sbt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.sbt b/build.sbt index 68c94b580..3b6fce948 100644 --- a/build.sbt +++ b/build.sbt @@ -63,7 +63,7 @@ git.remoteRepo := "git@github.com:sbt/sbt-native-packager.git" scriptedSettings scriptedLaunchOpts += "-Dproject.version=" + version.value -// Release configurationr +// Release configuration releasePublishArtifactsAction := PgpKeys.publishSigned.value publishMavenStyle := false @@ -71,12 +71,12 @@ import ReleaseTransformations._ releaseProcess := Seq[ReleaseStep]( checkSnapshotDependencies, inquireVersions, - runTest, - releaseStepInputTask(scripted, " universal/* debian/* rpm/* docker/* ash/* jar/* bash/* jdkpackager/*"), + releaseStepCommandAndRemaining("^ test"), + releaseStepCommandAndRemaining("^ scripted universal/* debian/* rpm/* docker/* ash/* jar/* bash/* jdkpackager/*"), setReleaseVersion, commitReleaseVersion, tagRelease, - publishArtifacts, + releaseStepCommandAndRemaining("^ publishSigned"), setNextVersion, commitNextVersion, pushChanges, diff --git a/project/plugins.sbt b/project/plugins.sbt index d61d9f384..db3fc01f0 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,6 +1,6 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.4") addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.0.0") -addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.0") +addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.6") addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0") libraryDependencies += "org.scala-sbt" % "scripted-plugin" % sbtVersion.value From a9816c10e797a4d5cc877eb5cceb6efbdecb0ece Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Mon, 7 Aug 2017 22:48:45 +0200 Subject: [PATCH 46/47] Setting version to 1.2.2-RC1 --- version.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.sbt b/version.sbt index b4bf19689..1cb5139f0 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -version in ThisBuild := "1.2.2-SNAPSHOT" +version in ThisBuild := "1.2.2-RC1" From 2c01581b24cba114c2761ccd4adb3e6534d42010 Mon Sep 17 00:00:00 2001 From: Nepomuk Seiler Date: Mon, 7 Aug 2017 22:55:32 +0200 Subject: [PATCH 47/47] Setting version to 1.2.2-SNAPSHOT --- version.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.sbt b/version.sbt index 1cb5139f0..b4bf19689 100644 --- a/version.sbt +++ b/version.sbt @@ -1 +1 @@ -version in ThisBuild := "1.2.2-RC1" +version in ThisBuild := "1.2.2-SNAPSHOT"