From 7acfb044d165661d97864a3fe01aba2ed5ca8d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ferreira?= Date: Sun, 13 Oct 2024 21:08:53 +0100 Subject: [PATCH] migrate to slash syntax (#1636) * upgrade to slash syntax * migrate scripted tests to slash syntax * migrate more plugins * migrate comments * scalafmt * more scalafmt * Update src/main/scala/com/typesafe/sbt/packager/universal/UniversalPlugin.scala * Update src/main/scala/com/typesafe/sbt/packager/universal/UniversalPlugin.scala * use "Set up Azul JDK 1.8 and SBT" in scripted-jdk-packager job * leftover from sbt 2.x migration * migrate more slash syntax in scalafix rule * remove double parenthesis * fix xxx in zzz in (a,b) * remove more parenthesis * remove even more parenthesis --- .../sbt/packager/SettingsHelper.scala | 2 +- .../com/typesafe/sbt/PackagerPlugin.scala | 16 ++--- .../archetypes/JavaAppPackaging.scala | 22 +++--- .../archetypes/JavaServerApplication.scala | 42 +++++------ .../archetypes/MaintainerScriptHelper.scala | 18 ++--- .../scripts/ApplicationIniGenerator.scala | 2 +- .../archetypes/scripts/AshScriptPlugin.scala | 2 +- .../scripts/BashStartScriptPlugin.scala | 20 +++--- .../scripts/BatStartScriptPlugin.scala | 18 ++--- .../scripts/StartScriptMainClassConfig.scala | 4 +- .../systemloader/SystemloaderPlugin.scala | 4 +- .../archetypes/systemloader/package.scala | 2 +- .../debian/DebianNativePackaging.scala | 2 +- .../sbt/packager/debian/DebianPlugin.scala | 48 ++++++------- .../sbt/packager/debian/JDebPackaging.scala | 4 +- .../sbt/packager/docker/DockerPlugin.scala | 4 +- .../GraalVMNativeImagePlugin.scala | 10 +-- .../sbt/packager/jar/ClasspathJarPlugin.scala | 18 ++--- .../sbt/packager/jar/LauncherJarPlugin.scala | 28 ++++---- .../jdkpackager/JDKPackagerAntHelper.scala | 4 +- .../jdkpackager/JDKPackagerPlugin.scala | 10 +-- .../sbt/packager/linux/LinuxPlugin.scala | 70 +++++++++---------- .../sbt/packager/rpm/RpmMetadata.scala | 10 +-- .../typesafe/sbt/packager/rpm/RpmPlugin.scala | 68 +++++++++--------- .../packager/universal/UniversalPlugin.scala | 64 ++++++++--------- .../sbt/packager/validation/Validation.scala | 4 +- .../sbt/packager/windows/WindowsPlugin.scala | 54 +++++++------- src/sbt-test/ash/add-app-settings/build.sbt | 4 +- .../ash/command-line-settings/build.sbt | 6 +- src/sbt-test/ash/memory-settings/build.sbt | 4 +- src/sbt-test/ash/override-templates/build.sbt | 2 +- src/sbt-test/ash/simple-app/build.sbt | 2 +- src/sbt-test/ash/top-level-main/build.sbt | 2 +- .../bash/absolute-path-in-bash/build.sbt | 4 +- .../bash/java-home-var-expansion/build.sbt | 4 +- src/sbt-test/bash/memory-settings/build.sbt | 6 +- src/sbt-test/bash/multiple-apps/build.sbt | 4 +- .../bash/override-templates/build.sbt | 4 +- src/sbt-test/bash/simple-app/build.sbt | 2 +- src/sbt-test/bash/top-level-main/build.sbt | 2 +- .../cygwin/java-app-archetype/build.sbt | 2 +- .../debian/daemon-group-gid-deb/build.sbt | 8 +-- src/sbt-test/debian/daemon-user-deb/build.sbt | 6 +- .../debian/daemon-user-homedir-deb/build.sbt | 8 +-- .../debian/daemon-user-shell-deb/build.sbt | 8 +-- .../debian/daemon-user-uid-deb/build.sbt | 8 +-- .../debian/file-permissions/build.sbt | 2 +- src/sbt-test/debian/gen-changes/build.sbt | 6 +- .../debian/java-app-archetype/build.sbt | 6 +- src/sbt-test/debian/jdeb-conflicts/build.sbt | 2 +- .../debian/jdeb-dependencies/build.sbt | 2 +- .../debian/jdeb-dir-mappings/build.sbt | 8 +-- src/sbt-test/debian/jdeb-provides/build.sbt | 2 +- .../debian/jdeb-script-replacements/build.sbt | 4 +- src/sbt-test/debian/log-directory/build.sbt | 4 +- .../debian/native-build-compress/build.sbt | 4 +- .../debian/native-build-default/build.sbt | 2 +- .../debian/override-control-files/build.sbt | 8 +-- .../debian/override-etc-default/build.sbt | 8 +-- .../override-loader-functions/build.sbt | 6 +- .../override-start-script-systemd/build.sbt | 6 +- .../override-start-script-systemv/build.sbt | 6 +- .../override-start-script-upstart/build.sbt | 6 +- src/sbt-test/debian/simple-deb/build.sbt | 8 +-- src/sbt-test/debian/simple-jdeb/build.sbt | 8 +-- src/sbt-test/debian/systemd-deb/build.sbt | 6 +- src/sbt-test/debian/sysvinit-deb/build.sbt | 6 +- .../sysvinit-stoptimeouts-deb/build.sbt | 10 +-- .../test-executableScriptName/build.sbt | 4 +- .../debian/test-mapping-helpers/build.sbt | 6 +- src/sbt-test/debian/test-mapping/build.sbt | 8 +-- .../debian/test-packageName/build.sbt | 8 +-- .../debian/upstart-deb-facilities/build.sbt | 10 +-- src/sbt-test/debian/upstart-deb/build.sbt | 6 +- src/sbt-test/docker/build-command/build.sbt | 2 +- src/sbt-test/docker/envVars/build.sbt | 2 +- src/sbt-test/docker/file-permission/build.sbt | 12 ++-- .../changes/strategy-copychown.sbt | 4 +- .../changes/strategy-none-gid.sbt | 4 +- src/sbt-test/docker/jdk-versions/build.sbt | 2 +- src/sbt-test/docker/labels/build.sbt | 2 +- .../docker/test-busybox-create-user/build.sbt | 8 +-- .../test-executableScriptName/build.sbt | 4 +- .../docker/test-layer-groups/build.sbt | 6 +- .../test-layer-groups/changes/nolayers.sbt | 2 +- .../docker/test-layer-groups/layers.sbt | 6 +- .../test-packageName-universal/build.sbt | 2 +- .../docker/test-packageName/build.sbt | 4 +- src/sbt-test/jar/classpath-jar/build.sbt | 4 +- .../jar/launcher-jar with spaces/build.sbt | 4 +- src/sbt-test/jar/launcher-jar/build.sbt | 4 +- .../jdkpackager/test-package-image/build.sbt | 4 +- .../test-package-mappings/build.sbt | 8 +-- .../test-package-minimal/build.sbt | 4 +- .../jlink/test-jlink-minimal/build.sbt | 4 +- src/sbt-test/jlink/test-jlink-misc/build.sbt | 11 ++- .../jlink/test-jlink-missing-deps/build.sbt | 2 +- src/sbt-test/rpm/config-no-replace/build.sbt | 4 +- .../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 | 2 +- .../scriptlets-override-build-rpm/build.sbt | 2 +- .../rpm/scriptlets-override-rpm/build.sbt | 4 +- src/sbt-test/rpm/scriptlets-rpm/build.sbt | 2 +- src/sbt-test/rpm/setarch-rpm/build.sbt | 6 +- src/sbt-test/rpm/simple-rpm/build.sbt | 6 +- .../rpm/snapshot-override-rpm/build.sbt | 4 +- src/sbt-test/rpm/symlink-rpm/build.sbt | 4 +- src/sbt-test/rpm/systemd-rpm/build.sbt | 4 +- src/sbt-test/rpm/sysvinit-rpm/build.sbt | 6 +- src/sbt-test/rpm/test-artifactPath/build.sbt | 4 +- .../rpm/test-executableScriptName/build.sbt | 2 +- src/sbt-test/rpm/test-packageName/build.sbt | 2 +- .../universal/absolute-path/build.sbt | 6 +- .../build.sbt | 6 +- .../multiproject-classifiers/build.sbt | 8 +-- src/sbt-test/universal/publish/build.sbt | 4 +- .../universal/staging-custom-main/build.sbt | 6 +- .../test-executableScriptName/build.sbt | 2 +- .../universal/test-mapping-helpers/build.sbt | 10 +-- .../universal/test-packageName/build.sbt | 2 +- src/sbt-test/universal/test-zips/build.sbt | 4 +- .../windows/absolute-path-in-bat/build.sbt | 4 +- .../windows/app-home-var-expansion/build.sbt | 2 +- src/sbt-test/windows/custom-wix/build.sbt | 2 +- .../windows/dynamic-app-env-name/build.sbt | 2 +- .../windows/java-app-archetype/build.sbt | 2 +- .../windows/memory-settings/build.sbt | 6 +- src/sbt-test/windows/multiple-apps/build.sbt | 4 +- .../windows/test-bat-template/build.sbt | 2 +- .../windows/test-custom-main/build.sbt | 6 +- src/sphinx/formats/jdkpackager.rst | 2 +- src/sphinx/formats/universal.rst | 4 +- 134 files changed, 520 insertions(+), 525 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 41ca18ecc..bdd2fd60f 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 @@ -92,5 +92,5 @@ object SettingsHelper { * the ivy configuration to look for resolvers */ private def addResolver(config: Configuration): Seq[Setting[_]] = - Seq(otherResolvers ++= (publishTo in config).value.toSeq) + Seq(otherResolvers ++= (config / publishTo).value.toSeq) } diff --git a/src/main/scala/com/typesafe/sbt/PackagerPlugin.scala b/src/main/scala/com/typesafe/sbt/PackagerPlugin.scala index 9465504ca..4a4eec099 100644 --- a/src/main/scala/com/typesafe/sbt/PackagerPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/PackagerPlugin.scala @@ -75,14 +75,14 @@ object SbtNativePackager extends AutoPlugin { @deprecated("Use enablePlugins(xxxDeployPlugin)", "1.x") def deploymentSettings = - makeDeploymentSettings(Debian, packageBin in Debian, "deb") ++ - makeDeploymentSettings(Rpm, packageBin in Rpm, "rpm") ++ - makeDeploymentSettings(Windows, packageBin in Windows, "msi") ++ - makeDeploymentSettings(Universal, packageBin in Universal, "zip") ++ - addPackage(Universal, packageZipTarball in Universal, "tgz") ++ - makeDeploymentSettings(UniversalDocs, packageBin in UniversalDocs, "zip") ++ - addPackage(UniversalDocs, packageXzTarball in UniversalDocs, "txz") ++ - makeDeploymentSettings(Debian, genChanges in Debian, "changes") + makeDeploymentSettings(Debian, Debian / packageBin, "deb") ++ + makeDeploymentSettings(Rpm, Rpm / packageBin, "rpm") ++ + makeDeploymentSettings(Windows, Windows / packageBin, "msi") ++ + makeDeploymentSettings(Universal, Universal / packageBin, "zip") ++ + addPackage(Universal, Universal / packageZipTarball, "tgz") ++ + makeDeploymentSettings(UniversalDocs, UniversalDocs / packageBin, "zip") ++ + addPackage(UniversalDocs, UniversalDocs / packageXzTarball, "txz") ++ + makeDeploymentSettings(Debian, Debian / genChanges, "changes") } import autoImport._ 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 0dcb13aea..163976e53 100644 --- a/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaAppPackaging.scala +++ b/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaAppPackaging.scala @@ -44,31 +44,31 @@ object JavaAppPackaging extends AutoPlugin { override def projectSettings = Seq( - javaOptions in Universal := Nil, + Universal / javaOptions := Nil, // Here we record the classpath as it's added to the mappings separately, so // we can use its order to generate the bash/bat scripts. scriptClasspathOrdering := Nil, - // Note: This is sometimes on the classpath via dependencyClasspath in Runtime. + // Note: This is sometimes on the classpath via Runtime / dependencyClasspath. // We need to figure out why sometimes the Attributed[File] is correctly configured // and sometimes not. scriptClasspathOrdering += { - val jar = (packageBin in Compile).value + val jar = (Compile / packageBin).value val id = projectID.value - val art = (artifact in Compile in packageBin).value + val art = (Compile / packageBin / artifact).value jar -> ("lib/" + makeJarName(id.organization, id.name, id.revision, art.name, art.classifier)) }, projectDependencyArtifacts := findProjectDependencyArtifacts.value, scriptClasspathOrdering ++= universalDepMappings( - (dependencyClasspath in Runtime).value, + (Runtime / dependencyClasspath).value, projectDependencyArtifacts.value ), scriptClasspathOrdering := scriptClasspathOrdering.value.distinct, - mappings in Universal ++= scriptClasspathOrdering.value, + Universal / mappings ++= scriptClasspathOrdering.value, scriptClasspath := makeRelativeClasspathNames(scriptClasspathOrdering.value), - linuxPackageMappings in Debian += { - val name = (packageName in Debian).value + Debian / linuxPackageMappings += { + val name = (Debian / packageName).value val installLocation = defaultLinuxInstallLocation.value - val targetDir = (target in Debian).value + val targetDir = (Debian / target).value // create empty var/log directory val d = targetDir / installLocation d.mkdirs() @@ -153,8 +153,8 @@ object JavaAppPackaging extends AutoPlugin { stateTask.flatMap { state => val extracted = Project.extract(state) // TODO - Is this correct? - val module = extracted.get(projectID in ref) - val artifactTask = extracted.get(packagedArtifacts in ref) + val module = extracted.get(ref / projectID) + val artifactTask = extracted.get(ref / packagedArtifacts) for { arts <- artifactTask } yield for { 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 976d3b39d..f47c805d8 100644 --- a/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaServerApplication.scala +++ b/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaServerApplication.scala @@ -50,23 +50,23 @@ object JavaServerAppPackaging extends AutoPlugin { */ def linuxSettings: Seq[Setting[_]] = Seq( - javaOptions in Linux := (javaOptions in Universal).value, + Linux / javaOptions := (Universal / javaOptions).value, // === logging directory mapping === linuxPackageMappings += { - packageTemplateMapping(defaultLinuxLogsLocation.value + "/" + (packageName in Linux).value)() - .withUser((daemonUser in Linux).value) - .withGroup((daemonGroup in Linux).value) + packageTemplateMapping(defaultLinuxLogsLocation.value + "/" + (Linux / packageName).value)() + .withUser((Linux / daemonUser).value) + .withGroup((Linux / daemonGroup).value) .withPerms("755") }, linuxPackageSymlinks += { - val name = (packageName in Linux).value + val name = (Linux / packageName).value LinuxSymlink( defaultLinuxInstallLocation.value + "/" + name + "/logs", defaultLinuxLogsLocation.value + "/" + name ) }, // === etc config mapping === - bashScriptEnvConfigLocation := Some("/etc/default/" + (packageName in Linux).value), + bashScriptEnvConfigLocation := Some("/etc/default/" + (Linux / packageName).value), linuxStartScriptName := None, daemonStdoutLogFile := None ) @@ -78,7 +78,7 @@ object JavaServerAppPackaging extends AutoPlugin { linuxEtcDefaultTemplate := getEtcTemplateSource(sourceDirectory.value, (serverLoading ?? None).value), makeEtcDefault := makeEtcDefaultScript( packageName.value, - (target in Universal).value, + (Universal / target).value, linuxEtcDefaultTemplate.value, linuxScriptReplacements.value ), @@ -95,8 +95,8 @@ object JavaServerAppPackaging extends AutoPlugin { linuxScriptReplacements += Names.DaemonStdoutLogFileReplacement -> daemonStdoutLogFile.value.getOrElse(""), // === Maintainer scripts === maintainerScripts := { - val scripts = (maintainerScripts in Debian).value - val replacements = (linuxScriptReplacements in Debian).value + val scripts = (Debian / maintainerScripts).value + val replacements = (Debian / linuxScriptReplacements).value val contentOf = getScriptContent(Debian, replacements) _ scripts ++ Map( @@ -109,10 +109,10 @@ object JavaServerAppPackaging extends AutoPlugin { ) ) ++ Seq( // === Daemon User and Group === - daemonUser in Debian := (daemonUser in Linux).value, - daemonUserUid in Debian := (daemonUserUid in Linux).value, - daemonGroup in Debian := (daemonGroup in Linux).value, - daemonGroupGid in Debian := (daemonGroupGid in Linux).value + Debian / daemonUser := (Linux / daemonUser).value, + Debian / daemonUserUid := (Linux / daemonUserUid).value, + Debian / daemonGroup := (Linux / daemonGroup).value, + Debian / daemonGroupGid := (Linux / daemonGroupGid).value ) } @@ -133,15 +133,15 @@ object JavaServerAppPackaging extends AutoPlugin { ) ) ++ Seq( // === Daemon User and Group === - daemonUser in Rpm := (daemonUser in Linux).value, - daemonUserUid in Rpm := (daemonUserUid in Linux).value, - daemonGroup in Rpm := (daemonGroup in Linux).value, - daemonGroupGid in Rpm := (daemonGroupGid in Linux).value, + Rpm / daemonUser := (Linux / daemonUser).value, + Rpm / daemonUserUid := (Linux / daemonUserUid).value, + Rpm / daemonGroup := (Linux / daemonGroup).value, + Rpm / daemonGroupGid := (Linux / daemonGroupGid).value, // == Maintainer scripts === - maintainerScripts in Rpm := rpmScriptletContents( + Rpm / maintainerScripts := rpmScriptletContents( rpmScriptsDirectory.value, - (maintainerScripts in Rpm).value, - (linuxScriptReplacements in Rpm).value + (Rpm / maintainerScripts).value, + (Rpm / linuxScriptReplacements).value ) ) @@ -209,7 +209,7 @@ object JavaServerAppPackaging extends AutoPlugin { * @param name * of the etc-default config file * @param tmpDir - * to store the resulting file in (e.g. target in Universal) + * to store the resulting file in (e.g. Universal / target) * @param source * of etc-default script * @param replacements diff --git a/src/main/scala/com/typesafe/sbt/packager/archetypes/MaintainerScriptHelper.scala b/src/main/scala/com/typesafe/sbt/packager/archetypes/MaintainerScriptHelper.scala index 63d11580f..61cc3f82b 100644 --- a/src/main/scala/com/typesafe/sbt/packager/archetypes/MaintainerScriptHelper.scala +++ b/src/main/scala/com/typesafe/sbt/packager/archetypes/MaintainerScriptHelper.scala @@ -16,7 +16,7 @@ trait MaintainerScriptHelper { * @example * {{{ * import DebianConstants._ - * maintainerScripts in Debian := maintainerScriptsFromDirectory( + * Debian / maintainerScripts := maintainerScriptsFromDirectory( * sourceDirectory.value / DebianSource / DebianMaintainerScripts, Seq(Preinst, Postinst, Prerm, Postrm) * ) * }}} @@ -43,9 +43,9 @@ trait MaintainerScriptHelper { * Adding content from a string * {{{ * import RpmConstants._ - * maintainerScripts in Rpm := maintainerScriptsAppend((maintainerScripts in Rpm).value)( + * Rpm / maintainerScripts := maintainerScriptsAppend((Rpm / maintainerScripts).value)( * Pretrans -> "echo 'hello, world'", - * Post -> "echo 'installing " + (packageName in Rpm).value + "'" + * Post -> "echo 'installing " + (Rpm / packageName).value + "'" * ) * }}} * @@ -53,19 +53,19 @@ trait MaintainerScriptHelper { * Adding content from a string and use script replacements * {{{ * import DebianConstants._ - * maintainerScripts in Rpm := maintainerScriptsAppend( - * (maintainerScripts in Debian).value, - * (linuxScriptReplacements in Debian).value + * Rpm / maintainerScripts := maintainerScriptsAppend( + * (Debian / maintainerScripts).value, + * (Debian / linuxScriptReplacements).value * )( * Preinst -> "echo 'hello, world'", - * Postinst -> s"echo 'installing ${(packageName in Debian).value}'" + * Postinst -> s"echo 'installing ${(Debian packageName).value}'" * ) * }}} * * @param current * maintainer scripts * @param replacements - * (e.g. (linuxScriptReplacements in Debian).value) + * (e.g. (Debian / linuxScriptReplacements).value) * @param scripts * scriptName -> scriptContent pairs * @return @@ -90,7 +90,7 @@ trait MaintainerScriptHelper { * Adding content from a string * {{{ * import RpmConstants._ - * maintainerScripts in Rpm := maintainerScriptsAppendFromFile((maintainerScripts in Rpm).value)( + * Rpm / maintainerScripts := maintainerScriptsAppendFromFile((Rpm / maintainerScripts).value)( * Pretrans -> (sourceDirectory.value / "rpm" / "pretrans"), * Post -> (sourceDirectory.value / "rpm" / "posttrans") * ) diff --git a/src/main/scala/com/typesafe/sbt/packager/archetypes/scripts/ApplicationIniGenerator.scala b/src/main/scala/com/typesafe/sbt/packager/archetypes/scripts/ApplicationIniGenerator.scala index 04b57d8f3..4c00aacab 100644 --- a/src/main/scala/com/typesafe/sbt/packager/archetypes/scripts/ApplicationIniGenerator.scala +++ b/src/main/scala/com/typesafe/sbt/packager/archetypes/scripts/ApplicationIniGenerator.scala @@ -35,7 +35,7 @@ trait ApplicationIniGenerator { // TODO: merge JVM options into the existing application.ini? log.warn("--------!!! JVM Options are defined twice !!!-----------") log.warn( - "application.ini is already present in output package. Will be overridden by 'javaOptions in Universal'" + "application.ini is already present in output package. Will be overridden by 'Universal / javaOptions'" ) false 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 9d0cd0af6..e33a96f25 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 @@ -82,7 +82,7 @@ object AshScriptPlugin extends AutoPlugin { bashScriptTemplateLocation := (sourceDirectory.value / "templates" / ashTemplate), bashForwarderTemplateLocation := Some(sourceDirectory.value / "templates" / ashForwarderTemplate), bashScriptDefines := Defines( - (scriptClasspath in bashScriptDefines).value, + (bashScriptDefines / scriptClasspath).value, bashScriptConfigLocation.value, bundledJvmLocation.value ), 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 2b6aaa8d7..1e74a29b3 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 @@ -59,7 +59,7 @@ object BashStartScriptPlugin extends AutoPlugin with ApplicationIniGenerator wit bashForwarderTemplateLocation := Some(sourceDirectory.value / "templates" / forwarderTemplateName), bashScriptExtraDefines := Nil, bashScriptDefines := Defines( - (scriptClasspath in bashScriptDefines).value, + (bashScriptDefines / scriptClasspath).value, bashScriptConfigLocation.value, bundledJvmLocation.value ), @@ -69,27 +69,27 @@ object BashStartScriptPlugin extends AutoPlugin with ApplicationIniGenerator wit bashScriptConfigLocation := (bashScriptConfigLocation ?? Some(appIniLocation)).value, bashScriptEnvConfigLocation := (bashScriptEnvConfigLocation ?? None).value, // Generating the application configuration - mappings in Universal := generateApplicationIni( - (mappings in Universal).value, - (javaOptions in Universal).value, + Universal / mappings := generateApplicationIni( + (Universal / mappings).value, + (Universal / javaOptions).value, bashScriptConfigLocation.value, - (target in Universal).value, + (Universal / target).value, streams.value.log ), makeBashScripts := generateStartScripts( BashScriptConfig( executableScriptName = executableScriptName.value, - scriptClasspath = (scriptClasspath in bashScriptDefines).value, + scriptClasspath = (bashScriptDefines / scriptClasspath).value, replacements = bashScriptReplacements.value, templateLocation = bashScriptTemplateLocation.value, forwarderTemplateLocation = bashForwarderTemplateLocation.value ), - (mainClass in (Compile, bashScriptDefines)).value, - (discoveredMainClasses in Compile).value, - (target in Universal).value / "scripts", + (Compile / bashScriptDefines / mainClass).value, + (Compile / discoveredMainClasses).value, + (Universal / target).value / "scripts", streams.value.log ), - mappings in Universal ++= makeBashScripts.value + Universal / mappings ++= makeBashScripts.value ) private[this] def generateScriptReplacements(defines: Seq[String]): Seq[(String, String)] = { diff --git a/src/main/scala/com/typesafe/sbt/packager/archetypes/scripts/BatStartScriptPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/archetypes/scripts/BatStartScriptPlugin.scala index 3904a1550..09f8fa629 100644 --- a/src/main/scala/com/typesafe/sbt/packager/archetypes/scripts/BatStartScriptPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/archetypes/scripts/BatStartScriptPlugin.scala @@ -134,17 +134,17 @@ object BatStartScriptPlugin extends AutoPlugin with ApplicationIniGenerator with batScriptExtraDefines := Nil, batScriptReplacements := Replacements(executableScriptName.value), // Generating the application configuration - mappings in Universal := generateApplicationIni( - (mappings in Universal).value, - (javaOptions in Universal).value, + Universal / mappings := generateApplicationIni( + (Universal / mappings).value, + (Universal / javaOptions).value, batScriptConfigLocation.value, - (target in Universal).value, + (Universal / target).value, streams.value.log ), makeBatScripts := generateStartScripts( BatScriptConfig( executableScriptName = executableScriptName.value, - scriptClasspath = (scriptClasspath in batScriptReplacements).value, + scriptClasspath = (batScriptReplacements / scriptClasspath).value, configLocation = batScriptConfigLocation.value, extraDefines = batScriptExtraDefines.value, replacements = batScriptReplacements.value, @@ -152,12 +152,12 @@ object BatStartScriptPlugin extends AutoPlugin with ApplicationIniGenerator with bundledJvmLocation = bundledJvmLocation.value, forwarderTemplateLocation = batForwarderTemplateLocation.value ), - (mainClass in (Compile, batScriptReplacements)).value, - (discoveredMainClasses in Compile).value, - (target in Universal).value / "scripts", + (Compile / batScriptReplacements / mainClass).value, + (Compile / discoveredMainClasses).value, + (Universal / target).value / "scripts", streams.value.log ), - mappings in Universal ++= makeBatScripts.value + Universal / mappings ++= makeBatScripts.value ) /** diff --git a/src/main/scala/com/typesafe/sbt/packager/archetypes/scripts/StartScriptMainClassConfig.scala b/src/main/scala/com/typesafe/sbt/packager/archetypes/scripts/StartScriptMainClassConfig.scala index c09dec9f8..2d39021f3 100644 --- a/src/main/scala/com/typesafe/sbt/packager/archetypes/scripts/StartScriptMainClassConfig.scala +++ b/src/main/scala/com/typesafe/sbt/packager/archetypes/scripts/StartScriptMainClassConfig.scala @@ -40,9 +40,9 @@ object StartScriptMainClassConfig { /** * @param mainClass - * optional main class, e.g. from (mainClass in Compile).value + * optional main class, e.g. from (Compile / mainClass).value * @param discoveredMainClasses - * all discovered main classes, e.g. from (discoveredMainClasses in Compile).value + * all discovered main classes, e.g. from (Compile / discoveredMainClasses).value * @return * A start script configuration */ diff --git a/src/main/scala/com/typesafe/sbt/packager/archetypes/systemloader/SystemloaderPlugin.scala b/src/main/scala/com/typesafe/sbt/packager/archetypes/systemloader/SystemloaderPlugin.scala index b689ec5d8..61a84ac8c 100644 --- a/src/main/scala/com/typesafe/sbt/packager/archetypes/systemloader/SystemloaderPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/archetypes/systemloader/SystemloaderPlugin.scala @@ -76,7 +76,7 @@ object SystemloaderPlugin extends AutoPlugin { linuxMakeStartScript := makeStartScript( linuxStartScriptTemplate.value, linuxScriptReplacements.value, - (target in Universal).value, + (Universal / target).value, defaultLinuxStartScriptLocation.value, linuxStartScriptName.value.getOrElse(sys.error("`linuxStartScriptName` is not defined")) ) @@ -111,7 +111,7 @@ object SystemloaderPlugin extends AutoPlugin { inConfig(Rpm)( Seq( // add automatic service start/stop - maintainerScripts in Rpm := maintainerScriptsAppend(maintainerScripts.value, linuxScriptReplacements.value)( + Rpm / maintainerScripts := maintainerScriptsAppend(maintainerScripts.value, linuxScriptReplacements.value)( RpmConstants.Post -> s"""|# ${getOrUnsupported(serverLoading.value)} support |$${{loader-functions}} |# Scriptlet syntax: http://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Syntax diff --git a/src/main/scala/com/typesafe/sbt/packager/archetypes/systemloader/package.scala b/src/main/scala/com/typesafe/sbt/packager/archetypes/systemloader/package.scala index c29b248e6..5c94ae8b6 100644 --- a/src/main/scala/com/typesafe/sbt/packager/archetypes/systemloader/package.scala +++ b/src/main/scala/com/typesafe/sbt/packager/archetypes/systemloader/package.scala @@ -67,7 +67,7 @@ package object systemloader { ): Seq[LinuxPackageMapping] = { val name = scriptName.getOrElse( sys.error( - """No linuxStartScriptName defined. Add `linuxStartScriptName in := Some("name.service")""" + """No linuxStartScriptName defined. Add ` / linuxStartScriptName := Some("name.service")""" ) ) val path = location + "/" + name 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 5eb450fee..445f4e7d9 100644 --- a/src/main/scala/com/typesafe/sbt/packager/debian/DebianNativePackaging.scala +++ b/src/main/scala/com/typesafe/sbt/packager/debian/DebianNativePackaging.scala @@ -90,7 +90,7 @@ trait DebianNativePackaging extends DebianPluginLike { IO.writeLines(changesFile, allChanges) } catch { case e: Exception => - sys.error("Failure generating changes file." + e.getStackTraceString) + throw new RuntimeException("Failure generating changes file.", e) } changesFile } 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 2d3d0f6db..de4760bb1 100644 --- a/src/main/scala/com/typesafe/sbt/packager/debian/DebianPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/debian/DebianPlugin.scala @@ -81,23 +81,23 @@ object DebianPlugin extends AutoPlugin with DebianNativePackaging { debianPackageProvides := Seq.empty, debianPackageRecommends := Seq.empty, debianSignRole := "builder", - target in Debian := target.value / ((name in Debian).value + "-" + (version in Debian).value), - name in Debian := (name in Linux).value, - maintainerScripts in Debian := (maintainerScripts in Linux).value, - packageName in Debian := (packageName in Linux).value, - executableScriptName in Debian := (executableScriptName in Linux).value, - version in Debian := (version in Linux).value, - linuxPackageMappings in Debian := linuxPackageMappings.value, - packageDescription in Debian := (packageDescription in Linux).value, - packageSummary in Debian := (packageSummary in Linux).value, - maintainer in Debian := (maintainer in Linux).value, - validatePackageValidators in Debian := Seq( - nonEmptyMappings((linuxPackageMappings in Debian).value.flatMap(_.mappings)), - filesExist((linuxPackageMappings in Debian).value.flatMap(_.mappings)), - checkMaintainer((maintainer in Debian).value, asWarning = false) + Debian / target := target.value / ((Debian / name).value + "-" + (Debian / version).value), + Debian / name := (Linux / name).value, + Debian / maintainerScripts := (Linux / maintainerScripts).value, + Debian / packageName := (Linux / packageName).value, + Debian / executableScriptName := (Linux / executableScriptName).value, + Debian / version := (Linux / version).value, + Debian / linuxPackageMappings := linuxPackageMappings.value, + Debian / packageDescription := (Linux / packageDescription).value, + Debian / packageSummary := (Linux / packageSummary).value, + Debian / maintainer := (Linux / maintainer).value, + Debian / validatePackageValidators := Seq( + nonEmptyMappings((Debian / linuxPackageMappings).value.flatMap(_.mappings)), + filesExist((Debian / linuxPackageMappings).value.flatMap(_.mappings)), + checkMaintainer((Debian / maintainer).value, asWarning = false) ), // override the linux sourceDirectory setting - sourceDirectory in Debian := sourceDirectory.value, + Debian / sourceDirectory := sourceDirectory.value, /* ==== Debian configuration settings ==== */ debianControlScriptsDirectory := (sourceDirectory.value / "debian" / Names.DebianMaintainerScripts), debianMaintainerScripts := Seq.empty, @@ -107,8 +107,8 @@ object DebianPlugin extends AutoPlugin with DebianNativePackaging { debianMakePostrmScript := None, debianChangelog := None, /* === new debian scripts implementation */ - maintainerScripts in Debian := { - val replacements = (linuxScriptReplacements in Debian).value + Debian / maintainerScripts := { + val replacements = (Debian / linuxScriptReplacements).value val scripts = Map( Names.Prerm -> defaultMaintainerScript(Names.Prerm).toSeq.flatten, Names.Preinst -> defaultMaintainerScript(Names.Preinst).toSeq.flatten, @@ -157,9 +157,9 @@ object DebianPlugin extends AutoPlugin with DebianNativePackaging { } }, debianMaintainerScripts := generateDebianMaintainerScripts( - (maintainerScripts in Debian).value, - (linuxScriptReplacements in Debian).value, - (target in Universal).value + (Debian / maintainerScripts).value, + (Debian / linuxScriptReplacements).value, + (Universal / target).value ), debianNativeBuildOptions := Nil ) @@ -229,8 +229,8 @@ object DebianPlugin extends AutoPlugin with DebianNativePackaging { private[this] def createConfFile(meta: PackageMetaData, size: Long, targetDir: File): File = { val description = Option(meta.info.description).filterNot(_.isEmpty) if (description.isEmpty) - sys.error("""packageDescription in Debian cannot be empty. Use - packageDescription in Debian := "My package Description"""") + sys.error("""Debian / packageDescription cannot be empty. Use + Debian / packageDescription := "My package Description"""") val cfile = targetDir / Names.DebianMaintainerScripts / Names.Control IO.write(cfile, meta.makeContent(size), java.nio.charset.Charset.defaultCharset) chmod(cfile, "0644") @@ -468,6 +468,6 @@ object DebianDeployPlugin extends AutoPlugin { override def requires = DebianPlugin override def projectSettings: Seq[Setting[_]] = - SettingsHelper.makeDeploymentSettings(Debian, packageBin in Debian, "deb") ++ - SettingsHelper.addPackage(Debian, genChanges in Debian, "changes") + SettingsHelper.makeDeploymentSettings(Debian, Debian / packageBin, "deb") ++ + SettingsHelper.addPackage(Debian, Debian / genChanges, "changes") } 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 abf8f9d9f..14664691d 100644 --- a/src/main/scala/com/typesafe/sbt/packager/debian/JDebPackaging.scala +++ b/src/main/scala/com/typesafe/sbt/packager/debian/JDebPackaging.scala @@ -48,8 +48,8 @@ object JDebPackaging extends AutoPlugin with DebianPluginLike { val data = debianPackageMetadata.value val size = debianPackageInstallSize.value if (data.info.description == null || data.info.description.isEmpty) - sys.error("""packageDescription in Debian cannot be empty. Use - packageDescription in Debian := "My package Description"""") + sys.error("""Debian / packageDescription cannot be empty. Use + Debian / packageDescription := "My package Description"""") val cfile = target.value / Names.DebianMaintainerScripts / Names.Control IO.write(cfile, data.makeContent(size), java.nio.charset.Charset.defaultCharset) cfile 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 9c16652ab..7175085bd 100644 --- a/src/main/scala/com/typesafe/sbt/packager/docker/DockerPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/docker/DockerPlugin.scala @@ -625,7 +625,7 @@ object DockerPlugin extends AutoPlugin { } /** - * uses the `mappings in Universal` to generate the `Docker / mappings`. + * uses the `Universal / mappings` to generate the `Docker / mappings`. */ def mapGenericFilesToDocker: Seq[Setting[_]] = { def renameDests(from: Seq[(File, String)], dest: String) = @@ -635,7 +635,7 @@ object DockerPlugin extends AutoPlugin { newPath = "%s/%s" format (dest, pathWithValidSeparator) } yield (f, newPath) - inConfig(Docker)(Seq(mappings := renameDests((mappings in Universal).value, defaultLinuxInstallLocation.value))) + inConfig(Docker)(Seq(mappings := renameDests((Universal / mappings).value, defaultLinuxInstallLocation.value))) } private final def pathInLayer(path: String, layer: Option[Int]) = layer.map(i => s"/$i$path").getOrElse(path) diff --git a/src/main/scala/com/typesafe/sbt/packager/graalvmnativeimage/GraalVMNativeImagePlugin.scala b/src/main/scala/com/typesafe/sbt/packager/graalvmnativeimage/GraalVMNativeImagePlugin.scala index 41f196c89..e1ddbf3db 100644 --- a/src/main/scala/com/typesafe/sbt/packager/graalvmnativeimage/GraalVMNativeImagePlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/graalvmnativeimage/GraalVMNativeImagePlugin.scala @@ -35,12 +35,12 @@ object GraalVMNativeImagePlugin extends AutoPlugin { override def projectConfigurations: Seq[Configuration] = Seq(GraalVMNativeImage) override lazy val projectSettings: Seq[Setting[_]] = Seq( - target in GraalVMNativeImage := target.value / "graalvm-native-image", + GraalVMNativeImage / target := target.value / "graalvm-native-image", graalVMNativeImageOptions := Seq.empty, graalVMNativeImageGraalVersion := None, graalVMNativeImageCommand := (if (scala.util.Properties.isWin) "native-image.cmd" else "native-image"), - resourceDirectory in GraalVMNativeImage := sourceDirectory.value / "graal", - mainClass in GraalVMNativeImage := (mainClass in Compile).value + GraalVMNativeImage / resourceDirectory := sourceDirectory.value / "graal", + GraalVMNativeImage / mainClass := (Compile / mainClass).value ) ++ inConfig(GraalVMNativeImage)(scopedSettings) private lazy val scopedSettings = Seq[Setting[_]]( @@ -167,14 +167,14 @@ object GraalVMNativeImagePlugin extends AutoPlugin { * This can be used to build a custom build image starting from a custom base image. Can be used like so: * * ``` - * (containerBuildImage in GraalVMNativeImage) := generateContainerBuildImage("my-docker-hub-username/my-graalvm").value + * GraalVMNativeImage / containerBuildImage := generateContainerBuildImage("my-docker-hub-username/my-graalvm").value * ``` * * The passed in docker image must have GraalVM installed and on the PATH, including the gu utility. */ def generateContainerBuildImage(baseImage: String): Def.Initialize[Task[Option[String]]] = Def.task { - val dockerCommand = (DockerPlugin.autoImport.dockerExecCommand in GraalVMNativeImage).value + val dockerCommand = (GraalVMNativeImage / DockerPlugin.autoImport.dockerExecCommand).value val streams = Keys.streams.value val (baseName, tag) = baseImage.split(":", 2) match { 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 26aba10dd..7185aae56 100644 --- a/src/main/scala/com/typesafe/sbt/packager/jar/ClasspathJarPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/jar/ClasspathJarPlugin.scala @@ -23,21 +23,21 @@ 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 := { - val classpath = (scriptClasspath in packageJavaClasspathJar).value + .packageTaskSettings(packageJavaClasspathJar, packageJavaClasspathJar / mappings) ++ Seq( + packageJavaClasspathJar / mappings := Nil, + packageJavaClasspathJar / artifactClassifier := Option("classpath"), + packageJavaClasspathJar / packageOptions := { + val classpath = (packageJavaClasspathJar / scriptClasspath).value val manifestClasspath = Attributes.Name.CLASS_PATH -> classpath.mkString(" ") Seq(ManifestAttributes(manifestClasspath)) }, - artifactName in packageJavaClasspathJar := { (scalaVersion, moduleId, artifact) => + packageJavaClasspathJar / artifactName := { (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 += { + bashScriptDefines / scriptClasspath := Seq((packageJavaClasspathJar / artifactPath).value.getName), + batScriptReplacements / scriptClasspath := Seq((packageJavaClasspathJar / artifactPath).value.getName), + Universal / mappings += { 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 11a528974..ae32b4471 100644 --- a/src/main/scala/com/typesafe/sbt/packager/jar/LauncherJarPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/jar/LauncherJarPlugin.scala @@ -24,29 +24,29 @@ 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 := { - val classpath = (scriptClasspath in packageJavaLauncherJar).value + .packageTaskSettings(packageJavaLauncherJar, packageJavaLauncherJar / mappings) ++ Seq( + packageJavaLauncherJar / mappings := Nil, + packageJavaLauncherJar / artifactClassifier := Option("launcher"), + packageJavaLauncherJar / packageOptions := { + val classpath = (packageJavaLauncherJar / scriptClasspath).value val manifestClasspath = Attributes.Name.CLASS_PATH -> classpath.mkString(" ") val manifestMainClass = - (mainClass in (Compile, packageJavaLauncherJar)).value.map(Attributes.Name.MAIN_CLASS -> _) + (Compile / packageJavaLauncherJar / mainClass).value.map(Attributes.Name.MAIN_CLASS -> _) Seq(ManifestAttributes(manifestMainClass.toSeq :+ manifestClasspath: _*)) }, - artifactName in packageJavaLauncherJar := { (scalaVersion, moduleId, artifact) => + packageJavaLauncherJar / artifactName := { (scalaVersion, moduleId, artifact) => moduleId.organization + "." + artifact.name + "-" + moduleId.revision + artifact.classifier.fold("")("-" + _) + "." + artifact.extension }, - mainClass in (Compile, bashScriptDefines) := { - Some(s"""-jar "$$lib_dir/${(artifactPath in packageJavaLauncherJar).value.getName}"""") + Compile / bashScriptDefines / mainClass := { + Some(s"""-jar "$$lib_dir/${(packageJavaLauncherJar / artifactPath).value.getName}"""") }, - scriptClasspath in bashScriptDefines := Nil, - mainClass in (Compile, batScriptReplacements) := { - Some(s"""-jar "%APP_LIB_DIR%\\${(artifactPath in packageJavaLauncherJar).value.getName}"""") + bashScriptDefines / scriptClasspath := Nil, + Compile / batScriptReplacements / mainClass := { + Some(s"""-jar "%APP_LIB_DIR%\\${(packageJavaLauncherJar / artifactPath).value.getName}"""") }, - scriptClasspath in batScriptReplacements := Nil, - mappings in Universal += { + batScriptReplacements / scriptClasspath := Nil, + Universal / mappings += { val javaLauncher = packageJavaLauncherJar.value javaLauncher -> ("lib/" + javaLauncher.getName) } 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 9bdca3938..e4e19941e 100644 --- a/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerAntHelper.scala +++ b/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerAntHelper.scala @@ -184,9 +184,9 @@ object JDKPackagerAntHelper { if (antTaskLib.isEmpty) sys.error( - "Please set key `antPackagerTasks in JDKPackager` to `ant-javafx.jar` path, " + + "Please set key `JDKPackager / antPackagerTasks` to `ant-javafx.jar` path, " + "which should be found in the `lib` directory of the Oracle JDK 8 installation. For example (Windows):\n" + - """(antPackagerTasks in JDKPackager) := Some(file("C:\\Program Files\\Java\\jdk1.8.0_45\\lib\\ant-javafx.jar"))""" + """JDKPackager / antPackagerTasks := Some(file("C:\\Program Files\\Java\\jdk1.8.0_45\\lib\\ant-javafx.jar"))""" ) val taskClassPath = antTaskLib.get +: antExtraClasspath 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 9c9b51e17..635020576 100644 --- a/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/jdkpackager/JDKPackagerPlugin.scala @@ -46,27 +46,27 @@ object JDKPackagerPlugin extends AutoPlugin { Seq( sourceDirectory := sourceDirectory.value / "deploy", target := target.value / dirname, - mainClass := (mainClass in Runtime).value, + mainClass := (Runtime / mainClass).value, name := name.value, packageName := packageName.value, maintainer := maintainer.value, packageSummary := packageSummary.value, packageDescription := packageDescription.value, - mappings := (mappings in Universal).value, + mappings := (Universal / mappings).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, + (Universal / stage).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, + (LauncherJarPlugin.autoImport.packageJavaLauncherJar / artifactPath).value, target.value, infoDOM( name.value, @@ -90,5 +90,5 @@ object JDKPackagerDeployPlugin extends AutoPlugin { override def requires = JDKPackagerPlugin override def projectSettings: Seq[Setting[_]] = - SettingsHelper.makeDeploymentSettings(JDKPackager, packageBin in JDKPackager, "jdkPackager") + SettingsHelper.makeDeploymentSettings(JDKPackager, JDKPackager / packageBin, "jdkPackager") } 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 3179943f9..44a5d4d3e 100644 --- a/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/linux/LinuxPlugin.scala @@ -47,28 +47,28 @@ object LinuxPlugin extends AutoPlugin { Seq( linuxPackageMappings := Seq.empty, linuxPackageSymlinks := Seq.empty, - sourceDirectory in Linux := sourceDirectory.value / "linux", + Linux / sourceDirectory := sourceDirectory.value / "linux", generateManPages := { val log = streams.value.log - for (file <- ((sourceDirectory in Linux).value / "usr/share/man/man1" ** "*.1").get) { + for (file <- ((Linux / sourceDirectory).value / "usr/share/man/man1" ** "*.1").get) { val man = makeMan(file) log.info("Generated man page for[" + file + "] =") log.info(man) } }, - packageSummary in Linux := packageSummary.value, - packageDescription in Linux := packageDescription.value, - name in Linux := name.value, - packageName in Linux := packageName.value, - executableScriptName in Linux := executableScriptName.value, - daemonUser := (packageName in Linux).value, - daemonUser in Linux := daemonUser.value, - daemonUserUid in Linux := None, - daemonGroup := (daemonUser in Linux).value, - daemonGroup in Linux := daemonGroup.value, - daemonGroupGid in Linux := None, - daemonShell in Linux := "/bin/false", - daemonHome in Linux := s"/var/lib/${(daemonUser in Linux).value}", + Linux / packageSummary := packageSummary.value, + Linux / packageDescription := packageDescription.value, + Linux / name := name.value, + Linux / packageName := packageName.value, + Linux / executableScriptName := executableScriptName.value, + daemonUser := (Linux / packageName).value, + Linux / daemonUser := daemonUser.value, + Linux / daemonUserUid := None, + daemonGroup := (Linux / daemonUser).value, + Linux / daemonGroup := daemonGroup.value, + Linux / daemonGroupGid := None, + Linux / daemonShell := "/bin/false", + Linux / daemonHome := s"/var/lib/${(Linux / daemonUser).value}", defaultLinuxInstallLocation := "/usr/share", defaultLinuxLogsLocation := "/var/log", defaultLinuxConfigLocation := "/etc", @@ -82,23 +82,23 @@ object LinuxPlugin extends AutoPlugin { killTimeout := 10, // Default linux bashscript replacements linuxScriptReplacements := makeReplacements( - author = (maintainer in Linux).value, - description = (packageSummary in Linux).value, - execScript = (executableScriptName in Linux).value, - chdir = chdir(defaultLinuxInstallLocation.value, (packageName in Linux).value), + author = (Linux / maintainer).value, + description = (Linux / packageSummary).value, + execScript = (Linux / executableScriptName).value, + chdir = chdir(defaultLinuxInstallLocation.value, (Linux / packageName).value), logdir = defaultLinuxLogsLocation.value, - appName = (packageName in Linux).value, + appName = (Linux / packageName).value, version = sbt.Keys.version.value, - daemonUser = (daemonUser in Linux).value, - daemonUserUid = (daemonUserUid in Linux).value, - daemonGroup = (daemonGroup in Linux).value, - daemonGroupGid = (daemonGroupGid in Linux).value, - daemonShell = (daemonShell in Linux).value, - daemonHome = (daemonHome in Linux).value, - fileDescriptorLimit = (fileDescriptorLimit in Linux).value + daemonUser = (Linux / daemonUser).value, + daemonUserUid = (Linux / daemonUserUid).value, + daemonGroup = (Linux / daemonGroup).value, + daemonGroupGid = (Linux / daemonGroupGid).value, + daemonShell = (Linux / daemonShell).value, + daemonHome = (Linux / daemonHome).value, + fileDescriptorLimit = (Linux / fileDescriptorLimit).value ), linuxScriptReplacements += controlScriptFunctionsReplacement( /* Add key for control-functions */ ), - maintainerScripts in Linux := Map.empty + Linux / maintainerScripts := Map.empty ) /** @@ -108,22 +108,22 @@ object LinuxPlugin extends AutoPlugin { Seq( // First we look at the src/linux files linuxPackageMappings ++= { - val linuxContent = MappingsHelper.contentOf((sourceDirectory in Linux).value) + val linuxContent = MappingsHelper.contentOf((Linux / sourceDirectory).value) if (linuxContent.isEmpty) Seq.empty else mapGenericMappingsToLinux(linuxContent, Users.Root, Users.Root)(identity) }, // Now we look at the src/universal files. linuxPackageMappings ++= getUniversalFolderMappings( - (packageName in Linux).value, + (Linux / packageName).value, defaultLinuxInstallLocation.value, - (mappings in Universal).value + (Universal / mappings).value ), // Now we generate symlinks. linuxPackageSymlinks ++= { val installLocation = defaultLinuxInstallLocation.value - val linuxPackageName = (packageName in Linux).value + val linuxPackageName = (Linux / packageName).value for { - (file, name) <- (mappings in Universal).value + (file, name) <- (Universal / mappings).value if !file.isDirectory if name startsWith "bin/" if !(name endsWith ".bat") // IGNORE windows-y things. @@ -131,11 +131,11 @@ object LinuxPlugin extends AutoPlugin { }, // Map configuration files linuxPackageSymlinks ++= { - val linuxPackageName = (packageName in Linux).value + val linuxPackageName = (Linux / packageName).value val installLocation = defaultLinuxInstallLocation.value val configLocation = defaultLinuxConfigLocation.value val needsConfLink = - (mappings in Universal).value exists { case (file, destination) => + (Universal / mappings).value exists { case (file, destination) => (destination startsWith "conf/") && !file.isDirectory } if (needsConfLink) 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 a34be5f7e..169f11214 100644 --- a/src/main/scala/com/typesafe/sbt/packager/rpm/RpmMetadata.scala +++ b/src/main/scala/com/typesafe/sbt/packager/rpm/RpmMetadata.scala @@ -152,14 +152,14 @@ case class RpmSpec( // format: off val emptyValidators = Seq( - ensureOr(meta.name, "`name in Rpm` is empty. Please provide one.", isNonEmpty), - ensureOr(meta.version, "`version in Rpm` is empty. Please provide a valid version for the rpm SPEC.", isNonEmpty), + ensureOr(meta.name, "`Rpm / name` is empty. Please provide one.", isNonEmpty), + ensureOr(meta.version, "`Rpm / version` is empty. Please provide a valid version for the rpm SPEC.", isNonEmpty), ensureOr(meta.release, "`rpmRelease` is empty. Please provide a valid release number for the rpm SPEC.", isNonEmpty), - ensureOr(meta.arch, "`packageArchitecture in Rpm` is empty. Please provide a valid architecture for the rpm SPEC.", isNonEmpty), + ensureOr(meta.arch, "`Rpm / packageArchitecture` is empty. Please provide a valid architecture for the rpm SPEC.", isNonEmpty), ensureOr(meta.vendor, "`rpmVendor` is empty. Please provide a valid vendor for the rpm SPEC.", isNonEmpty), ensureOr(meta.os, "`rpmOs` is empty. Please provide a valid os value for the rpm SPEC.", isNonEmpty), - ensureOr(meta.summary, "`packageSummary in Rpm` is empty. Please provide a valid summary for the rpm SPEC.", isNonEmpty), - ensureOr(meta.description, "`packageDescription in Rpm` is empty. Please provide a valid description for the rpm SPEC.", isNonEmpty) + ensureOr(meta.summary, "`Rpm / packageSummary` is empty. Please provide a valid summary for the rpm SPEC.", isNonEmpty), + ensureOr(meta.description, "`Rpm / packageDescription` is empty. Please provide a valid description for the rpm SPEC.", isNonEmpty) ) // format: on // TODO - Continue validating after this point? 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 d5046d7f5..ea23a39c9 100644 --- a/src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala @@ -95,34 +95,34 @@ object RpmPlugin extends AutoPlugin { rpmPostun := None, rpmScriptsDirectory := sourceDirectory.value / "rpm" / Names.Scriptlets, // Explicitly defer default settings to generic Linux Settings. - maintainerScripts in Rpm := (maintainerScripts in Linux).value, - packageSummary in Rpm := (packageSummary in Linux).value, - packageDescription in Rpm := (packageDescription in Linux).value, - target in Rpm := target.value / "rpm", - name in Rpm := (name in Linux).value, - packageName in Rpm := (packageName in Linux).value, - executableScriptName in Rpm := (executableScriptName in Linux).value, - rpmDaemonLogFile := s"${(packageName in Linux).value}.log", - daemonStdoutLogFile in Rpm := Some(rpmDaemonLogFile.value), - validatePackageValidators in Rpm := Seq( - nonEmptyMappings((linuxPackageMappings in Rpm).value.flatMap(_.mappings)), - filesExist((linuxPackageMappings in Rpm).value.flatMap(_.mappings)), - checkMaintainer((maintainer in Rpm).value, asWarning = false), - epochIsNaturalNumber((rpmEpoch in Rpm).value.getOrElse(0)) + Rpm / maintainerScripts := (Linux / maintainerScripts).value, + Rpm / packageSummary := (Linux / packageSummary).value, + Rpm / packageDescription := (Linux / packageDescription).value, + Rpm / target := target.value / "rpm", + Rpm / name := (Linux / name).value, + Rpm / packageName := (Linux / packageName).value, + Rpm / executableScriptName := (Linux / executableScriptName).value, + rpmDaemonLogFile := s"${(Linux / packageName).value}.log", + Rpm / daemonStdoutLogFile := Some(rpmDaemonLogFile.value), + Rpm / validatePackageValidators := Seq( + nonEmptyMappings((Rpm / linuxPackageMappings).value.flatMap(_.mappings)), + filesExist((Rpm / linuxPackageMappings).value.flatMap(_.mappings)), + checkMaintainer((Rpm / maintainer).value, asWarning = false), + epochIsNaturalNumber((Rpm / rpmEpoch).value.getOrElse(0)) ), // override the linux sourceDirectory setting - sourceDirectory in Rpm := sourceDirectory.value, - packageArchitecture in Rpm := "noarch", + Rpm / sourceDirectory := sourceDirectory.value, + Rpm / packageArchitecture := "noarch", rpmMetadata := RpmMetadata( - (packageName in Rpm).value, - (version in Rpm).value.stripSuffix("-SNAPSHOT"), + (Rpm / packageName).value, + (Rpm / version).value.stripSuffix("-SNAPSHOT"), rpmRelease.value, rpmPrefix.value, - (packageArchitecture in Rpm).value, + (Rpm / packageArchitecture).value, rpmVendor.value, rpmOs.value, - (packageSummary in Rpm).value, - (packageDescription in Rpm).value, + (Rpm / packageSummary).value, + (Rpm / packageDescription).value, rpmAutoprov.value, rpmAutoreq.value, rpmEpoch.value @@ -143,8 +143,8 @@ object RpmPlugin extends AutoPlugin { rpmObsoletes.value, rpmConflicts.value ), - maintainerScripts in Rpm := { - val scripts = (maintainerScripts in Rpm).value + Rpm / maintainerScripts := { + val scripts = (Rpm / maintainerScripts).value if (!rpmBrpJavaRepackJars.value) { val pre = scripts.getOrElse(Names.Pre, Nil) val scriptBits = IO.readStream(RpmPlugin.osPostInstallMacro.openStream, Charset forName "UTF-8") @@ -153,29 +153,29 @@ object RpmPlugin extends AutoPlugin { scripts }, rpmScripts := RpmScripts - .fromMaintainerScripts((maintainerScripts in Rpm).value, (linuxScriptReplacements in Rpm).value), + .fromMaintainerScripts((Rpm / maintainerScripts).value, (Rpm / linuxScriptReplacements).value), rpmSpecConfig := RpmSpec( rpmMetadata.value, rpmDescription.value, rpmDependencies.value, rpmSetarch.value, rpmScripts.value, - (linuxPackageMappings in Rpm).value, - (linuxPackageSymlinks in Rpm).value, - (defaultLinuxInstallLocation in Rpm).value + (Rpm / linuxPackageMappings).value, + (Rpm / linuxPackageSymlinks).value, + (Rpm / defaultLinuxInstallLocation).value ), - stage in Rpm := RpmHelper.stage(rpmSpecConfig.value, (target in Rpm).value, streams.value.log), - artifactPath in (Rpm, packageBin) := RpmHelper.defaultRpmArtifactPath((target in Rpm).value, rpmMetadata.value), - packageBin in Rpm := { - val defaultPath = RpmHelper.buildRpm(rpmSpecConfig.value, (stage in Rpm).value, streams.value.log) + Rpm / stage := RpmHelper.stage(rpmSpecConfig.value, (Rpm / target).value, streams.value.log), + Rpm / packageBin / artifactPath := RpmHelper.defaultRpmArtifactPath((Rpm / target).value, rpmMetadata.value), + Rpm / packageBin := { + val defaultPath = RpmHelper.buildRpm(rpmSpecConfig.value, (Rpm / stage).value, streams.value.log) // `file` points to where buildRpm created the rpm. However we want it to be at `artifactPath`. // If `artifactPath` is not the default value then we need to copy the file. - val path = (artifactPath in (Rpm, packageBin)).value + val path = (Rpm / packageBin / artifactPath).value if (path.getCanonicalFile != defaultPath.getCanonicalFile) IO.copyFile(defaultPath, path) path }, rpmLint := { - sys.process.Process(Seq("rpmlint", "-v", (packageBin in Rpm).value.getAbsolutePath)) ! streams.value.log match { + sys.process.Process(Seq("rpmlint", "-v", (Rpm / packageBin).value.getAbsolutePath)) ! streams.value.log match { case 0 => () case x => sys.error("Failed to run rpmlint, exit status: " + x) } @@ -190,5 +190,5 @@ object RpmDeployPlugin extends AutoPlugin { override def requires = RpmPlugin override def projectSettings: Seq[Setting[_]] = - SettingsHelper.makeDeploymentSettings(Rpm, packageBin in Rpm, "rpm") + SettingsHelper.makeDeploymentSettings(Rpm, Rpm / packageBin, "rpm") } 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 d8f4e41f9..502e40091 100644 --- a/src/main/scala/com/typesafe/sbt/packager/universal/UniversalPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/universal/UniversalPlugin.scala @@ -60,15 +60,15 @@ 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, + dist := (Universal / dist).value, + stage := (Universal / stage).value, // 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 + Universal / name := name.value, + UniversalDocs / name := (Universal / name).value, + UniversalSrc / name := (Universal / name).value, + Universal / packageName := packageName.value, + topLevelDirectory := Some((Universal / packageName).value), + Universal / executableScriptName := executableScriptName.value ) ++ makePackageSettingsForConfig(Universal) ++ makePackageSettingsForConfig(UniversalDocs) ++ @@ -90,19 +90,19 @@ object UniversalPlugin extends AutoPlugin { stage := Stager.stage(config.name)(streams.value, stagingDirectory.value, mappings.value) ) ) ++ Seq( - sourceDirectory in config := sourceDirectory.value / config.name, - validatePackageValidators in config := validatePackageValidators.value, - target in config := target.value / config.name + config / sourceDirectory := sourceDirectory.value / config.name, + config / validatePackageValidators := validatePackageValidators.value, + config / target := target.value / config.name ) private[this] def defaultUniversalArchiveOptions: Seq[Setting[_]] = Seq( - universalArchiveOptions in (Universal, packageZipTarball) := Seq("-pcvf"), - universalArchiveOptions in (Universal, packageXzTarball) := Seq("-pcvf"), - universalArchiveOptions in (UniversalDocs, packageZipTarball) := Seq("-pcvf"), - universalArchiveOptions in (UniversalDocs, packageXzTarball) := Seq("-pcvf"), - universalArchiveOptions in (UniversalSrc, packageZipTarball) := Seq("-pcvf"), - universalArchiveOptions in (UniversalSrc, packageXzTarball) := Seq("-pcvf") + Universal / packageZipTarball / universalArchiveOptions := Seq("-pcvf"), + Universal / packageXzTarball / universalArchiveOptions := Seq("-pcvf"), + UniversalDocs / packageZipTarball / universalArchiveOptions := Seq("-pcvf"), + UniversalDocs / packageXzTarball / universalArchiveOptions := Seq("-pcvf"), + UniversalSrc / packageZipTarball / universalArchiveOptions := Seq("-pcvf"), + UniversalSrc / packageXzTarball / universalArchiveOptions := Seq("-pcvf") ) private[this] def printDist(dist: File, streams: TaskStreams): File = { @@ -120,23 +120,23 @@ object UniversalPlugin extends AutoPlugin { ): Seq[Setting[_]] = inConfig(config)( Seq( - universalArchiveOptions in packageKey := Nil, - mappings in packageKey := mappings.value, + packageKey / universalArchiveOptions := Nil, + packageKey / mappings := mappings.value, packageKey := packager( target.value, packageName.value, - (mappings in packageKey).value, + (packageKey / mappings).value, topLevelDirectory.value, - (universalArchiveOptions in packageKey).value + (packageKey / universalArchiveOptions).value ), - validatePackageValidators in packageKey := (validatePackageValidators in config).value ++ Seq( - nonEmptyMappings((mappings in packageKey).value), - filesExist((mappings in packageKey).value), - checkMaintainer((maintainer in packageKey).value, asWarning = true) + packageKey / validatePackageValidators := (config / validatePackageValidators).value ++ Seq( + nonEmptyMappings((packageKey / mappings).value), + filesExist((packageKey / mappings).value), + checkMaintainer((packageKey / maintainer).value, asWarning = true) ), - validatePackage in packageKey := Validation - .runAndThrow(validatePackageValidators.in(config, packageKey).value, streams.value.log), - packageKey := packageKey.dependsOn(validatePackage in packageKey).value + packageKey / validatePackage := Validation + .runAndThrow((config / packageKey / validatePackageValidators).value, streams.value.log), + packageKey := packageKey.dependsOn(packageKey / validatePackage).value ) ) @@ -153,8 +153,8 @@ object UniversalDeployPlugin extends AutoPlugin { override def requires: Plugins = UniversalPlugin override def projectSettings: Seq[Setting[_]] = - SettingsHelper.makeDeploymentSettings(Universal, packageBin in Universal, "zip") ++ - SettingsHelper.addPackage(Universal, packageZipTarball in Universal, "tgz") ++ - SettingsHelper.makeDeploymentSettings(UniversalDocs, packageBin in UniversalDocs, "zip") ++ - SettingsHelper.addPackage(UniversalDocs, packageXzTarball in UniversalDocs, "txz") + SettingsHelper.makeDeploymentSettings(Universal, Universal / packageBin, "zip") ++ + SettingsHelper.addPackage(Universal, Universal / packageZipTarball, "tgz") ++ + SettingsHelper.makeDeploymentSettings(UniversalDocs, Universal / packageBin, "zip") ++ + SettingsHelper.addPackage(UniversalDocs, Universal / packageXzTarball, "txz") } diff --git a/src/main/scala/com/typesafe/sbt/packager/validation/Validation.scala b/src/main/scala/com/typesafe/sbt/packager/validation/Validation.scala index af21b84a2..d948e3a44 100644 --- a/src/main/scala/com/typesafe/sbt/packager/validation/Validation.scala +++ b/src/main/scala/com/typesafe/sbt/packager/validation/Validation.scala @@ -21,9 +21,9 @@ object Validation { * Usually a validator is a function that captures some setting or task value, e.g. * {{{ * validatePackageValidators += { - * val universalMappings = (mappings in Universal).value + * val universalMappings = (Universal / mappings).value * () => { - * if (universalMappings.isEmpty) List(ValidationError(...)) else List.empt + * if (universalMappings.isEmpty) List(ValidationError(...)) else List.empty * } * } * }}} 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 04de1dd08..e310e0744 100644 --- a/src/main/scala/com/typesafe/sbt/packager/windows/WindowsPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/packager/windows/WindowsPlugin.scala @@ -48,53 +48,49 @@ object WindowsPlugin extends AutoPlugin { */ def windowsSettings: Seq[Setting[_]] = Seq( - sourceDirectory in Windows := sourceDirectory.value / "windows", - target in Windows := target.value / "windows", + Windows / sourceDirectory := sourceDirectory.value / "windows", + Windows / target := target.value / "windows", // TODO - Should this use normalized name like the linux guys? - name in Windows := name.value, - packageName in Windows := packageName.value, + Windows / name := name.value, + Windows / packageName := packageName.value, // Defaults so that our simplified building works candleOptions := Seq("-ext", "WixUtilExtension"), lightOptions := Seq("-ext", "WixUIExtension", "-ext", "WixUtilExtension", "-cultures:en-us"), - wixProductId := WixHelper.makeGUID((packageName in Windows).value + "_wixProductId"), - wixProductUpgradeId := WixHelper.makeGUID((packageName in Windows).value + "_wixProductUpgradeId"), + wixProductId := WixHelper.makeGUID((Windows / packageName).value + "_wixProductId"), + wixProductUpgradeId := WixHelper.makeGUID((Windows / packageName).value + "_wixProductUpgradeId"), wixMajorVersion := 3, - maintainer in Windows := maintainer.value, - packageSummary in Windows := packageSummary.value, - packageDescription in Windows := packageDescription.value, + Windows / maintainer := maintainer.value, + Windows / packageSummary := packageSummary.value, + Windows / packageDescription := packageDescription.value, wixProductLicense := { // TODO - document this default. - val default = (sourceDirectory in Windows).value / "License.rtf" + val default = (Windows / sourceDirectory).value / "License.rtf" if (default.exists) Some(default) else None }, wixPackageInfo := WindowsProductInfo( id = wixProductId.value, - title = (packageSummary in Windows).value, - version = (version in Windows).value, - maintainer = (maintainer in Windows).value, - description = (packageDescription in Windows).value, + title = (Windows / packageSummary).value, + version = (Windows / version).value, + maintainer = (Windows / maintainer).value, + description = (Windows / packageDescription).value, upgradeId = wixProductUpgradeId.value, comments = "TODO - we need comments." // TODO - allow comments ), wixFeatures := Seq.empty, - wixProductConfig := WixHelper.makeWixProductConfig( - (name in Windows).value, - wixPackageInfo.value, - wixFeatures.value, - wixProductLicense.value - ), + wixProductConfig := WixHelper + .makeWixProductConfig((Windows / name).value, wixPackageInfo.value, wixFeatures.value, wixProductLicense.value), wixConfig := WixHelper.makeWixConfig( - (name in Windows).value, + (Windows / name).value, wixPackageInfo.value, WixHelper.getNameSpaceDefinitions(wixMajorVersion.value), wixProductConfig.value ), - wixConfig in Windows := wixConfig.value, - wixProductConfig in Windows := wixProductConfig.value, + Windows / wixConfig := wixConfig.value, + Windows / wixProductConfig := wixProductConfig.value, wixFile := { - val config = (wixConfig in Windows).value - val wixConfigFile = (target in Windows).value / ((name in Windows).value + ".wxs") + val config = (Windows / wixConfig).value + val wixConfigFile = (Windows / target).value / ((Windows / name).value + ".wxs") IO.write(wixConfigFile, config.toString) wixConfigFile }, @@ -145,12 +141,12 @@ object WindowsPlugin extends AutoPlugin { })) /** - * set the `mappings in Windows` and the `wixFeatures` + * set the `Windows / mappings` and the `wixFeatures` */ def mapGenericFilesToWindows: Seq[Setting[_]] = Seq( - mappings in Windows := (mappings in Universal).value, - wixFeatures := makeWindowsFeatures((packageName in Windows).value, (mappings in Windows).value) + Windows / mappings := (Universal / mappings).value, + wixFeatures := makeWindowsFeatures((Windows / packageName).value, (Windows / mappings).value) ) /** @@ -222,5 +218,5 @@ object WindowsDeployPlugin extends AutoPlugin { override def requires = WindowsPlugin override def projectSettings: Seq[Setting[_]] = - SettingsHelper.makeDeploymentSettings(Windows, packageBin in Windows, "msi") + SettingsHelper.makeDeploymentSettings(Windows, Windows / packageBin, "msi") } diff --git a/src/sbt-test/ash/add-app-settings/build.sbt b/src/sbt-test/ash/add-app-settings/build.sbt index 0e2daac23..02421431c 100644 --- a/src/sbt-test/ash/add-app-settings/build.sbt +++ b/src/sbt-test/ash/add-app-settings/build.sbt @@ -7,14 +7,14 @@ version := "0.1.0" bashScriptExtraDefines ++= Seq("""addApp "info"""", """addApp "help"""") TaskKey[Unit]("scriptCheck") := { - val startScript = (stagingDirectory in Universal).value / "bin" / executableScriptName.value + val startScript = (Universal / stagingDirectory).value / "bin" / executableScriptName.value val options = IO.read(startScript) assert(options contains """addApp "info"""", "Script doesn't contain app setting:\n" + options) assert(options contains """addApp "help"""", "Script doesn't contain app setting:\n" + options) } TaskKey[Unit]("runCheck") := { - val cwd = (stagingDirectory in Universal).value + val cwd = (Universal / stagingDirectory).value val cmd = Seq((cwd / "bin" / packageName.value).getAbsolutePath) val output = (sys.process.Process(cmd, cwd).!!).replaceAll("\n", "") diff --git a/src/sbt-test/ash/command-line-settings/build.sbt b/src/sbt-test/ash/command-line-settings/build.sbt index 84d0361cc..234409f2c 100644 --- a/src/sbt-test/ash/command-line-settings/build.sbt +++ b/src/sbt-test/ash/command-line-settings/build.sbt @@ -6,7 +6,7 @@ version := "0.1.0-SNAPSHOT" TaskKey[Unit]("checkSystemProperty") := { val configArg = "config.resource=/config.conf" - val cwd = (stagingDirectory in Universal).value + val cwd = (Universal / stagingDirectory).value val cmd = Seq((cwd / "bin" / packageName.value).getAbsolutePath, s"-D$configArg") val output = (sys.process.Process(cmd, cwd).!!).replaceAll("\n", "") @@ -15,7 +15,7 @@ TaskKey[Unit]("checkSystemProperty") := { TaskKey[Unit]("checkResidual") := { val arg = "residualArg" - val cwd = (stagingDirectory in Universal).value + val cwd = (Universal / stagingDirectory).value val cmd = Seq((cwd / "bin" / packageName.value).getAbsolutePath, arg) val output = (sys.process.Process(cmd, cwd).!!).replaceAll("\n", "") @@ -40,7 +40,7 @@ TaskKey[Unit]("checkComplexResidual") := { "\\\"", "''" ) - val cwd = (stagingDirectory in Universal).value + val cwd = (Universal / stagingDirectory).value val cmd = Seq((cwd / "bin" / packageName.value).getAbsolutePath) ++ args val expected = """arg1|-J-Dfoo=bar|arg 2|--|"|$foo|'|%s|-y|bla|\'|\"|''""" diff --git a/src/sbt-test/ash/memory-settings/build.sbt b/src/sbt-test/ash/memory-settings/build.sbt index e0c5aa259..48a3e128a 100644 --- a/src/sbt-test/ash/memory-settings/build.sbt +++ b/src/sbt-test/ash/memory-settings/build.sbt @@ -7,14 +7,14 @@ version := "0.1.0" bashScriptExtraDefines ++= Seq("""addJava "-Xms64m"""", """addJava "-Xmx64m"""") TaskKey[Unit]("scriptCheck") := { - val startScript = (stagingDirectory in Universal).value / "bin" / executableScriptName.value + val startScript = (Universal / stagingDirectory).value / "bin" / executableScriptName.value val options = IO.read(startScript) assert(options contains """addJava "-Xms64m"""", "Script doesn't contain xmx setting:\n" + options) assert(options contains """addJava "-Xmx64m"""", "Script doesn't contain xms setting:\n" + options) } TaskKey[Unit]("runCheck") := { - val cwd = (stagingDirectory in Universal).value + val cwd = (Universal / stagingDirectory).value val cmd = Seq((cwd / "bin" / packageName.value).getAbsolutePath) 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/override-templates/build.sbt b/src/sbt-test/ash/override-templates/build.sbt index 3a0124961..51c1766cc 100644 --- a/src/sbt-test/ash/override-templates/build.sbt +++ b/src/sbt-test/ash/override-templates/build.sbt @@ -9,7 +9,7 @@ version := "0.1.0" bashScriptTemplateLocation := baseDirectory.value / "custom-templates" / "custom-ash-template" TaskKey[Unit]("runCheckAsh") := { - val cwd = (stagingDirectory in Universal).value + val cwd = (Universal / stagingDirectory).value val source = scala.io.Source.fromFile((cwd / "bin" / packageName.value).getAbsolutePath) val contents = diff --git a/src/sbt-test/ash/simple-app/build.sbt b/src/sbt-test/ash/simple-app/build.sbt index c0abd383e..7343071d1 100644 --- a/src/sbt-test/ash/simple-app/build.sbt +++ b/src/sbt-test/ash/simple-app/build.sbt @@ -7,7 +7,7 @@ name := "simple-app" version := "0.1.0" TaskKey[Unit]("runCheck") := { - val cwd = (stagingDirectory in Universal).value + val cwd = (Universal / stagingDirectory).value val cmd = Seq((cwd / "bin" / packageName.value).getAbsolutePath) val output = sys.process.Process(cmd, cwd).!! assert(output contains "SUCCESS!", "Output didn't contain success: " + output) diff --git a/src/sbt-test/ash/top-level-main/build.sbt b/src/sbt-test/ash/top-level-main/build.sbt index 1d584b608..0633728fc 100644 --- a/src/sbt-test/ash/top-level-main/build.sbt +++ b/src/sbt-test/ash/top-level-main/build.sbt @@ -9,7 +9,7 @@ version := "0.1.0" scalaVersion := "3.3.3" TaskKey[Unit]("runCheck") := { - val cwd = (stagingDirectory in Universal).value + val cwd = (Universal / stagingDirectory).value val cmd = Seq((cwd / "bin" / packageName.value).getAbsolutePath) val output = sys.process.Process(cmd, cwd).!! assert(output contains "SUCCESS!", "Output didn't contain success: " + output) 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 14889eb81..b1453e8bb 100644 --- a/src/sbt-test/bash/absolute-path-in-bash/build.sbt +++ b/src/sbt-test/bash/absolute-path-in-bash/build.sbt @@ -4,10 +4,10 @@ name := "absolute-path-in-bash" version := "0.1.0" -scriptClasspath in bashScriptDefines ++= Seq("/dummy/absolute/path", "relative/path") +bashScriptDefines / scriptClasspath ++= Seq("/dummy/absolute/path", "relative/path") TaskKey[Unit]("runCheck") := { - val dir = (stagingDirectory in Universal).value + val dir = (Universal / stagingDirectory).value val bash = IO.read(dir / "bin" / "absolute-path-in-bash") assert(bash contains ":/dummy/absolute/path") 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 a4e6e7c5e..d106ba650 100644 --- a/src/sbt-test/bash/java-home-var-expansion/build.sbt +++ b/src/sbt-test/bash/java-home-var-expansion/build.sbt @@ -6,10 +6,10 @@ name := "java-home-override" version := "0.1.0" -javaOptions in Universal ++= Seq("-java-home ${app_home}/../jre") +Universal / javaOptions ++= Seq("-java-home ${app_home}/../jre") TaskKey[Unit]("runCheck") := { - val cwd = (stagingDirectory in Universal).value + val cwd = (Universal / stagingDirectory).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 = sys.process.Process(cmd, cwd).lines_! diff --git a/src/sbt-test/bash/memory-settings/build.sbt b/src/sbt-test/bash/memory-settings/build.sbt index 4006beaec..e64f3b293 100644 --- a/src/sbt-test/bash/memory-settings/build.sbt +++ b/src/sbt-test/bash/memory-settings/build.sbt @@ -6,17 +6,17 @@ name := "simple-app" version := "0.1.0" -javaOptions in Universal ++= Seq("-J-Xmx64m", "-J-Xms64m") +Universal / javaOptions ++= Seq("-J-Xmx64m", "-J-Xms64m") TaskKey[Unit]("jvmoptsCheck") := { - val jvmopts = (stagingDirectory in Universal).value / "conf" / "application.ini" + val jvmopts = (Universal / stagingDirectory).value / "conf" / "application.ini" val options = IO.read(jvmopts) assert(options contains "-J-Xmx64m", "Options don't contain xmx setting:\n" + options) assert(options contains "-J-Xms64m", "Options don't contain xms setting:\n" + options) } TaskKey[Unit]("runCheck") := { - val cwd = (stagingDirectory in Universal).value + val cwd = (Universal / stagingDirectory).value val cmd = Seq((cwd / "bin" / packageName.value).getAbsolutePath) 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/multiple-apps/build.sbt b/src/sbt-test/bash/multiple-apps/build.sbt index 82bd84544..a1aabee2b 100644 --- a/src/sbt-test/bash/multiple-apps/build.sbt +++ b/src/sbt-test/bash/multiple-apps/build.sbt @@ -6,7 +6,7 @@ name := "test-project" version := "0.1.0" TaskKey[Unit]("checkNoExplicitMain") := { - val cwd = (stagingDirectory in Universal).value + val cwd = (Universal / stagingDirectory).value // check MainApp val cmd = Seq((cwd / "bin" / "main-app").getAbsolutePath) @@ -20,7 +20,7 @@ TaskKey[Unit]("checkNoExplicitMain") := { } TaskKey[Unit]("checkExplicitMain") := { - val cwd = (stagingDirectory in Universal).value + val cwd = (Universal / stagingDirectory).value // check default start script val cmd = Seq((cwd / "bin" / executableScriptName.value).getAbsolutePath) diff --git a/src/sbt-test/bash/override-templates/build.sbt b/src/sbt-test/bash/override-templates/build.sbt index 32d2aecdf..f14372d74 100644 --- a/src/sbt-test/bash/override-templates/build.sbt +++ b/src/sbt-test/bash/override-templates/build.sbt @@ -11,7 +11,7 @@ bashScriptTemplateLocation := baseDirectory.value / "custom-templates" / "custom batScriptTemplateLocation := baseDirectory.value / "custom-templates" / "custom-bat-template" TaskKey[Unit]("runCheckBash") := { - val cwd = (stagingDirectory in Universal).value + val cwd = (Universal / stagingDirectory).value val source = scala.io.Source.fromFile((cwd / "bin" / packageName.value).getAbsolutePath) val contents = @@ -24,7 +24,7 @@ TaskKey[Unit]("runCheckBash") := { } TaskKey[Unit]("runCheckBat") := { - val cwd = (stagingDirectory in Universal).value + val cwd = (Universal / stagingDirectory).value val batFilename = packageName.value + ".bat" val source = scala.io.Source.fromFile((cwd / "bin" / batFilename).getAbsolutePath) diff --git a/src/sbt-test/bash/simple-app/build.sbt b/src/sbt-test/bash/simple-app/build.sbt index ed77e00c9..43064cda4 100644 --- a/src/sbt-test/bash/simple-app/build.sbt +++ b/src/sbt-test/bash/simple-app/build.sbt @@ -7,7 +7,7 @@ name := "simple-app" version := "0.1.0" TaskKey[Unit]("runCheck") := { - val cwd = (stagingDirectory in Universal).value + val cwd = (Universal / stagingDirectory).value val cmd = Seq((cwd / "bin" / packageName.value).getAbsolutePath) val output = sys.process.Process(cmd, cwd).!! assert(output contains "SUCCESS!", "Output didn't contain success: " + output) diff --git a/src/sbt-test/bash/top-level-main/build.sbt b/src/sbt-test/bash/top-level-main/build.sbt index 990031d4a..9e823aeae 100644 --- a/src/sbt-test/bash/top-level-main/build.sbt +++ b/src/sbt-test/bash/top-level-main/build.sbt @@ -9,7 +9,7 @@ version := "0.1.0" scalaVersion := "3.3.3" TaskKey[Unit]("runCheck") := { - val cwd = (stagingDirectory in Universal).value + val cwd = (Universal / stagingDirectory).value val cmd = Seq((cwd / "bin" / packageName.value).getAbsolutePath) val output = sys.process.Process(cmd, cwd).!! assert(output contains "SUCCESS!", "Output didn't contain success: " + output) diff --git a/src/sbt-test/cygwin/java-app-archetype/build.sbt b/src/sbt-test/cygwin/java-app-archetype/build.sbt index 9a62f1cd9..3aa3ba631 100644 --- a/src/sbt-test/cygwin/java-app-archetype/build.sbt +++ b/src/sbt-test/cygwin/java-app-archetype/build.sbt @@ -7,7 +7,7 @@ name := "windows-test" version := "0.1.0" TaskKey[Unit]("checkCygwinScript") := { - val dir = (stagingDirectory in Universal).value + val dir = (Universal / stagingDirectory).value // TODO - FIx our cygwin detection! val cygwinBash = file("C:\\cygwin\\bin\\bash.exe") if (!cygwinBash.exists) 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 9759c5474..c095fe4ba 100644 --- a/src/sbt-test/debian/daemon-group-gid-deb/build.sbt +++ b/src/sbt-test/debian/daemon-group-gid-deb/build.sbt @@ -1,10 +1,10 @@ enablePlugins(JavaServerAppPackaging, UpstartPlugin) -daemonUser in Linux := "daemonuser" -daemonGroup in Linux := "daemongroup" -daemonGroupGid in Linux := Some("25000") +Linux / daemonUser := "daemonuser" +Linux / daemonGroup := "daemongroup" +Linux / daemonGroupGid := Some("25000") -mainClass in Compile := Some("empty") +Compile / mainClass := Some("empty") name := "debian-test" version := "0.1.0" diff --git a/src/sbt-test/debian/daemon-user-deb/build.sbt b/src/sbt-test/debian/daemon-user-deb/build.sbt index ec95086d8..88c3a4f98 100644 --- a/src/sbt-test/debian/daemon-user-deb/build.sbt +++ b/src/sbt-test/debian/daemon-user-deb/build.sbt @@ -1,9 +1,9 @@ enablePlugins(JavaServerAppPackaging) -daemonUser in Linux := "daemonuser" -daemonGroup in Linux := "daemongroup" +Linux / daemonUser := "daemonuser" +Linux / daemonGroup := "daemongroup" -mainClass in Compile := Some("empty") +Compile / mainClass := Some("empty") name := "debian-test" version := "0.1.0" diff --git a/src/sbt-test/debian/daemon-user-homedir-deb/build.sbt b/src/sbt-test/debian/daemon-user-homedir-deb/build.sbt index 3d458c453..44e9ce262 100644 --- a/src/sbt-test/debian/daemon-user-homedir-deb/build.sbt +++ b/src/sbt-test/debian/daemon-user-homedir-deb/build.sbt @@ -1,10 +1,10 @@ enablePlugins(JavaServerAppPackaging) -daemonUser in Linux := "daemonuser" -daemonGroup in Linux := "daemongroup" -daemonHome in Linux := "/var/lib/customdaemonhome" +Linux / daemonUser := "daemonuser" +Linux / daemonGroup := "daemongroup" +Linux / daemonHome := "/var/lib/customdaemonhome" -mainClass in Compile := Some("empty") +Compile / mainClass := Some("empty") name := "debian-test" version := "0.1.0" 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 e6c1c139f..43087417b 100644 --- a/src/sbt-test/debian/daemon-user-shell-deb/build.sbt +++ b/src/sbt-test/debian/daemon-user-shell-deb/build.sbt @@ -1,10 +1,10 @@ enablePlugins(JavaServerAppPackaging) -daemonUser in Linux := "daemonuser" -daemonGroup in Linux := "daemongroup" -daemonShell in Linux := "/bin/bash" +Linux / daemonUser := "daemonuser" +Linux / daemonGroup := "daemongroup" +Linux / daemonShell := "/bin/bash" -mainClass in Compile := Some("empty") +Compile / mainClass := Some("empty") name := "debian-test" version := "0.1.0" 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 2ba744fae..c3169e7f5 100644 --- a/src/sbt-test/debian/daemon-user-uid-deb/build.sbt +++ b/src/sbt-test/debian/daemon-user-uid-deb/build.sbt @@ -1,10 +1,10 @@ enablePlugins(JavaServerAppPackaging) -daemonUser in Linux := "daemonuser" -daemonUserUid in Linux := Some("20000") -daemonGroup in Linux := "daemongroup" +Linux / daemonUser := "daemonuser" +Linux / daemonUserUid := Some("20000") +Linux / daemonGroup := "daemongroup" -mainClass in Compile := Some("empty") +Compile / mainClass := Some("empty") name := "debian-test" version := "0.1.0" diff --git a/src/sbt-test/debian/file-permissions/build.sbt b/src/sbt-test/debian/file-permissions/build.sbt index 7ff38f46f..e380a9625 100644 --- a/src/sbt-test/debian/file-permissions/build.sbt +++ b/src/sbt-test/debian/file-permissions/build.sbt @@ -12,5 +12,5 @@ packageDescription := """A fun package description of our software, with multiple lines.""" linuxPackageMappings += packageMapping( - ((resourceDirectory in Compile).value / "sudoers.d", "/etc/sudoers.d") + ((Compile / resourceDirectory).value / "sudoers.d", "/etc/sudoers.d") ) withPerms ("0440") asDocs () diff --git a/src/sbt-test/debian/gen-changes/build.sbt b/src/sbt-test/debian/gen-changes/build.sbt index 51c0abffc..065bd5614 100644 --- a/src/sbt-test/debian/gen-changes/build.sbt +++ b/src/sbt-test/debian/gen-changes/build.sbt @@ -11,8 +11,8 @@ packageSummary := "Test debian package" packageDescription := """A fun package description of our software, with multiple lines.""" -debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11)") +Debian / debianPackageDependencies ++= Seq("java2-runtime", "bash (>= 2.05a-11)") -debianPackageRecommends in Debian += "git" +Debian / debianPackageRecommends += "git" -debianChangelog in Debian := Some(file("debian/changelog")) +Debian / debianChangelog := Some(file("debian/changelog")) diff --git a/src/sbt-test/debian/java-app-archetype/build.sbt b/src/sbt-test/debian/java-app-archetype/build.sbt index c523ece07..35cc8471f 100644 --- a/src/sbt-test/debian/java-app-archetype/build.sbt +++ b/src/sbt-test/debian/java-app-archetype/build.sbt @@ -13,12 +13,12 @@ packageSummary := "Test debian package" packageDescription := """A fun package description of our software, with multiple lines.""" -debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11)") +Debian / debianPackageDependencies ++= Seq("java2-runtime", "bash (>= 2.05a-11)") -debianPackageRecommends in Debian += "git" +Debian / debianPackageRecommends += "git" TaskKey[Unit]("checkScript") := { - val dir = (stagingDirectory in Universal).value + val dir = (Universal / stagingDirectory).value val script = dir / "bin" / name.value System.out.synchronized { System.err.println("---SCRIPT---") diff --git a/src/sbt-test/debian/jdeb-conflicts/build.sbt b/src/sbt-test/debian/jdeb-conflicts/build.sbt index 6b38fc1f6..eb5473769 100644 --- a/src/sbt-test/debian/jdeb-conflicts/build.sbt +++ b/src/sbt-test/debian/jdeb-conflicts/build.sbt @@ -11,7 +11,7 @@ packageSummary := "Test debian package" packageDescription := """A fun package description of our software, with multiple lines.""" -debianPackageConflicts in Debian := Seq("debian-test-package") +Debian / debianPackageConflicts := Seq("debian-test-package") TaskKey[Unit]("checkConflicts") := { val extracted = target.value / "extracted" diff --git a/src/sbt-test/debian/jdeb-dependencies/build.sbt b/src/sbt-test/debian/jdeb-dependencies/build.sbt index 70f4bbaaf..186923cf0 100644 --- a/src/sbt-test/debian/jdeb-dependencies/build.sbt +++ b/src/sbt-test/debian/jdeb-dependencies/build.sbt @@ -11,7 +11,7 @@ packageSummary := "Test debian package" packageDescription := """A fun package description of our software, with multiple lines.""" -debianPackageDependencies in Debian := Seq() +Debian / debianPackageDependencies := Seq() TaskKey[Unit]("checkDependencies") := { val extracted = target.value / "extracted" diff --git a/src/sbt-test/debian/jdeb-dir-mappings/build.sbt b/src/sbt-test/debian/jdeb-dir-mappings/build.sbt index 4b6ab058e..5c1a2172d 100644 --- a/src/sbt-test/debian/jdeb-dir-mappings/build.sbt +++ b/src/sbt-test/debian/jdeb-dir-mappings/build.sbt @@ -11,15 +11,15 @@ packageSummary := "Test debian package" packageDescription := """A fun package description of our software, with multiple lines.""" -debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11)") +Debian / debianPackageDependencies ++= Seq("java2-runtime", "bash (>= 2.05a-11)") -debianPackageRecommends in Debian += "git" +Debian / debianPackageRecommends += "git" -linuxPackageMappings in Debian += packageDirectoryAndContentsMapping( +Debian / linuxPackageMappings += packageDirectoryAndContentsMapping( (baseDirectory.value / "src" / "resources" / "conf") -> "/usr/share/conf" ) -linuxPackageMappings in Debian += packageDirectoryAndContentsMapping( +Debian / linuxPackageMappings += packageDirectoryAndContentsMapping( (baseDirectory.value / "src" / "resources" / "empty") -> "/var/empty" ) diff --git a/src/sbt-test/debian/jdeb-provides/build.sbt b/src/sbt-test/debian/jdeb-provides/build.sbt index 13779921e..26b1e81d4 100644 --- a/src/sbt-test/debian/jdeb-provides/build.sbt +++ b/src/sbt-test/debian/jdeb-provides/build.sbt @@ -11,7 +11,7 @@ packageSummary := "Test debian package" packageDescription := """A fun package description of our software, with multiple lines.""" -debianPackageProvides in Debian := Seq("debian-test-package") +Debian / debianPackageProvides := Seq("debian-test-package") TaskKey[Unit]("checkProvides") := { val extracted = target.value / "extracted" diff --git a/src/sbt-test/debian/jdeb-script-replacements/build.sbt b/src/sbt-test/debian/jdeb-script-replacements/build.sbt index 9460ad734..3d18a59ad 100644 --- a/src/sbt-test/debian/jdeb-script-replacements/build.sbt +++ b/src/sbt-test/debian/jdeb-script-replacements/build.sbt @@ -11,9 +11,9 @@ packageSummary := "Test debian package" packageDescription := """A fun package description of our software, with multiple lines.""" -debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11)") +Debian / debianPackageDependencies ++= Seq("java2-runtime", "bash (>= 2.05a-11)") -debianPackageRecommends in Debian += "git" +Debian / debianPackageRecommends += "git" TaskKey[Unit]("checkControlFiles") := { val header = "#!/bin/sh" diff --git a/src/sbt-test/debian/log-directory/build.sbt b/src/sbt-test/debian/log-directory/build.sbt index 580f330cc..db54a0a68 100644 --- a/src/sbt-test/debian/log-directory/build.sbt +++ b/src/sbt-test/debian/log-directory/build.sbt @@ -1,8 +1,8 @@ enablePlugins(JavaServerAppPackaging) -daemonUser in Debian := "root" +Debian / daemonUser := "root" -mainClass in Compile := Some("empty") +Compile / mainClass := Some("empty") name := "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 6653a9d01..715c379f9 100644 --- a/src/sbt-test/debian/native-build-compress/build.sbt +++ b/src/sbt-test/debian/native-build-compress/build.sbt @@ -1,6 +1,6 @@ enablePlugins(DebianPlugin) -debianNativeBuildOptions in Debian := Nil +Debian / debianNativeBuildOptions := Nil maintainer := "Maintainer " @@ -9,7 +9,7 @@ packageDescription := "Description" packageSummary := "Summary" TaskKey[Unit]("checkDebCompression") := { - val deb = target.value / s"${(name in Debian).value}_${(version in Debian).value}_all.deb" + val deb = target.value / s"${(Debian / name).value}_${(Debian / version).value}_all.deb" 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 c7eba3928..81bad003c 100644 --- a/src/sbt-test/debian/native-build-default/build.sbt +++ b/src/sbt-test/debian/native-build-default/build.sbt @@ -7,7 +7,7 @@ packageDescription := "Description" packageSummary := "Summary" TaskKey[Unit]("checkDebCompression") := { - val deb = target.value / s"${(name in Debian).value}_${(version in Debian).value}_all.deb" + val deb = target.value / s"${(Debian / name).value}_${(Debian / version).value}_all.deb" val output = sys.process.Process(Seq("ar", "-t", deb.toString)).lines assert(output.contains("data.tar")) } diff --git a/src/sbt-test/debian/override-control-files/build.sbt b/src/sbt-test/debian/override-control-files/build.sbt index e4f78a2cc..4115ff8e7 100644 --- a/src/sbt-test/debian/override-control-files/build.sbt +++ b/src/sbt-test/debian/override-control-files/build.sbt @@ -1,6 +1,6 @@ enablePlugins(JavaServerAppPackaging, UpstartPlugin) -mainClass in Compile := Some("empty") +Compile / mainClass := Some("empty") name := "debian-test" @@ -10,16 +10,16 @@ maintainer := "Josh Suereth " packageSummary := "Test debian package" -daemonUser in Linux := "root" +Linux / daemonUser := "root" -daemonGroup in Linux := "root" +Linux / daemonGroup := "root" packageDescription := """A fun package description of our software, with multiple lines.""" // add this to override all preexisting settings import DebianConstants._ -maintainerScripts in Debian := maintainerScriptsFromDirectory( +Debian / maintainerScripts := maintainerScriptsFromDirectory( sourceDirectory.value / DebianSource / DebianMaintainerScripts, Seq(Preinst, Postinst, Prerm, Postrm) ) diff --git a/src/sbt-test/debian/override-etc-default/build.sbt b/src/sbt-test/debian/override-etc-default/build.sbt index d540b7d63..7d949d472 100644 --- a/src/sbt-test/debian/override-etc-default/build.sbt +++ b/src/sbt-test/debian/override-etc-default/build.sbt @@ -1,15 +1,15 @@ enablePlugins(JavaServerAppPackaging, JDebPackaging, UpstartPlugin) // TODO change this after #437 is fixed -daemonUser in Linux := "root" +Linux / daemonUser := "root" -daemonGroup in Linux := "app-group" +Linux / daemonGroup := "app-group" -mainClass in Compile := Some("empty") +Compile / mainClass := Some("empty") name := "debian-test" -name in Debian := "debian-test" +Debian / name := "debian-test" version := "0.1.0" diff --git a/src/sbt-test/debian/override-loader-functions/build.sbt b/src/sbt-test/debian/override-loader-functions/build.sbt index 6f616c8e9..1f1b1d159 100644 --- a/src/sbt-test/debian/override-loader-functions/build.sbt +++ b/src/sbt-test/debian/override-loader-functions/build.sbt @@ -1,10 +1,10 @@ enablePlugins(JavaServerAppPackaging, JDebPackaging, SystemdPlugin) // TODO change this after #437 is fixed -daemonUser in Linux := "root" -daemonGroup in Linux := "app-group" +Linux / daemonUser := "root" +Linux / daemonGroup := "app-group" -mainClass in Compile := Some("empty") +Compile / mainClass := Some("empty") name := "debian-test" version := "0.1.0" 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 ed0a18ebe..3476037b8 100644 --- a/src/sbt-test/debian/override-start-script-systemd/build.sbt +++ b/src/sbt-test/debian/override-start-script-systemd/build.sbt @@ -1,10 +1,10 @@ enablePlugins(JavaServerAppPackaging, JDebPackaging, SystemdPlugin) // TODO change this after #437 is fixed -daemonUser in Linux := "root" -daemonGroup in Linux := "app-group" +Linux / daemonUser := "root" +Linux / daemonGroup := "app-group" -mainClass in Compile := Some("empty") +Compile / mainClass := Some("empty") name := "debian-test" version := "0.1.0" 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 f4c37ebde..7a083e20d 100644 --- a/src/sbt-test/debian/override-start-script-systemv/build.sbt +++ b/src/sbt-test/debian/override-start-script-systemv/build.sbt @@ -1,10 +1,10 @@ enablePlugins(JavaServerAppPackaging, JDebPackaging, SystemVPlugin) // TODO change this after #437 is fixed -daemonUser in Linux := "root" -daemonGroup in Linux := "app-group" +Linux / daemonUser := "root" +Linux / daemonGroup := "app-group" -mainClass in Compile := Some("empty") +Compile / mainClass := Some("empty") name := "debian-test" version := "0.1.0" 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 39d41c09a..ebbbe8ed8 100644 --- a/src/sbt-test/debian/override-start-script-upstart/build.sbt +++ b/src/sbt-test/debian/override-start-script-upstart/build.sbt @@ -1,10 +1,10 @@ enablePlugins(JavaServerAppPackaging, JDebPackaging, UpstartPlugin) // TODO change this after #437 is fixed -daemonUser in Linux := "root" -daemonGroup in Linux := "app-group" +Linux / daemonUser := "root" +Linux / daemonGroup := "app-group" -mainClass in Compile := Some("empty") +Compile / mainClass := Some("empty") name := "debian-test" version := "0.1.0" diff --git a/src/sbt-test/debian/simple-deb/build.sbt b/src/sbt-test/debian/simple-deb/build.sbt index 3c27a4445..e9bd5cf05 100644 --- a/src/sbt-test/debian/simple-deb/build.sbt +++ b/src/sbt-test/debian/simple-deb/build.sbt @@ -11,10 +11,10 @@ packageSummary := "Test debian package" packageDescription := """A fun package description of our software, with multiple lines.""" -debianPackageConflicts in Debian += "debian-other-test-package" +Debian / debianPackageConflicts += "debian-other-test-package" -debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11)") +Debian / debianPackageDependencies ++= Seq("java2-runtime", "bash (>= 2.05a-11)") -debianPackageProvides in Debian += "debian-test-package" +Debian / debianPackageProvides += "debian-test-package" -debianPackageRecommends in Debian += "git" +Debian / debianPackageRecommends += "git" diff --git a/src/sbt-test/debian/simple-jdeb/build.sbt b/src/sbt-test/debian/simple-jdeb/build.sbt index c90c09f38..a96f25ee0 100644 --- a/src/sbt-test/debian/simple-jdeb/build.sbt +++ b/src/sbt-test/debian/simple-jdeb/build.sbt @@ -11,10 +11,10 @@ packageSummary := "Test debian package" packageDescription := """A fun package description of our software, with multiple lines.""" -debianPackageConflicts in Debian += "debian-other-test-package" +Debian / debianPackageConflicts += "debian-other-test-package" -debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11)") +Debian / debianPackageDependencies ++= Seq("java2-runtime", "bash (>= 2.05a-11)") -debianPackageProvides in Debian += "debian-test-package" +Debian / debianPackageProvides += "debian-test-package" -debianPackageRecommends in Debian += "git" +Debian / debianPackageRecommends += "git" diff --git a/src/sbt-test/debian/systemd-deb/build.sbt b/src/sbt-test/debian/systemd-deb/build.sbt index 4933c1770..f253dbfb9 100644 --- a/src/sbt-test/debian/systemd-deb/build.sbt +++ b/src/sbt-test/debian/systemd-deb/build.sbt @@ -8,11 +8,11 @@ packageSummary := "Test debian package" packageDescription := """A fun package description of our software, with multiple lines.""" -requiredStartFacilities in Debian := Some("network.target") +Debian / requiredStartFacilities := Some("network.target") -daemonUser in Linux := "testuser" +Linux / daemonUser := "testuser" -systemdSuccessExitStatus in Debian += "1" +Debian / systemdSuccessExitStatus += "1" TaskKey[Unit]("checkStartupScript") := { val script = IO.read(target.value / "debian-test-0.1.0" / "lib" / "systemd" / "system" / "debian-test.service") diff --git a/src/sbt-test/debian/sysvinit-deb/build.sbt b/src/sbt-test/debian/sysvinit-deb/build.sbt index 7018ccbcd..66b17a698 100644 --- a/src/sbt-test/debian/sysvinit-deb/build.sbt +++ b/src/sbt-test/debian/sysvinit-deb/build.sbt @@ -1,8 +1,8 @@ enablePlugins(JavaServerAppPackaging, SystemVPlugin) -daemonUser in Debian := "root" +Debian / daemonUser := "root" -mainClass in Compile := Some("empty") +Compile / mainClass := Some("empty") name := "debian-test" @@ -17,7 +17,7 @@ packageDescription := """A fun package description of our software, requiredStartFacilities := Some("$test-service") -requiredStartFacilities in Debian := Some("$test-deb-service") +Debian / requiredStartFacilities := Some("$test-deb-service") daemonStdoutLogFile := Some("test.log") diff --git a/src/sbt-test/debian/sysvinit-stoptimeouts-deb/build.sbt b/src/sbt-test/debian/sysvinit-stoptimeouts-deb/build.sbt index cc6b8b919..4630910f4 100644 --- a/src/sbt-test/debian/sysvinit-stoptimeouts-deb/build.sbt +++ b/src/sbt-test/debian/sysvinit-stoptimeouts-deb/build.sbt @@ -1,8 +1,8 @@ enablePlugins(JavaServerAppPackaging, SystemVPlugin) -daemonUser in Debian := "root" +Debian / daemonUser := "root" -mainClass in Compile := Some("empty") +Compile / mainClass := Some("empty") name := "debian-test" @@ -17,11 +17,11 @@ packageDescription := """A fun package description of our software, requiredStartFacilities := Some("$test-service") -requiredStartFacilities in Debian := Some("$test-deb-service") +Debian / requiredStartFacilities := Some("$test-deb-service") -termTimeout in Debian := 10 +Debian / termTimeout := 10 -killTimeout in Debian := 20 +Debian / killTimeout := 20 TaskKey[Unit]("checkControlFiles") := { val header = "#!/bin/sh" diff --git a/src/sbt-test/debian/test-executableScriptName/build.sbt b/src/sbt-test/debian/test-executableScriptName/build.sbt index cd33fcdcd..2e20988dd 100644 --- a/src/sbt-test/debian/test-executableScriptName/build.sbt +++ b/src/sbt-test/debian/test-executableScriptName/build.sbt @@ -13,9 +13,9 @@ packageSummary := "Test debian package" packageDescription := """A fun package description of our software, with multiple lines.""" -debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11)") +Debian / debianPackageDependencies ++= Seq("java2-runtime", "bash (>= 2.05a-11)") -debianPackageRecommends in Debian += "git" +Debian / debianPackageRecommends += "git" TaskKey[Unit]("checkUpstartScript") := { val script = IO.read(target.value / "debian-test-0.1.0" / "etc" / "init" / "debian-test.conf") diff --git a/src/sbt-test/debian/test-mapping-helpers/build.sbt b/src/sbt-test/debian/test-mapping-helpers/build.sbt index 76f1a17d4..87d646131 100644 --- a/src/sbt-test/debian/test-mapping-helpers/build.sbt +++ b/src/sbt-test/debian/test-mapping-helpers/build.sbt @@ -15,13 +15,13 @@ packageDescription := """A fun package description of our software, // linuxPackageMappings in Debian += packageTemplateMapping("/var/run/debian") // not work // linuxPackageMappings in Debian += packageTemplateMapping("/var/run/debian")() // not work -linuxPackageMappings in Debian += packageTemplateMapping(Seq("/opt/test/other"): _*)() +Debian / linuxPackageMappings += packageTemplateMapping(Seq("/opt/test/other"): _*)() -linuxPackageMappings in Debian += { +Debian / linuxPackageMappings += { packageTemplateMapping("/opt/test/" + Keys.normalizedName.value)(target.value) } // Consider using mappings in Universal -linuxPackageMappings in Debian += packageDirectoryAndContentsMapping( +Debian / linuxPackageMappings += packageDirectoryAndContentsMapping( (baseDirectory.value / "src" / "resources" / "conf") -> "/usr/share/conf" ) diff --git a/src/sbt-test/debian/test-mapping/build.sbt b/src/sbt-test/debian/test-mapping/build.sbt index 845d9a4f5..df2d29f6f 100644 --- a/src/sbt-test/debian/test-mapping/build.sbt +++ b/src/sbt-test/debian/test-mapping/build.sbt @@ -2,9 +2,9 @@ enablePlugins(DebianPlugin) name := "debian-test" -name in Debian := "debian-test-override" +Debian / name := "debian-test-override" -packageName in Linux := "debian-test-package" +Linux / packageName := "debian-test-package" version := "0.1.0" @@ -15,9 +15,9 @@ packageSummary := "Test debian package" packageDescription := """A fun package description of our software, with multiple lines.""" -debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11)") +Debian / debianPackageDependencies ++= Seq("java2-runtime", "bash (>= 2.05a-11)") -debianPackageRecommends in Debian += "git" +Debian / debianPackageRecommends += "git" TaskKey[Unit]("checkControlScript") := { val script = diff --git a/src/sbt-test/debian/test-packageName/build.sbt b/src/sbt-test/debian/test-packageName/build.sbt index 83c67049a..496cd814c 100644 --- a/src/sbt-test/debian/test-packageName/build.sbt +++ b/src/sbt-test/debian/test-packageName/build.sbt @@ -2,9 +2,9 @@ enablePlugins(JavaServerAppPackaging) name := "debian-test" -name in Debian := "debian-test-override" +Debian / name := "debian-test-override" -packageName in Linux := "debian-test-package" +Linux / packageName := "debian-test-package" version := "0.1.0" @@ -15,9 +15,9 @@ packageSummary := "Test debian package" packageDescription := """A fun package description of our software, with multiple lines.""" -debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11)") +Debian / debianPackageDependencies ++= Seq("java2-runtime", "bash (>= 2.05a-11)") -debianPackageRecommends in Debian += "git" +Debian / debianPackageRecommends += "git" TaskKey[Unit]("checkControlScript") := { val script = diff --git a/src/sbt-test/debian/upstart-deb-facilities/build.sbt b/src/sbt-test/debian/upstart-deb-facilities/build.sbt index fa3f1a18f..730ac22f2 100644 --- a/src/sbt-test/debian/upstart-deb-facilities/build.sbt +++ b/src/sbt-test/debian/upstart-deb-facilities/build.sbt @@ -1,12 +1,12 @@ enablePlugins(JavaServerAppPackaging, UpstartPlugin) -daemonUser in Debian := "root" +Debian / daemonUser := "root" -mainClass in Compile := Some("empty") +Compile / mainClass := Some("empty") name := "debian-test" -name in Debian := "debian-test" +Debian / name := "debian-test" version := "0.1.0" @@ -14,9 +14,9 @@ maintainer := "Josh Suereth " packageSummary := "Test debian package" -requiredStartFacilities in Debian := Some("[networking]") +Debian / requiredStartFacilities := Some("[networking]") -requiredStopFacilities in Debian := Some("[networking]") +Debian / requiredStopFacilities := Some("[networking]") packageDescription := """A fun package description of our software, with multiple lines.""" diff --git a/src/sbt-test/debian/upstart-deb/build.sbt b/src/sbt-test/debian/upstart-deb/build.sbt index f9abaff2c..11447b89a 100644 --- a/src/sbt-test/debian/upstart-deb/build.sbt +++ b/src/sbt-test/debian/upstart-deb/build.sbt @@ -1,10 +1,10 @@ enablePlugins(JavaServerAppPackaging, UpstartPlugin) // TODO change this after #437 is fixed -daemonUser in Linux := "root" -daemonGroup in Linux := "app-group" +Linux / daemonUser := "root" +Linux / daemonGroup := "app-group" -mainClass in Compile := Some("empty") +Compile / mainClass := Some("empty") name := "debian-test" version := "0.1.0" diff --git a/src/sbt-test/docker/build-command/build.sbt b/src/sbt-test/docker/build-command/build.sbt index d40cfc166..a12111e74 100644 --- a/src/sbt-test/docker/build-command/build.sbt +++ b/src/sbt-test/docker/build-command/build.sbt @@ -5,5 +5,5 @@ name := "docker-build-command-test" version := "0.1.0" import NativePackagerHelper._ -mappings in Docker ++= directory("src/main/resources/docker-test") +Docker / mappings ++= directory("src/main/resources/docker-test") dockerBuildCommand := Seq("docker", "build", "-t", "docker-build-command-test:0.1.0", "docker-test/") diff --git a/src/sbt-test/docker/envVars/build.sbt b/src/sbt-test/docker/envVars/build.sbt index e3f076a9c..499f4e7e3 100644 --- a/src/sbt-test/docker/envVars/build.sbt +++ b/src/sbt-test/docker/envVars/build.sbt @@ -7,7 +7,7 @@ version := "0.1.0" dockerEnvVars := Map("FOO" -> "bar", "FOO_BAR" -> "foo bar", "NUMBER" -> "123") TaskKey[Unit]("checkDockerfile") := { - val dockerfile = IO.read((stagingDirectory in Docker).value / "Dockerfile") + val dockerfile = IO.read((Docker / stagingDirectory).value / "Dockerfile") assert(dockerfile contains """ENV FOO="bar"""", s"does not contain foo=bar\n$dockerfile") assert(dockerfile contains """ENV FOO_BAR="foo bar"""", s"does not contain foo=bar\n$dockerfile") diff --git a/src/sbt-test/docker/file-permission/build.sbt b/src/sbt-test/docker/file-permission/build.sbt index 842a4f26b..779c5998f 100644 --- a/src/sbt-test/docker/file-permission/build.sbt +++ b/src/sbt-test/docker/file-permission/build.sbt @@ -11,7 +11,7 @@ lazy val root = (project in file(".")) name := "file-permission-test", version := "0.1.0", checkDockerfileDefaults := { - val dockerfile = IO.read((stagingDirectory in Docker).value / "Dockerfile") + val dockerfile = IO.read((Docker / stagingDirectory).value / "Dockerfile") val lines = dockerfile.linesIterator.toList assertEquals( lines.take(2), @@ -41,7 +41,7 @@ lazy val root = (project in file(".")) ) }, checkDockerfileWithStrategyNone := { - val dockerfile = IO.read((stagingDirectory in Docker).value / "Dockerfile") + val dockerfile = IO.read((Docker / stagingDirectory).value / "Dockerfile") val lines = dockerfile.linesIterator.toList assertEquals( lines, @@ -57,7 +57,7 @@ lazy val root = (project in file(".")) ) }, checkDockerfileWithStrategyNoneGid := { - val dockerfile = IO.read((stagingDirectory in Docker).value / "Dockerfile") + val dockerfile = IO.read((Docker / stagingDirectory).value / "Dockerfile") val lines = dockerfile.linesIterator.toList assertEquals( lines, @@ -73,7 +73,7 @@ lazy val root = (project in file(".")) ) }, checkDockerfileWithStrategyRun := { - val dockerfile = IO.read((stagingDirectory in Docker).value / "Dockerfile") + val dockerfile = IO.read((Docker / stagingDirectory).value / "Dockerfile") val lines = dockerfile.linesIterator.toList assertEquals( lines, @@ -91,7 +91,7 @@ lazy val root = (project in file(".")) ) }, checkDockerfileWithStrategyCopyChown := { - val dockerfile = IO.read((stagingDirectory in Docker).value / "Dockerfile") + val dockerfile = IO.read((Docker / stagingDirectory).value / "Dockerfile") val lines = dockerfile.linesIterator.toList assertEquals( lines, @@ -105,7 +105,7 @@ lazy val root = (project in file(".")) ) }, checkDockerfileWithWriteExecute := { - val dockerfile = IO.read((stagingDirectory in Docker).value / "Dockerfile") + val dockerfile = IO.read((Docker / stagingDirectory).value / "Dockerfile") val lines = dockerfile.linesIterator.toList assertEquals( lines.take(2), diff --git a/src/sbt-test/docker/file-permission/changes/strategy-copychown.sbt b/src/sbt-test/docker/file-permission/changes/strategy-copychown.sbt index 5deaad93c..8fb34e70b 100644 --- a/src/sbt-test/docker/file-permission/changes/strategy-copychown.sbt +++ b/src/sbt-test/docker/file-permission/changes/strategy-copychown.sbt @@ -4,5 +4,5 @@ dockerPermissionStrategy := DockerPermissionStrategy.CopyChown dockerBaseImage := "fabric8/java-centos-openjdk8-jdk" // opt-out of numeric USER -daemonUserUid in Docker := None -daemonUser in Docker := "daemon" +Docker / daemonUserUid := None +Docker / daemonUser := "daemon" diff --git a/src/sbt-test/docker/file-permission/changes/strategy-none-gid.sbt b/src/sbt-test/docker/file-permission/changes/strategy-none-gid.sbt index 3a1d8bc8c..3ee082b4a 100644 --- a/src/sbt-test/docker/file-permission/changes/strategy-none-gid.sbt +++ b/src/sbt-test/docker/file-permission/changes/strategy-none-gid.sbt @@ -3,5 +3,5 @@ import com.typesafe.sbt.packager.docker._ dockerPermissionStrategy := DockerPermissionStrategy.None dockerBaseImage := "fabric8/java-centos-openjdk8-jdk" -daemonGroupGid in Docker := Some("5000") -daemonGroup in Docker := "sbt" +Docker / daemonGroupGid := Some("5000") +Docker / daemonGroup := "sbt" diff --git a/src/sbt-test/docker/jdk-versions/build.sbt b/src/sbt-test/docker/jdk-versions/build.sbt index 5832320a8..5b02efec7 100644 --- a/src/sbt-test/docker/jdk-versions/build.sbt +++ b/src/sbt-test/docker/jdk-versions/build.sbt @@ -1,6 +1,6 @@ val basename = "jdk-versions" -scalacOptions in ThisBuild in (Compile, compile) := Seq("-target:jvm-1.8") +ThisBuild / Compile / compile / scalacOptions := Seq("-target:jvm-1.8") lazy val `jdk8` = project .in(file("jdk8")) diff --git a/src/sbt-test/docker/labels/build.sbt b/src/sbt-test/docker/labels/build.sbt index 5b3497d05..923cccd8e 100644 --- a/src/sbt-test/docker/labels/build.sbt +++ b/src/sbt-test/docker/labels/build.sbt @@ -7,7 +7,7 @@ version := "0.1.0" dockerLabels := Map("foo" -> "bar", "fooBar" -> "foo bar", "number" -> "123") TaskKey[Unit]("checkDockerfile") := { - val dockerfile = IO.read((stagingDirectory in Docker).value / "Dockerfile") + val dockerfile = IO.read((Docker / stagingDirectory).value / "Dockerfile") assert(dockerfile contains """LABEL foo="bar"""", s"does not contain foo=bar\n$dockerfile") assert(dockerfile contains """LABEL fooBar="foo bar"""", s"does not contain foo=bar\n$dockerfile") diff --git a/src/sbt-test/docker/test-busybox-create-user/build.sbt b/src/sbt-test/docker/test-busybox-create-user/build.sbt index 1dbab3d03..cfd295456 100644 --- a/src/sbt-test/docker/test-busybox-create-user/build.sbt +++ b/src/sbt-test/docker/test-busybox-create-user/build.sbt @@ -6,7 +6,7 @@ version := "0.1.0" maintainer := "Boris Capitanu " dockerBaseImage := "anapsix/alpine-java:8" -daemonUserUid in Docker := Some("2000") -daemonUser in Docker := "appuser" -daemonGroupGid in Docker := Some("3000") -daemonGroup in Docker := "appgroup" +Docker / daemonUserUid := Some("2000") +Docker / daemonUser := "appuser" +Docker / daemonGroupGid := Some("3000") +Docker / daemonGroup := "appgroup" diff --git a/src/sbt-test/docker/test-executableScriptName/build.sbt b/src/sbt-test/docker/test-executableScriptName/build.sbt index dbb35005d..e93b103d3 100644 --- a/src/sbt-test/docker/test-executableScriptName/build.sbt +++ b/src/sbt-test/docker/test-executableScriptName/build.sbt @@ -2,7 +2,7 @@ enablePlugins(JavaAppPackaging) name := "docker-test" -packageName in Docker := "docker-package" +Docker / packageName := "docker-package" executableScriptName := "docker-exec" @@ -11,7 +11,7 @@ version := "0.1.0" maintainer := "Gary Coady " TaskKey[Unit]("checkDockerfile") := { - val dockerfile = IO.read((stagingDirectory in Docker).value / "Dockerfile") + val dockerfile = IO.read((Docker / stagingDirectory).value / "Dockerfile") assert( dockerfile.contains("ENTRYPOINT [\"/opt/docker/bin/docker-exec\"]\n"), "dockerfile doesn't contain ENTRYPOINT [\"/opt/docker/bin/docker-test\"]\n" + dockerfile diff --git a/src/sbt-test/docker/test-layer-groups/build.sbt b/src/sbt-test/docker/test-layer-groups/build.sbt index fce09329f..52dac99fe 100644 --- a/src/sbt-test/docker/test-layer-groups/build.sbt +++ b/src/sbt-test/docker/test-layer-groups/build.sbt @@ -4,7 +4,7 @@ organization := "com.example" name := "docker-groups" version := "0.1.0" -dockerPackageMappings in Docker ++= Seq( +Docker / dockerPackageMappings ++= Seq( (baseDirectory.value / "docker" / "spark-env.sh") -> "/opt/docker/spark/spark-env.sh", (baseDirectory.value / "docker" / "log4j.properties") -> "/opt/docker/other/log4j.properties" ) @@ -12,7 +12,7 @@ dockerPackageMappings in Docker ++= Seq( libraryDependencies += "org.slf4j" % "slf4j-api" % "1.7.30" TaskKey[Unit]("checkDockerfile") := { - val dockerfile = IO.read((stagingDirectory in Docker).value / "Dockerfile") + val dockerfile = IO.read((Docker / stagingDirectory).value / "Dockerfile") val copyLines = dockerfile.linesIterator.toList.filter(_.startsWith("COPY --from=stage0")) assertEquals( copyLines, @@ -24,7 +24,7 @@ TaskKey[Unit]("checkDockerfile") := { } TaskKey[Unit]("checkDockerfileWithNoLayers") := { - val dockerfile = IO.read((stagingDirectory in Docker).value / "Dockerfile") + val dockerfile = IO.read((Docker / stagingDirectory).value / "Dockerfile") val copyLines = dockerfile.linesIterator.toList.filter(_.startsWith("COPY --from=stage0")) assertEquals( copyLines, diff --git a/src/sbt-test/docker/test-layer-groups/changes/nolayers.sbt b/src/sbt-test/docker/test-layer-groups/changes/nolayers.sbt index 7e43f316b..63aca974f 100644 --- a/src/sbt-test/docker/test-layer-groups/changes/nolayers.sbt +++ b/src/sbt-test/docker/test-layer-groups/changes/nolayers.sbt @@ -1 +1 @@ -dockerGroupLayers in Docker := PartialFunction.empty +Docker / dockerGroupLayers := PartialFunction.empty diff --git a/src/sbt-test/docker/test-layer-groups/layers.sbt b/src/sbt-test/docker/test-layer-groups/layers.sbt index 2a7514237..353d0ea8f 100644 --- a/src/sbt-test/docker/test-layer-groups/layers.sbt +++ b/src/sbt-test/docker/test-layer-groups/layers.sbt @@ -1,6 +1,6 @@ -dockerGroupLayers in Docker := { - val dockerBaseDirectory = (defaultLinuxInstallLocation in Docker).value - (dockerGroupLayers in Docker).value.orElse { +Docker / dockerGroupLayers := { + val dockerBaseDirectory = (Docker / defaultLinuxInstallLocation).value + (Docker / dockerGroupLayers).value.orElse { case (_, path) if path.startsWith(dockerBaseDirectory + "/spark/") => 54 } } diff --git a/src/sbt-test/docker/test-packageName-universal/build.sbt b/src/sbt-test/docker/test-packageName-universal/build.sbt index 8b77a153a..84ac4ed5c 100644 --- a/src/sbt-test/docker/test-packageName-universal/build.sbt +++ b/src/sbt-test/docker/test-packageName-universal/build.sbt @@ -9,7 +9,7 @@ version := "0.1.0" maintainer := "Gary Coady " TaskKey[Unit]("checkDockerfile") := { - val dockerfile = IO.read((stagingDirectory in Docker).value / "Dockerfile") + val dockerfile = IO.read((Docker / stagingDirectory).value / "Dockerfile") assert( dockerfile.contains("ENTRYPOINT [\"/opt/docker/bin/docker-test\"]\n"), "dockerfile doesn't contain ENTRYPOINT [\"/opt/docker/bin/docker-test\"]\n" + dockerfile diff --git a/src/sbt-test/docker/test-packageName/build.sbt b/src/sbt-test/docker/test-packageName/build.sbt index 4bf7c7698..4ffd57103 100644 --- a/src/sbt-test/docker/test-packageName/build.sbt +++ b/src/sbt-test/docker/test-packageName/build.sbt @@ -4,14 +4,14 @@ organization := "com.example" name := "docker-test" // packageName := "docker-package" // sets the executable script, too -packageName in Docker := "docker-package" +Docker / packageName := "docker-package" version := "0.1.0" maintainer := "Gary Coady " TaskKey[Unit]("checkDockerfile") := { - val dockerfile = IO.read((stagingDirectory in Docker).value / "Dockerfile") + val dockerfile = IO.read((Docker / stagingDirectory).value / "Dockerfile") assert( dockerfile.contains("ENTRYPOINT [\"/opt/docker/bin/docker-test\"]\n"), "dockerfile doesn't contain ENTRYPOINT [\"/opt/docker/bin/docker-test\"]\n" + dockerfile diff --git a/src/sbt-test/jar/classpath-jar/build.sbt b/src/sbt-test/jar/classpath-jar/build.sbt index 798d57d0d..9b644b2c1 100644 --- a/src/sbt-test/jar/classpath-jar/build.sbt +++ b/src/sbt-test/jar/classpath-jar/build.sbt @@ -10,7 +10,7 @@ version := "0.1.0" libraryDependencies += "com.typesafe" % "config" % "1.3.1" TaskKey[Unit]("checkClasspath") := { - val dir = (stagingDirectory in Universal).value + val dir = (Universal / stagingDirectory).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") @@ -19,7 +19,7 @@ TaskKey[Unit]("checkClasspath") := { } TaskKey[Unit]("runCheck") := { - val dir = (stagingDirectory in Universal).value + val dir = (Universal / stagingDirectory).value val cmd = if (System.getProperty("os.name").contains("Windows")) { Seq("cmd", "/c", (dir / "bin" / "classpath-jar-test.bat").getAbsolutePath) } else { 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 cbe8bab0f..d5cd2678a 100644 --- a/src/sbt-test/jar/launcher-jar with spaces/build.sbt +++ b/src/sbt-test/jar/launcher-jar with spaces/build.sbt @@ -8,7 +8,7 @@ version := "0.1.0" libraryDependencies += "com.typesafe" % "config" % "1.3.1" TaskKey[Unit]("checkClasspath") := { - val dir = (stagingDirectory in Universal).value + val dir = (Universal / stagingDirectory).value val bat = IO.read(dir / "bin" / "launcher-jar-test.bat") assert(bat contains "set \"APP_CLASSPATH=\"", "bat should set APP_CLASSPATH:\n" + bat) assert( @@ -35,7 +35,7 @@ TaskKey[Unit]("checkClasspath") := { } TaskKey[Unit]("runCheck") := { - val dir = (stagingDirectory in Universal).value + val dir = (Universal / stagingDirectory).value val cmd = if (System.getProperty("os.name").contains("Windows")) { Seq("cmd", "/c", (dir / "bin" / "launcher-jar-test.bat").getAbsolutePath) } else { diff --git a/src/sbt-test/jar/launcher-jar/build.sbt b/src/sbt-test/jar/launcher-jar/build.sbt index 932addcbd..057c6a579 100644 --- a/src/sbt-test/jar/launcher-jar/build.sbt +++ b/src/sbt-test/jar/launcher-jar/build.sbt @@ -10,7 +10,7 @@ version := "0.1.0" libraryDependencies += "com.typesafe" % "config" % "1.3.1" TaskKey[Unit]("checkClasspath") := { - val dir = (stagingDirectory in Universal).value + val dir = (Universal / stagingDirectory).value val bat = IO.read(dir / "bin" / "launcher-jar-test.bat") assert(bat contains "set \"APP_CLASSPATH=\"", "bat should set APP_CLASSPATH:\n" + bat) assert( @@ -37,7 +37,7 @@ TaskKey[Unit]("checkClasspath") := { } TaskKey[Unit]("runCheck") := { - val dir = (stagingDirectory in Universal).value + val dir = (Universal / stagingDirectory).value val cmd = if (System.getProperty("os.name").contains("Windows")) { Seq("cmd", "/c", (dir / "bin" / "launcher-jar-test.bat").getAbsolutePath) } else { diff --git a/src/sbt-test/jdkpackager/test-package-image/build.sbt b/src/sbt-test/jdkpackager/test-package-image/build.sbt index f809f7c31..0707d0db2 100644 --- a/src/sbt-test/jdkpackager/test-package-image/build.sbt +++ b/src/sbt-test/jdkpackager/test-package-image/build.sbt @@ -6,7 +6,7 @@ version := "0.1.0" organization := "com.foo.bar" -mainClass in Compile := Some("ExampleApp") +Compile / mainClass := Some("ExampleApp") maintainer := "Previously Owned Cats, Inc." @@ -44,7 +44,7 @@ TaskKey[Unit]("checkImage") := { case osys if osys.contains("win") ⇒ (".exe", 'windows) case _ ⇒ ("", 'linux) } - val expectedImage = (target in JDKPackager).value / "bundles" / (name.value + extension) + val expectedImage = (JDKPackager / target).value / "bundles" / (name.value + extension) println(s"Checking for '${expectedImage.getAbsolutePath}'") assert(expectedImage.exists, s"Expected image file to be found at '$expectedImage'") diff --git a/src/sbt-test/jdkpackager/test-package-mappings/build.sbt b/src/sbt-test/jdkpackager/test-package-mappings/build.sbt index 3bcea394f..9e184bf2f 100644 --- a/src/sbt-test/jdkpackager/test-package-mappings/build.sbt +++ b/src/sbt-test/jdkpackager/test-package-mappings/build.sbt @@ -6,7 +6,7 @@ version := "0.1.1" organization := "com.foo.bar" -mainClass in Compile := Some("ExampleApp") +Compile / mainClass := Some("ExampleApp") maintainer := "Cat D. Herder" @@ -16,9 +16,9 @@ packageDescription := "Test JDKPackagerPlugin with mappings" jdkPackagerType := "image" -mappings in Universal += baseDirectory.value / "src" / "deploy" / "README.md" -> "README.md" +Universal / mappings += baseDirectory.value / "src" / "deploy" / "README.md" -> "README.md" -mappings in Universal ++= { +Universal / mappings ++= { val dir = baseDirectory.value / "src" / "deploy" / "stuff" (dir.**(AllPassFilter) --- dir) pair (file => IO.relativize(dir.getParentFile, file)) } @@ -38,7 +38,7 @@ TaskKey[Unit]("checkImage") := { case osys if osys.contains("win") ⇒ (".exe", 'windows) case _ ⇒ ("", 'linux) } - val expectedImage = (target in JDKPackager).value / "bundles" / (name.value + extension) + val expectedImage = (JDKPackager / target).value / "bundles" / (name.value + extension) println(s"Checking for '${expectedImage.getAbsolutePath}'") assert(expectedImage.exists, s"Expected image file to be found at '$expectedImage'") diff --git a/src/sbt-test/jdkpackager/test-package-minimal/build.sbt b/src/sbt-test/jdkpackager/test-package-minimal/build.sbt index 9a8bbdb79..87c1909d6 100644 --- a/src/sbt-test/jdkpackager/test-package-minimal/build.sbt +++ b/src/sbt-test/jdkpackager/test-package-minimal/build.sbt @@ -2,7 +2,7 @@ enablePlugins(JDKPackagerPlugin) -mainClass in Compile := Some("ExampleApp") +Compile / mainClass := Some("ExampleApp") jdkPackagerType := "image" @@ -12,7 +12,7 @@ TaskKey[Unit]("checkImage") := { case os if os.contains("win") ⇒ ".exe" case _ ⇒ "" } - val expectedImage = (target in JDKPackager).value / "bundles" / (name.value + extension) + val expectedImage = (JDKPackager / target).value / "bundles" / (name.value + extension) println(s"Checking for '${expectedImage.getAbsolutePath}'") assert(expectedImage.exists, s"Expected image file to be found at '$expectedImage'") } diff --git a/src/sbt-test/jlink/test-jlink-minimal/build.sbt b/src/sbt-test/jlink/test-jlink-minimal/build.sbt index 9f8b6a3e2..7e598800f 100644 --- a/src/sbt-test/jlink/test-jlink-minimal/build.sbt +++ b/src/sbt-test/jlink/test-jlink-minimal/build.sbt @@ -7,7 +7,7 @@ enablePlugins(JlinkPlugin, ClasspathJarPlugin, BashStartScriptPlugin, BatStartSc // Exclude Scala to avoid linking additional modules autoScalaLibrary := false -mappings in (Compile, packageDoc) := Seq() +(Compile / packageDoc / mappings) := Seq() TaskKey[Unit]("runChecks") := { val log = streams.value.log @@ -23,7 +23,7 @@ TaskKey[Unit]("runChecks") := { case _ ⇒ ("", 'linux) } - val stageDir = stagingDirectory.in(Universal).value + val stageDir = (Universal / stagingDirectory).value val bundledJvmDir = (stageDir / "jre") val javaExe = (bundledJvmDir / "bin" / ("java" + extension)).getAbsolutePath diff --git a/src/sbt-test/jlink/test-jlink-misc/build.sbt b/src/sbt-test/jlink/test-jlink-misc/build.sbt index 9b764d807..8abb6fbd9 100644 --- a/src/sbt-test/jlink/test-jlink-misc/build.sbt +++ b/src/sbt-test/jlink/test-jlink-misc/build.sbt @@ -8,7 +8,7 @@ val runChecks = taskKey[Unit]("Run checks for a specific issue") val runFailingChecks = taskKey[Unit]("Run checks for a specific issue, expecting them to fail") // Exclude Scala by default to simplify the test. -autoScalaLibrary in ThisBuild := false +ThisBuild / autoScalaLibrary := false // Should succeed for multi-release artifacts val issue1243 = project @@ -28,7 +28,7 @@ val issue1243 = project val issue1247BadAutoModuleName = project .enablePlugins(JlinkPlugin) .settings( - managedClasspath in Compile += { + Compile / managedClasspath += { // Build an empty jar with an unsupported name val jarFile = target.value / "foo_2.11.jar" IO.jar(Nil, jarFile, new java.util.jar.Manifest) @@ -72,12 +72,12 @@ val issue1266 = project libraryDependencies += "com.sun.xml.fastinfoset" % "FastInfoset" % "1.2.16", // A lot of "dummy" dependencies, so that the resulting classpath is over // the command line limit (2MB on my machine) - unmanagedJars in Compile ++= { + Compile / unmanagedJars ++= { def mkPath(ix: Int) = target.value / s"there-is-no-such-file-$ix.jar" 1.to(300000).map(mkPath) }, - logLevel in jlinkModules := Level.Error, + jlinkModules / logLevel := Level.Error, runChecks := jlinkBuildImage.value ) @@ -106,8 +106,7 @@ val issue1293 = project // Use `paramaner` (and only it) as an automatic module jlinkModulePath := { // Get the full classpath with all the resolved dependencies. - fullClasspath - .in(jlinkBuildImage) + (jlinkBuildImage / fullClasspath) .value // Find the ones that have `paranamer` as their artifact names. .filter { item => diff --git a/src/sbt-test/jlink/test-jlink-missing-deps/build.sbt b/src/sbt-test/jlink/test-jlink-missing-deps/build.sbt index b00ff4b18..1d357afc1 100644 --- a/src/sbt-test/jlink/test-jlink-missing-deps/build.sbt +++ b/src/sbt-test/jlink/test-jlink-missing-deps/build.sbt @@ -4,7 +4,7 @@ import scala.sys.process.Process import com.typesafe.sbt.packager.Compat._ // Exclude Scala to simplify the test -autoScalaLibrary in ThisBuild := false +ThisBuild / autoScalaLibrary := false // Simulate a missing dependency (foo -> bar) lazy val foo = project.dependsOn(bar % "provided") diff --git a/src/sbt-test/rpm/config-no-replace/build.sbt b/src/sbt-test/rpm/config-no-replace/build.sbt index 8da1e0a99..772876a33 100644 --- a/src/sbt-test/rpm/config-no-replace/build.sbt +++ b/src/sbt-test/rpm/config-no-replace/build.sbt @@ -21,12 +21,12 @@ rpmUrl := Some("http://github.com/sbt/sbt-native-packager") rpmLicense := Some("BSD") -packageArchitecture in Rpm := "x86_64" +Rpm / packageArchitecture := "x86_64" linuxPackageMappings := configWithNoReplace(linuxPackageMappings.value) TaskKey[Unit]("unzip") := { - val rpmPath = Seq((packageBin in Rpm).value.getAbsolutePath) + val rpmPath = Seq((Rpm / packageBin).value.getAbsolutePath) 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-systemd/build.sbt b/src/sbt-test/rpm/override-start-script-systemd/build.sbt index 0a013d7bd..8a8c3b250 100644 --- a/src/sbt-test/rpm/override-start-script-systemd/build.sbt +++ b/src/sbt-test/rpm/override-start-script-systemd/build.sbt @@ -26,7 +26,7 @@ rpmLicense := Some("BSD") rpmGroup := Some("test-group") TaskKey[Unit]("unzip") := { - val rpmPath = Seq((packageBin in Rpm).value.getAbsolutePath) + val rpmPath = Seq((Rpm / packageBin).value.getAbsolutePath) 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 53d393649..8f7e3f375 100644 --- a/src/sbt-test/rpm/override-start-script-systemv/build.sbt +++ b/src/sbt-test/rpm/override-start-script-systemv/build.sbt @@ -26,7 +26,7 @@ rpmLicense := Some("BSD") rpmGroup := Some("test-group") TaskKey[Unit]("unzip") := { - val rpmPath = Seq((packageBin in Rpm).value.getAbsolutePath) + val rpmPath = Seq((Rpm / packageBin).value.getAbsolutePath) 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 80f1aaf85..65f7f82e6 100644 --- a/src/sbt-test/rpm/override-start-script-upstart/build.sbt +++ b/src/sbt-test/rpm/override-start-script-upstart/build.sbt @@ -26,7 +26,7 @@ rpmLicense := Some("BSD") rpmGroup := Some("test-group") TaskKey[Unit]("unzip") := { - val rpmPath = Seq((packageBin in Rpm).value.getAbsolutePath) + val rpmPath = Seq((Rpm / packageBin).value.getAbsolutePath) 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 35d0afb7d..3cfd264a1 100644 --- a/src/sbt-test/rpm/path-override-rpm/build.sbt +++ b/src/sbt-test/rpm/path-override-rpm/build.sbt @@ -23,7 +23,7 @@ defaultLinuxInstallLocation := "/opt/test" defaultLinuxLogsLocation := "/opt/test/log" TaskKey[Unit]("unzip") := { - val rpmPath = Seq((packageBin in Rpm).value.getAbsolutePath) + val rpmPath = Seq((Rpm / packageBin).value.getAbsolutePath) sys.process.Process("rpm2cpio", rpmPath) #| sys.process.Process("cpio -i --make-directories") ! streams.value.log () } 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 2cdf94fd2..7a8d7c861 100644 --- a/src/sbt-test/rpm/scriptlets-override-build-rpm/build.sbt +++ b/src/sbt-test/rpm/scriptlets-override-build-rpm/build.sbt @@ -20,7 +20,7 @@ rpmUrl := Some("http://github.com/sbt/sbt-native-packager") rpmLicense := Some("BSD") -maintainerScripts in Rpm := Map( +Rpm / maintainerScripts := Map( Pre -> Seq("""echo "pre-install""""), Post -> Seq("""echo "post-install""""), Pretrans -> Seq("""echo "pretrans""""), diff --git a/src/sbt-test/rpm/scriptlets-override-rpm/build.sbt b/src/sbt-test/rpm/scriptlets-override-rpm/build.sbt index 895831d8a..0d71a41e7 100644 --- a/src/sbt-test/rpm/scriptlets-override-rpm/build.sbt +++ b/src/sbt-test/rpm/scriptlets-override-rpm/build.sbt @@ -14,10 +14,10 @@ rpmVendor := "typesafe" rpmUrl := Some("http://github.com/sbt/sbt-native-packager") rpmLicense := Some("BSD") -mainClass in (Compile, run) := Some("com.example.MainApp") +(Compile / run / mainClass) := Some("com.example.MainApp") TaskKey[Unit]("unzipAndCheck") := { - val rpmFile = (packageBin in Rpm).value + val rpmFile = (Rpm / packageBin).value val rpmPath = Seq(rpmFile.getAbsolutePath) 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 diff --git a/src/sbt-test/rpm/scriptlets-rpm/build.sbt b/src/sbt-test/rpm/scriptlets-rpm/build.sbt index f667518f6..e4f0c6421 100644 --- a/src/sbt-test/rpm/scriptlets-rpm/build.sbt +++ b/src/sbt-test/rpm/scriptlets-rpm/build.sbt @@ -23,7 +23,7 @@ rpmUrl := Some("http://github.com/sbt/sbt-native-packager") rpmLicense := Some("BSD") -maintainerScripts in Rpm := Map( +Rpm / maintainerScripts := Map( Pre -> Seq("""echo "pre-install""""), Post -> Seq("""echo "post-install""""), Pretrans -> Seq("""echo "pretrans""""), diff --git a/src/sbt-test/rpm/setarch-rpm/build.sbt b/src/sbt-test/rpm/setarch-rpm/build.sbt index 94dba6fc2..7f2e542e6 100644 --- a/src/sbt-test/rpm/setarch-rpm/build.sbt +++ b/src/sbt-test/rpm/setarch-rpm/build.sbt @@ -7,7 +7,7 @@ version := "0.1.0" maintainer := "David Pennell " packageSummary := "Test rpm package" -packageName in Linux := "rpm-package" +Linux / packageName := "rpm-package" packageDescription := """A fun package description of our software, with multiple lines.""" @@ -15,13 +15,13 @@ rpmRelease := "1" rpmVendor := "typesafe" rpmUrl := Some("http://github.com/sbt/sbt-native-packager") rpmLicense := Some("BSD") -packageArchitecture in Rpm := "i386" +Rpm / packageArchitecture := "i386" rpmSetarch := Some("i386") linuxPackageMappings := { val helloMapping = LinuxPackageMapping( - Seq(((resourceDirectory in Compile).value / "hello-32bit", "/usr/share/rpm-package/libexec/hello-32bit")) + Seq(((Compile / resourceDirectory).value / "hello-32bit", "/usr/share/rpm-package/libexec/hello-32bit")) ) withPerms "0755" linuxPackageMappings.value :+ helloMapping } diff --git a/src/sbt-test/rpm/simple-rpm/build.sbt b/src/sbt-test/rpm/simple-rpm/build.sbt index 963454439..be5af2999 100644 --- a/src/sbt-test/rpm/simple-rpm/build.sbt +++ b/src/sbt-test/rpm/simple-rpm/build.sbt @@ -23,15 +23,15 @@ rpmLicense := Some("BSD") rpmEpoch := Some(1) -packageArchitecture in Rpm := "x86_64" +Rpm / packageArchitecture := "x86_64" -linuxPackageMappings in Rpm := { +Rpm / linuxPackageMappings := { val mapping1 = ((baseDirectory.value / "test"), "tmp/test") val mapping2 = ((baseDirectory.value / "build.sbt"), "/tmp/build.sbt") Seq(LinuxPackageMapping(Seq(mapping1, mapping2))) } -defaultLinuxInstallLocation in Rpm := "/opt/foo" +Rpm / defaultLinuxInstallLocation := "/opt/foo" TaskKey[Unit]("checkSpecFile") := { val spec = IO.read(target.value / "rpm" / "SPECS" / "rpm-test.spec") diff --git a/src/sbt-test/rpm/snapshot-override-rpm/build.sbt b/src/sbt-test/rpm/snapshot-override-rpm/build.sbt index fa3da01e4..e4cf2b142 100644 --- a/src/sbt-test/rpm/snapshot-override-rpm/build.sbt +++ b/src/sbt-test/rpm/snapshot-override-rpm/build.sbt @@ -17,10 +17,10 @@ rpmUrl := Some("http://github.com/sbt/sbt-native-packager") rpmLicense := Some("BSD") -version in Rpm := "1" +Rpm / version := "1" 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}") + assert((Rpm / version).value == "1", s"RPM has incorrect value ${(Rpm / version).value}") } diff --git a/src/sbt-test/rpm/symlink-rpm/build.sbt b/src/sbt-test/rpm/symlink-rpm/build.sbt index 1c86c4bf5..714d7abc4 100644 --- a/src/sbt-test/rpm/symlink-rpm/build.sbt +++ b/src/sbt-test/rpm/symlink-rpm/build.sbt @@ -6,7 +6,7 @@ name := "rpm-test" version := "0.1.0" maintainer := "David Pennell " packageSummary := "Test rpm package" -packageName in Linux := "rpm-package" +Linux / packageName := "rpm-package" packageDescription := """A fun package description of our software, with multiple lines.""" @@ -18,7 +18,7 @@ rpmLicense := Some("BSD") linuxPackageSymlinks := { val helloSymlink = LinuxSymlink( - ((file(defaultLinuxInstallLocation.value) / (packageName in Linux).value / "lib") / "hello.link").toString, + ((file(defaultLinuxInstallLocation.value) / (Linux / packageName).value / "lib") / "hello.link").toString, "/fake/hello.tx" ) Seq(helloSymlink) diff --git a/src/sbt-test/rpm/systemd-rpm/build.sbt b/src/sbt-test/rpm/systemd-rpm/build.sbt index 334d4ddf6..4c1bb9517 100644 --- a/src/sbt-test/rpm/systemd-rpm/build.sbt +++ b/src/sbt-test/rpm/systemd-rpm/build.sbt @@ -16,10 +16,10 @@ rpmUrl := Some("http://github.com/sbt/sbt-native-packager") rpmLicense := Some("BSD") rpmGroup := Some("test-group") -requiredStartFacilities in Rpm := Some("serviceA.service") +Rpm / requiredStartFacilities := Some("serviceA.service") TaskKey[Unit]("unzip") := { - val rpmPath = Seq((packageBin in Rpm).value.getAbsolutePath) + val rpmPath = Seq((Rpm / packageBin).value.getAbsolutePath) sys.process.Process("rpm2cpio", rpmPath) #| sys.process.Process("cpio -i --make-directories") ! streams.value.log () } diff --git a/src/sbt-test/rpm/sysvinit-rpm/build.sbt b/src/sbt-test/rpm/sysvinit-rpm/build.sbt index 3b5f217f1..1754a2ff7 100644 --- a/src/sbt-test/rpm/sysvinit-rpm/build.sbt +++ b/src/sbt-test/rpm/sysvinit-rpm/build.sbt @@ -16,13 +16,13 @@ rpmLicense := Some("BSD") rpmGroup := Some("test-group") rpmDaemonLogFile := "test.log" -mainClass in (Compile, run) := Some("com.example.MainApp") +(Compile / run / mainClass) := Some("com.example.MainApp") TaskKey[Unit]("unzipAndCheck") := { - val rpmPath = Seq((packageBin in Rpm).value.getAbsolutePath) + val rpmPath = Seq((Rpm / packageBin).value.getAbsolutePath) 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 + sys.process.Process("rpm -qp --scripts " + (Rpm / packageBin).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) diff --git a/src/sbt-test/rpm/test-artifactPath/build.sbt b/src/sbt-test/rpm/test-artifactPath/build.sbt index 5633cefa7..bb45f2ee4 100644 --- a/src/sbt-test/rpm/test-artifactPath/build.sbt +++ b/src/sbt-test/rpm/test-artifactPath/build.sbt @@ -8,9 +8,9 @@ maintainer := "Josh Suereth " packageSummary := "Test rpm package" -packageName in Linux := "rpm-package" +Linux / packageName := "rpm-package" -artifactPath in (Rpm, packageBin) := target.value / s"${(packageName in Rpm).value}-${(version in Rpm).value}.rpm" +(Rpm / packageBin / artifactPath) := target.value / s"${(Rpm / packageName).value}-${(Rpm / version).value}.rpm" packageDescription := """A fun package description of our software, with multiple lines.""" diff --git a/src/sbt-test/rpm/test-executableScriptName/build.sbt b/src/sbt-test/rpm/test-executableScriptName/build.sbt index 4282e13f8..75727efc6 100644 --- a/src/sbt-test/rpm/test-executableScriptName/build.sbt +++ b/src/sbt-test/rpm/test-executableScriptName/build.sbt @@ -40,7 +40,7 @@ TaskKey[Unit]("checkSpecFile") := { } TaskKey[Unit]("unzip") := { - val rpmPath = Seq((packageBin in Rpm).value.getAbsolutePath) + val rpmPath = Seq((Rpm / packageBin).value.getAbsolutePath) sys.process.Process("rpm2cpio", rpmPath) #| sys.process.Process("cpio -i --make-directories") ! streams.value.log () } diff --git a/src/sbt-test/rpm/test-packageName/build.sbt b/src/sbt-test/rpm/test-packageName/build.sbt index 98244de29..bb454ba58 100644 --- a/src/sbt-test/rpm/test-packageName/build.sbt +++ b/src/sbt-test/rpm/test-packageName/build.sbt @@ -8,7 +8,7 @@ maintainer := "Josh Suereth " packageSummary := "Test rpm package" -packageName in Linux := "rpm-package" +Linux / packageName := "rpm-package" packageDescription := """A fun package description of our software, with multiple lines.""" diff --git a/src/sbt-test/universal/absolute-path/build.sbt b/src/sbt-test/universal/absolute-path/build.sbt index f3b4c83c9..988fe7f4c 100644 --- a/src/sbt-test/universal/absolute-path/build.sbt +++ b/src/sbt-test/universal/absolute-path/build.sbt @@ -4,12 +4,12 @@ name := "absolute-path" version := "0.1.0" -scriptClasspath in bashScriptDefines ++= Seq("/dummy/absolute/path", "relative/path") +bashScriptDefines / scriptClasspath ++= Seq("/dummy/absolute/path", "relative/path") -scriptClasspath in batScriptReplacements ++= Seq("x:\\dummy\\absolute\\path", "relative\\path") +batScriptReplacements / scriptClasspath ++= Seq("x:\\dummy\\absolute\\path", "relative\\path") TaskKey[Unit]("check") := { - val dir = (stagingDirectory in Universal).value + val dir = (Universal / stagingDirectory).value val bash = IO.read(dir / "bin" / "absolute-path") assert(bash contains ":/dummy/absolute/path") diff --git a/src/sbt-test/universal/application-ini-from-javaoptions/build.sbt b/src/sbt-test/universal/application-ini-from-javaoptions/build.sbt index 351e62945..00964eab6 100644 --- a/src/sbt-test/universal/application-ini-from-javaoptions/build.sbt +++ b/src/sbt-test/universal/application-ini-from-javaoptions/build.sbt @@ -4,12 +4,12 @@ name := "simple-test" version := "0.1.0" -javaOptions in Universal ++= Seq("-J-Xmx64m", "-J-Xms64m", "-Dproperty=true") +Universal / javaOptions ++= Seq("-J-Xmx64m", "-J-Xms64m", "-Dproperty=true") TaskKey[Unit]("check") := { - val application = (target in Universal).value / "tmp" / "conf" / "application.ini" + val application = (Universal / target).value / "tmp" / "conf" / "application.ini" val content = IO.read(application) - val options = (javaOptions in Linux).value + val options = (Linux / javaOptions).value options.foreach { opt => assert(content.contains(opt), "Option [" + opt + "] is missing") } diff --git a/src/sbt-test/universal/multiproject-classifiers/build.sbt b/src/sbt-test/universal/multiproject-classifiers/build.sbt index cc6e8bf27..6b99f2fd6 100644 --- a/src/sbt-test/universal/multiproject-classifiers/build.sbt +++ b/src/sbt-test/universal/multiproject-classifiers/build.sbt @@ -23,19 +23,19 @@ lazy val sub = project .settings(mySettings) .settings( ivyConfigurations += Assets, - artifact in Assets := artifact.value.withClassifier(classifier = Some("assets")), + Assets / artifact := 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 + (Assets / artifact).value -> file }, - exportedProducts in Assets := { + Assets / exportedProducts := { Seq( Attributed .blank(baseDirectory.value / "src" / "main" / "assets") - .put(artifact.key, (artifact in Assets).value) + .put(artifact.key, (Assets / artifact).value) .put(AttributeKey[ModuleID]("module-id"), projectID.value) ) } diff --git a/src/sbt-test/universal/publish/build.sbt b/src/sbt-test/universal/publish/build.sbt index 29d5a0002..0fca7bbd1 100644 --- a/src/sbt-test/universal/publish/build.sbt +++ b/src/sbt-test/universal/publish/build.sbt @@ -12,6 +12,6 @@ resolvers += testResolver resolvers += Resolver.mavenLocal // Workaround for overwriting packages at .m2 directory -isSnapshot in ThisBuild := true +ThisBuild / isSnapshot := true -publishTo in Universal := Some(testResolver) +Universal / publishTo := 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 fe191717c..f9d5789f3 100644 --- a/src/sbt-test/universal/staging-custom-main/build.sbt +++ b/src/sbt-test/universal/staging-custom-main/build.sbt @@ -6,15 +6,15 @@ name := "stage-custom-main" version := "0.1.0" -mainClass in Compile := Some("Main") +Compile / mainClass := Some("Main") TaskKey[Unit]("unzip") := { - val args = Seq((packageBin in Universal).value.getAbsolutePath) + val args = Seq((Universal / packageBin).value.getAbsolutePath) sys.process.Process("unzip", args) ! streams.value.log } TaskKey[Unit]("check") := { - val zipFile = (packageBin in Universal).value + val zipFile = (Universal / packageBin).value 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 8156c400a..300822822 100644 --- a/src/sbt-test/universal/test-executableScriptName/build.sbt +++ b/src/sbt-test/universal/test-executableScriptName/build.sbt @@ -9,6 +9,6 @@ executableScriptName := "simple-exec" version := "0.1.0" TaskKey[Unit]("unzip") := { - val args = Seq((packageBin in Universal).value.getAbsolutePath) + val args = Seq((Universal / packageBin).value.getAbsolutePath) sys.process.Process("unzip", args) ! streams.value.log } diff --git a/src/sbt-test/universal/test-mapping-helpers/build.sbt b/src/sbt-test/universal/test-mapping-helpers/build.sbt index 1515cf4af..b21cf0613 100644 --- a/src/sbt-test/universal/test-mapping-helpers/build.sbt +++ b/src/sbt-test/universal/test-mapping-helpers/build.sbt @@ -9,13 +9,13 @@ name := "simple-test" version := "0.1.0" // or just place your cache folder in /src/universal/ -mappings in Universal ++= directory("src/main/resources/cache") +Universal / mappings ++= directory("src/main/resources/cache") // or just place your cache folder in /src/universal/ -mappings in Universal ++= contentOf("src/main/resources/docs") +Universal / mappings ++= contentOf("src/main/resources/docs") -mappings in Universal += { - (packageBin in Compile).value +Universal / mappings += { + (Compile / packageBin).value // we are using the reference.conf as default application.conf // the user can override settings here val conf = sourceDirectory.value / "main" / "resources" / "reference.conf" @@ -23,6 +23,6 @@ mappings in Universal += { } TaskKey[Unit]("unzip") := { - val args = Seq((packageBin in Universal).value.getAbsolutePath) + val args = Seq((Universal / packageBin).value.getAbsolutePath) sys.process.Process("unzip", args) ! streams.value.log } diff --git a/src/sbt-test/universal/test-packageName/build.sbt b/src/sbt-test/universal/test-packageName/build.sbt index a2a05de59..a94707bcf 100644 --- a/src/sbt-test/universal/test-packageName/build.sbt +++ b/src/sbt-test/universal/test-packageName/build.sbt @@ -2,6 +2,6 @@ enablePlugins(JavaAppPackaging) name := "simple-test" -packageName in Universal := "simple-package" +Universal / packageName := "simple-package" version := "0.1.0" diff --git a/src/sbt-test/universal/test-zips/build.sbt b/src/sbt-test/universal/test-zips/build.sbt index 5b6321874..de62e9544 100644 --- a/src/sbt-test/universal/test-zips/build.sbt +++ b/src/sbt-test/universal/test-zips/build.sbt @@ -4,5 +4,5 @@ name := "simple-test" version := "0.1.0" // add some mappings -mappings in UniversalSrc := (mappings in Universal).value -mappings in UniversalDocs := (mappings in Universal).value +UniversalSrc / mappings := (Universal / mappings).value +UniversalDocs / mappings := (Universal / mappings).value 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 a7ccbf37d..b70ed2804 100644 --- a/src/sbt-test/windows/absolute-path-in-bat/build.sbt +++ b/src/sbt-test/windows/absolute-path-in-bat/build.sbt @@ -4,10 +4,10 @@ name := "absolute-path-in-bat" version := "0.1.0" -scriptClasspath in batScriptReplacements ++= Seq("x:\\dummy\\absolute\\path", "relative\\path") +batScriptReplacements / scriptClasspath ++= Seq("x:\\dummy\\absolute\\path", "relative\\path") TaskKey[Unit]("runCheck") := { - val dir = (stagingDirectory in Universal).value + val dir = (Universal / stagingDirectory).value val bat = IO.read(dir / "bin" / "absolute-path-in-bat.bat") assert(bat contains ";x:\\dummy\\absolute\\path") diff --git a/src/sbt-test/windows/app-home-var-expansion/build.sbt b/src/sbt-test/windows/app-home-var-expansion/build.sbt index 633f23964..2faa4e1c9 100644 --- a/src/sbt-test/windows/app-home-var-expansion/build.sbt +++ b/src/sbt-test/windows/app-home-var-expansion/build.sbt @@ -9,7 +9,7 @@ version := "0.1.0" batScriptExtraDefines += """call :add_java "-Dconfig.file=%APP_HOME%\conf\production.conf"""" TaskKey[Unit]("runCheck") := { - val cwd = (stagingDirectory in Universal).value + val cwd = (Universal / stagingDirectory).value val cmd = Seq((cwd / "bin" / s"${packageName.value}.bat").getAbsolutePath) val configFile = (sys.process.Process(cmd, cwd).!!).replaceAll("\r\n", "") assert( diff --git a/src/sbt-test/windows/custom-wix/build.sbt b/src/sbt-test/windows/custom-wix/build.sbt index 401672dd2..3fb8fb142 100644 --- a/src/sbt-test/windows/custom-wix/build.sbt +++ b/src/sbt-test/windows/custom-wix/build.sbt @@ -4,7 +4,7 @@ name := "custom-wix" version := "0.1.0" // make sure we don't somehow use the generated script -wixFile in Windows := { +Windows / wixFile := { sys.error("wixFile shouldn't have been called") } diff --git a/src/sbt-test/windows/dynamic-app-env-name/build.sbt b/src/sbt-test/windows/dynamic-app-env-name/build.sbt index 12c3019ad..7f1bc09cd 100644 --- a/src/sbt-test/windows/dynamic-app-env-name/build.sbt +++ b/src/sbt-test/windows/dynamic-app-env-name/build.sbt @@ -14,7 +14,7 @@ version := "0.1.0" batScriptExtraDefines += """set _JAVA_OPTS=%_JAVA_OPTS% -Dconfig.file=%EXAMPLE_CLI_HOME%\\conf\\app.config""" TaskKey[Unit]("runCheck") := { - val cwd = (stagingDirectory in Universal).value + val cwd = (Universal / stagingDirectory).value val cmd = Seq((cwd / "bin" / s"${packageName.value}.bat").getAbsolutePath) val configFile = (sys.process.Process(cmd, cwd).!!).replaceAll("\r\n", "") assert( diff --git a/src/sbt-test/windows/java-app-archetype/build.sbt b/src/sbt-test/windows/java-app-archetype/build.sbt index b5b744ed1..0b60a8bdf 100644 --- a/src/sbt-test/windows/java-app-archetype/build.sbt +++ b/src/sbt-test/windows/java-app-archetype/build.sbt @@ -17,7 +17,7 @@ wixProductId := "ce07be71-510d-414a-92d4-dff47631848a" wixProductUpgradeId := "4552fb0e-e257-4dbd-9ecb-dba9dbacf424" TaskKey[Unit]("checkScript") := { - val script = (stagingDirectory in Universal).value / "bin" / (name.value + ".bat") + val script = (Universal / stagingDirectory).value / "bin" / (name.value + ".bat") val cmd = Seq("cmd", "/c", script.getAbsolutePath) val result = sys.process.Process(cmd) ! streams.value.log match { diff --git a/src/sbt-test/windows/memory-settings/build.sbt b/src/sbt-test/windows/memory-settings/build.sbt index e63a439ff..2dc61280a 100644 --- a/src/sbt-test/windows/memory-settings/build.sbt +++ b/src/sbt-test/windows/memory-settings/build.sbt @@ -6,17 +6,17 @@ name := "simple-app" version := "0.1.0" -javaOptions in Universal ++= Seq("-J-Xmx64m", "-J-Xms64m") +Universal / javaOptions ++= Seq("-J-Xmx64m", "-J-Xms64m") TaskKey[Unit]("jvmoptsCheck") := { - val jvmopts = (stagingDirectory in Universal).value / "conf" / "application.ini" + val jvmopts = (Universal / stagingDirectory).value / "conf" / "application.ini" val options = IO.read(jvmopts) assert(options contains "-J-Xmx64m", "Options don't contain xmx setting:\n" + options) assert(options contains "-J-Xms64m", "Options don't contain xms setting:\n" + options) } TaskKey[Unit]("runCheck") := { - val cwd = (stagingDirectory in Universal).value + val cwd = (Universal / stagingDirectory).value val cmd = Seq((cwd / "bin" / s"${packageName.value}.bat").getAbsolutePath) val memory = (sys.process.Process(cmd, cwd).!!).replaceAll("\r\n", "") assert(memory.toLong <= 64, "Runtime memory is bigger then 64m < " + memory + "m") diff --git a/src/sbt-test/windows/multiple-apps/build.sbt b/src/sbt-test/windows/multiple-apps/build.sbt index cbd61b2fc..a1967fd8b 100644 --- a/src/sbt-test/windows/multiple-apps/build.sbt +++ b/src/sbt-test/windows/multiple-apps/build.sbt @@ -6,7 +6,7 @@ name := "test-project" version := "0.1.0" TaskKey[Unit]("checkNoExplicitMain") := { - val cwd = (stagingDirectory in Universal).value + val cwd = (Universal / stagingDirectory).value // check MainApp val cmd = Seq((cwd / "bin" / "main-app.bat").getAbsolutePath) @@ -20,7 +20,7 @@ TaskKey[Unit]("checkNoExplicitMain") := { } TaskKey[Unit]("checkExplicitMain") := { - val cwd = (stagingDirectory in Universal).value + val cwd = (Universal / stagingDirectory).value // check default start script val cmd = Seq((cwd / "bin" / s"${executableScriptName.value}.bat").getAbsolutePath) diff --git a/src/sbt-test/windows/test-bat-template/build.sbt b/src/sbt-test/windows/test-bat-template/build.sbt index 0bf68a545..0e6948333 100644 --- a/src/sbt-test/windows/test-bat-template/build.sbt +++ b/src/sbt-test/windows/test-bat-template/build.sbt @@ -36,7 +36,7 @@ batScriptExtraDefines += "exit /B" batScriptExtraDefines += ":print_args_end" TaskKey[Unit]("checkScript") := { - val dir = (stagingDirectory in Universal).value + val dir = (Universal / stagingDirectory).value import scala.sys.process._ val fails = new StringBuilder() val script = dir / "bin" / (name.value + ".bat") diff --git a/src/sbt-test/windows/test-custom-main/build.sbt b/src/sbt-test/windows/test-custom-main/build.sbt index 7acfd5870..63c31d49f 100644 --- a/src/sbt-test/windows/test-custom-main/build.sbt +++ b/src/sbt-test/windows/test-custom-main/build.sbt @@ -6,10 +6,10 @@ name := "test-custom-main" version := "0.1.0" -mainClass in Compile := Some("Main") +Compile / mainClass := Some("Main") TaskKey[Unit]("checkAppMain") := { - val zipFile = (packageBin in Universal).value + val zipFile = (Universal / packageBin).value val process = sys.process.Process("target/universal/stage/bin/test-custom-main.bat") val out = (process !!) @@ -18,7 +18,7 @@ TaskKey[Unit]("checkAppMain") := { } TaskKey[Unit]("checkCustomMain") := { - val zipFile = (packageBin in Universal).value + val zipFile = (Universal / packageBin).value val process = sys.process.Process("target/universal/stage/bin/test-custom-main.bat", Seq("-main", "CustomMain")) val out = (process !!) diff --git a/src/sphinx/formats/jdkpackager.rst b/src/sphinx/formats/jdkpackager.rst index bd8b0a8d8..d6e8a113c 100644 --- a/src/sphinx/formats/jdkpackager.rst +++ b/src/sphinx/formats/jdkpackager.rst @@ -191,7 +191,7 @@ Here's what the build file looks like: ) // Example of specifying a fallback location of `ant-javafx.jar` if plugin can't find it. - (JDKPackager / antPackagerTasks) := (JDKPackager / antPackagerTasks).value orElse { + JDKPackager / antPackagerTasks := (JDKPackager / antPackagerTasks).value orElse { for { f <- Some(file("/usr/lib/jvm/java-8-oracle/lib/ant-javafx.jar")) if f.exists() } yield f diff --git a/src/sphinx/formats/universal.rst b/src/sphinx/formats/universal.rst index 470a19174..9cd009304 100644 --- a/src/sphinx/formats/universal.rst +++ b/src/sphinx/formats/universal.rst @@ -391,7 +391,7 @@ If you want to add everything in a directory where the path for the directory is .. code-block:: scala - (Universal / mappings) ~= (_ ++ directory(target.value / "scala-2.10" / "api")) + Universal / mappings ~= (_ ++ directory(target.value / "scala-2.10" / "api")) @@ -399,7 +399,7 @@ You can also use the following approach if, for example, you need more flexibili .. code-block:: scala - (Universal / mappings) ++= { + Universal / mappings ++= { val dir = target.value / "scala-2.10" / "api" (dir ** AllPassFilter) pair relativeTo(dir.getParentFile) }