Update the build

This commit is contained in:
Eugene Yokota 2017-01-21 06:36:33 -05:00
parent 3235fd1bf1
commit 965b96acc6
10 changed files with 45 additions and 71 deletions

View File

@ -1 +0,0 @@
sbt-launch.jar is downloaded into here.

View File

@ -23,18 +23,20 @@ val windowsBuildId = settingKey[Int]("build id for Windows installer")
// This build creates a SBT plugin with handy features *and* bundles the SBT script for distribution.
val root = (project in file(".")).
enablePlugins(UniversalPlugin, LinuxPlugin, DebianPlugin, RpmPlugin, WindowsPlugin).
enablePlugins(UniversalPlugin, LinuxPlugin, DebianPlugin, RpmPlugin, WindowsPlugin,
UniversalDeployPlugin, DebianDeployPlugin, RpmDeployPlugin, WindowsDeployPlugin).
settings(
organization := "org.scala-sbt",
name := "sbt-launcher-packaging",
packageName := "sbt",
version := "0.1.0",
crossTarget <<= target,
deploymentSettings,
crossTarget := target.value,
publishToSettings,
sbtLaunchJarUrl := downloadUrlForVersion(sbtVersionToRelease),
sbtLaunchJarLocation <<= target apply (_ / "sbt-launch.jar"),
sbtLaunchJar <<= (sbtLaunchJarUrl, sbtLaunchJarLocation) map { (uri, file) =>
sbtLaunchJarLocation := { target.value / "sbt-launch.jar" },
sbtLaunchJar := {
val uri = sbtLaunchJarUrl.value
val file = sbtLaunchJarLocation.value
import dispatch.classic._
if(!file.exists) {
// oddly, some places require us to create the file before writing...
@ -52,7 +54,8 @@ val root = (project in file(".")).
packageDescription := """This script provides a native way to run sbt,
a build tool for Scala and more.""",
// Here we remove the jar file and launch lib from the symlinks:
linuxPackageSymlinks <<= linuxPackageSymlinks map { links =>
linuxPackageSymlinks := {
val links = linuxPackageSymlinks.value
for {
link <- links
if !(link.destination endsWith "sbt-launch-lib.bash")
@ -63,13 +66,13 @@ val root = (project in file(".")).
version in Debian := sbtVersionToRelease,
debianPackageDependencies in Debian ++= Seq("java6-runtime-headless", "bash (>= 2.05a-11)"),
debianPackageRecommends in Debian += "git",
linuxPackageMappings in Debian <+= (sourceDirectory) map { bd =>
linuxPackageMappings in Debian += {
val bd = sourceDirectory.value
(packageMapping(
(bd / "debian/changelog") -> "/usr/share/doc/sbt/changelog.gz"
(bd / "debian" / "changelog") -> "/usr/share/doc/sbt/changelog.gz"
) withUser "root" withGroup "root" withPerms "0644" gzipped) asDocs()
},
debianChangelog in Debian := Some(file("debian/changelog")),
debianChangelog in Debian := { Some(sourceDirectory.value / "debian" / "changelog") },
// RPM SPECIFIC
version in Rpm := {
val stable = (sbtVersionToRelease split "[^\\d]" filterNot (_.isEmpty) mkString ".")
@ -87,7 +90,8 @@ val root = (project in file(".")).
// WINDOWS SPECIFIC
windowsBuildId := 1,
version in Windows <<= (windowsBuildId) apply { (bid) =>
version in Windows := {
val bid = windowsBuildId.value
val sv = sbtVersionToRelease
(sv split "[^\\d]" filterNot (_.isEmpty)) match {
case Array(major,minor,bugfix, _*) => Seq(major, minor, bugfix, bid.toString) mkString "."
@ -105,16 +109,16 @@ val root = (project in file(".")).
// Universal ZIP download install.
packageName in Universal := packageName.value, // needs to be set explicitly due to a bug in native-packager
version in Universal := sbtVersionToRelease,
mappings in Universal <+= sbtLaunchJar map { _ -> "bin/sbt-launch.jar" },
mappings in Universal += { sbtLaunchJar.value -> "bin/sbt-launch.jar" },
// Misccelaneous publishing stuff...
projectID in Debian <<= moduleID,
projectID in Debian := moduleID.value,
projectID in Windows := {
val m = moduleID.value
m.copy(revision = (version in Windows).value)
},
projectID in Rpm <<= moduleID,
projectID in Universal <<= moduleID
projectID in Rpm := moduleID.value,
projectID in Universal := moduleID.value
)
def downloadUrlForVersion(v: String) = (v split "[^\\d]" flatMap (i => catching(classOf[Exception]) opt (i.toInt))) match {
@ -160,7 +164,7 @@ def makePublishToForConfig(config: Configuration) = {
// } yield bintrayRelease(repo, bintrayPackage, version, sLog)
// }
)) ++ Seq(
resolvers <++= (publishTo in config) apply (_.toSeq)
resolvers ++= ((publishTo in config) apply (_.toSeq)).value
)
}

21
debian/changelog vendored
View File

@ -1,21 +0,0 @@
sbt (0.13.13) stable; urgency=low
* The `new` command, which helps creating new build definitions.
This is extensible via `templateResolverInfos` setting.
sbt 0.13.13 will ship with Giter8 template resolver out of the box.
#2705 by @eed3si9n
* Auto plugins can add synthetic subprojects. #2717 by @eed3si9n
* The no-longer-documented sbt 0.12 DSL `<<=`, `<+=`, and `<++=`
operators and tuple enrichment are now marked deprecated.
(These are removed in 1.0.x branch.) @eed3si9n and @dwijnand
* The `.value` method is deprecated for input tasks since `.evaluated`
is normally what's needed.
(Also removed in 1.0.x branch) #2709 by @eed3si9n
* sbt 0.13.13 will display deprecation warning for build.sbt.
#2784 by @eed3si9n
* Renames the early command `--<command>` that was added in 0.13.1 to
`early(<command>)`. `--error` will work, but we encourage you to
migrate to single hyphen version: `-error`, `-warn`, `-info`, and
`-debug`. #2742 by @eed3si9n
-- Dale Wijnand <dale.wijnand@gmail.com> Fri, 28 Oct 2016 14:30:00 +0000

View File

@ -1,2 +1 @@
sbt.version=0.13.11
sbt.version=0.13.13

2
project/plugins.sbt Normal file
View File

@ -0,0 +1,2 @@
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.1.4")
libraryDependencies += "net.databinder" %% "dispatch-http" % "0.8.10"

View File

@ -1,12 +0,0 @@
import sbt._
import Keys._
object PluginBuild extends Build {
override def projects = Seq(root)
val root = Project("root", file(".")) settings(
resolvers += Resolver.url("scalasbt", new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns),
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.1.4"),
libraryDependencies += "net.databinder" %% "dispatch-http" % "0.8.10"
)
}

View File

@ -1,10 +1,31 @@
sbt (0.13.13) stable; urgency=low
* The `new` command, which helps creating new build definitions.
This is extensible via `templateResolverInfos` setting.
sbt 0.13.13 will ship with Giter8 template resolver out of the box.
#2705 by @eed3si9n
* Auto plugins can add synthetic subprojects. #2717 by @eed3si9n
* The no-longer-documented sbt 0.12 DSL `<<=`, `<+=`, and `<++=`
operators and tuple enrichment are now marked deprecated.
(These are removed in 1.0.x branch.) @eed3si9n and @dwijnand
* The `.value` method is deprecated for input tasks since `.evaluated`
is normally what's needed.
(Also removed in 1.0.x branch) #2709 by @eed3si9n
* sbt 0.13.13 will display deprecation warning for build.sbt.
#2784 by @eed3si9n
* Renames the early command `--<command>` that was added in 0.13.1 to
`early(<command>)`. `--error` will work, but we encourage you to
migrate to single hyphen version: `-error`, `-warn`, `-info`, and
`-debug`. #2742 by @eed3si9n
-- Dale Wijnand <dale.wijnand@gmail.com> Fri, 28 Oct 2016 14:30:00 +0000
sbt (0.12.0-build-0100)
* No need for different launcher jar files now
-- Joshua Suereth <joshua.suereth@typesafe.com> 2012-07-2012
sbt (0.11.2-build-0100)
* First debian package release

View File

@ -1,7 +0,0 @@
simple_setting("name") is "test-project"
simple_task("zomg") is { println("ZOMG") }
simple_task("zomg2") on (name, version) is { (n,v) => println("ZOMG " + n + " = " + v + " !!!!!") }

View File

@ -1,4 +0,0 @@
import sbt._
import template.TemplateBuild
object MyAwesomeBuild extends TemplateBuild { }

View File

@ -1,7 +0,0 @@
import sbt._
object PluginDef extends Build {
override def projects = Seq(root)
lazy val root = Project("plugins", file(".")) dependsOn(extras)
lazy val extras = uri("git://github.com/paulp/sbt-extras")
}