Skip to content

Commit

Permalink
Merge pull request #389 from fiadliel/feature/less_autoplugin_triggers
Browse files Browse the repository at this point in the history
Remove AutoPlugin triggers from plugins.
  • Loading branch information
muuki88 committed Nov 6, 2014
2 parents 017b2c6 + edf70c0 commit 62fde8f
Show file tree
Hide file tree
Showing 17 changed files with 57 additions and 22 deletions.
1 change: 1 addition & 0 deletions src/main/scala/com/typesafe/sbt/PackagerPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ object SbtNativePackager extends AutoPlugin {

import SettingsHelper._

@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") ++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import SbtNativePackager.{ Universal, Linux }
object DebianPlugin extends AutoPlugin with DebianNativePackaging {

override def requires = linux.LinuxPlugin
override def trigger = allRequirements

object autoImport extends DebianKeys {
val Debian = config("debian") extend Linux
Expand Down Expand Up @@ -341,3 +340,14 @@ trait DebianPluginLike {
appName + "_" + version + "_" + arch + ".changes"
}
}

object DebianDeployPlugin extends AutoPlugin {

import DebianPlugin.autoImport._

override def requires = DebianPlugin

override def projectSettings =
SettingsHelper.makeDeploymentSettings(Debian, packageBin in Debian, "deb") ++
SettingsHelper.makeDeploymentSettings(Debian, genChanges in Debian, "changes")
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ object DockerPlugin extends AutoPlugin {

override def requires = universal.UniversalPlugin

override def trigger = allRequirements

override lazy val projectSettings = Seq(
dockerBaseImage := "dockerfile/java:latest",
dockerExposedPorts := Seq(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import SbtNativePackager.Universal
object LinuxPlugin extends AutoPlugin {

override def requires = universal.UniversalPlugin
override def trigger = allRequirements
override lazy val projectSettings = linuxSettings ++ mapGenericFilesToLinux

object autoImport extends LinuxKeys with LinuxMappingDSL {
Expand Down
10 changes: 9 additions & 1 deletion src/main/scala/com/typesafe/sbt/packager/rpm/RpmPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import packager.Keys._
object RpmPlugin extends AutoPlugin {

override def requires = LinuxPlugin
override def trigger = allRequirements

object autoImport extends RpmKeys {
val Rpm = config("rpm") extend Linux
Expand Down Expand Up @@ -109,3 +108,12 @@ object RpmPlugin extends AutoPlugin {
))
}

object RpmDeployPlugin extends AutoPlugin {

import RpmPlugin.autoImport._

override def requires = RpmPlugin

override def projectSettings =
SettingsHelper.makeDeploymentSettings(Rpm, packageBin in Rpm, "rpm")
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ object UniversalPlugin extends AutoPlugin {
import autoImport._

override def requires = SbtNativePackager
override def trigger = allRequirements

/** The basic settings for the various packaging types. */
override lazy val projectSettings = Seq[Setting[_]](
Expand Down Expand Up @@ -114,3 +113,16 @@ object UniversalPlugin extends AutoPlugin {
sourceDir.*** --- sourceDir pair relativeTo(sourceDir)

}

object UniversalDeployPlugin extends AutoPlugin {

import UniversalPlugin.autoImport._

override def requires = UniversalPlugin

override def projectSettings =
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")
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ object WindowsPlugin extends AutoPlugin {

override lazy val projectSettings = windowsSettings ++ mapGenericFilesToWindows
override def requires = universal.UniversalPlugin
override def trigger = allRequirements

/**
* default windows settings
Expand Down Expand Up @@ -175,4 +174,14 @@ object WindowsPlugin extends AutoPlugin {
// TODO - Add feature for shortcuts to binary scripts.
Seq(corePackage, addBinToPath, menuLinks)
}
}
}

object WindowsDeployPlugin extends AutoPlugin {

import WindowsPlugin.autoImport._

override def requires = WindowsPlugin

override def projectSettings =
SettingsHelper.makeDeploymentSettings(Windows, packageBin in Windows, "msi")
}
4 changes: 2 additions & 2 deletions src/sbt-test/debian/gen-changes/build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
enablePlugins(SbtNativePackager)
enablePlugins(DebianPlugin)

name := "debian-test"

Expand All @@ -15,4 +15,4 @@ debianPackageDependencies in Debian ++= Seq("java2-runtime", "bash (>= 2.05a-11)

debianPackageRecommends in Debian += "git"

debianChangelog in Debian := Some(file("debian/changelog"))
debianChangelog in Debian := Some(file("debian/changelog"))
2 changes: 1 addition & 1 deletion src/sbt-test/debian/test-mapping-helpers/build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import NativePackagerHelper._

enablePlugins(SbtNativePackager)
enablePlugins(DebianPlugin)

name := "debian-test"

Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/docker/staging/build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
enablePlugins(SbtNativePackager)
enablePlugins(DockerPlugin)

name := "simple-test"

Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/docker/volumes/build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
enablePlugins(SbtNativePackager)
enablePlugins(DockerPlugin)

name := "simple-test"

Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/rpm/scriptlets-rpm/build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
enablePlugins(SbtNativePackager)
enablePlugins(RpmPlugin)

name := "rpm-test"

Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/rpm/simple-rpm/build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
enablePlugins(SbtNativePackager)
enablePlugins(RpmPlugin)

name := "rpm-test"

Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/universal/clear-stage-dir/build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
enablePlugins(SbtNativePackager)
enablePlugins(UniversalPlugin)

name := "simple-test"

Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/universal/dist/build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
enablePlugins(SbtNativePackager)
enablePlugins(UniversalPlugin)

name := "simple-test"

Expand Down
6 changes: 2 additions & 4 deletions src/sbt-test/universal/publish/build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
enablePlugins(SbtNativePackager)

deploymentSettings
enablePlugins(UniversalDeployPlugin)

name := "simple-test"

Expand All @@ -9,4 +7,4 @@ version := "0.1.0"
// Workarund for ivy configuration bug
resolvers += (publishTo in Universal).value.get

publishTo in Universal := Some(Resolver.file("test", file("test-repo"))(Patterns("[module]/[revision]/[module]-[revision].[ext]")))
publishTo in Universal := Some(Resolver.file("test", file("test-repo"))(Patterns("[module]/[revision]/[module]-[revision].[ext]")))
2 changes: 1 addition & 1 deletion src/sbt-test/universal/staging/build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
enablePlugins(SbtNativePackager)
enablePlugins(UniversalPlugin)

name := "simple-test"

Expand Down

0 comments on commit 62fde8f

Please sign in to comment.