Skip to content

Instantly share code, notes, and snippets.

@muuki88
Last active August 29, 2015 14:06
Show Gist options
  • Save muuki88/4d65ad8172033c5389d1 to your computer and use it in GitHub Desktop.
Save muuki88/4d65ad8172033c5389d1 to your computer and use it in GitHub Desktop.
SBT Native Packager - Auto Plugins
// API proposal # 1
lazy val root = project(file(".")
.enablePlugins(SbtNativePackager, JavaServerArchetype)
.settings(
"maintainer" in Debian := "Your Name <your.name@your-company.com"
)
)
// Implementation may look like
object SbtNativePackager extends AutoPlugin
with linux.LinuxPlugin with ... {
object autoimport extends linux.Keys.autoimport with ...
// projectSettings or buildSettings ?
override lazy val buildSettings = linuxSettings ++ ...
}
// API proposal # 2
lazy val root = project(file(".")
.enablePlugins(UniversalPackagingPlugin, NativeDebianPackagingPlugin, JavaServerArchetype)
.settings(
"maintainer" in Debian := "Your Name <your.name@your-company.com"
)
)
// Implementation may look like
object UniversalPackagingPlugin extends AutoPlugin {
object autoimport {
}
// projectSettings or buildSettings ?
override lazy val buildSettings = Seq(...)
}
object WindowsPlugin extends AutoPlugin {
override def requires = UniversalPackagingPlugin
object autoimport {
}
// projectSettings or buildSettings ?
override lazy val buildSettings = Seq(...)
}
@muuki88
Copy link
Author

muuki88 commented Sep 28, 2014

IMHO the GenericToXYZ mappings should be handled by the respective plugin (Linux, Windows). If the archetypes require all these plugins, the mappings are always in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment