mirror of https://github.com/sbt/sbt.git
Merge pull request #1393 from sbt/wip/fix-release-211-again
One more fix to release script.
This commit is contained in:
commit
e665d1268d
|
|
@ -8,21 +8,29 @@ object Release extends Build {
|
|||
lazy val remoteID = SettingKey[String]("remote-id")
|
||||
lazy val launcherRemotePath = SettingKey[String]("launcher-remote-path")
|
||||
lazy val deployLauncher = TaskKey[Unit]("deploy-launcher", "Upload the launcher to its traditional location for compatibility with existing scripts.")
|
||||
lazy val checkCredentials = TaskKey[Unit]("checkCredentials", "Checks to ensure credentials for this user exists.")
|
||||
|
||||
val PublishRepoHost = "private-repo.typesafe.com"
|
||||
|
||||
def settings(nonRoots: => Seq[ProjectReference], launcher: TaskKey[File]): Seq[Setting[_]] =
|
||||
if (CredentialsFile.exists) releaseSettings(nonRoots, launcher) else Nil
|
||||
releaseSettings(nonRoots, launcher)
|
||||
|
||||
// Add credentials if they exist.
|
||||
def lameCredentialSettings: Seq[Setting[_]] =
|
||||
if(CredentialsFile.exists) Seq(credentials in ThisBuild += Credentials(CredentialsFile))
|
||||
else Nil
|
||||
def releaseSettings(nonRoots: => Seq[ProjectReference], launcher: TaskKey[File]): Seq[Setting[_]] = Seq(
|
||||
publishTo in ThisBuild <<= publishResolver,
|
||||
remoteID <<= publishStatus("typesafe-ivy-" + _),
|
||||
credentials in ThisBuild += Credentials(CredentialsFile),
|
||||
remoteBase <<= publishStatus("https://" + PublishRepoHost + "/typesafe/ivy-" + _),
|
||||
launcherRemotePath <<= (organization, version, moduleName) { (org, v, n) => List(org, n, v, n + ".jar").mkString("/") },
|
||||
publish <<= Seq(publish, Release.deployLauncher).dependOn,
|
||||
deployLauncher <<= deployLauncher(launcher)
|
||||
)
|
||||
deployLauncher <<= deployLauncher(launcher),
|
||||
checkCredentials := {
|
||||
// Note - This will eitehr issue a failure or succeed.
|
||||
getCredentials(credentials.value, streams.value.log)
|
||||
}
|
||||
) ++ lameCredentialSettings
|
||||
|
||||
def snapshotPattern(version: String) = Resolver.localBasePattern.replaceAll("""\[revision\]""", version)
|
||||
def publishResolver: Project.Initialize[Option[Resolver]] = (remoteID, remoteBase) { (id, base) =>
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@ import LaunchProguard.{ proguard, Proguard }
|
|||
|
||||
object Sbt extends Build {
|
||||
override lazy val settings = super.settings ++ buildSettings ++ Status.settings ++ nightlySettings
|
||||
|
||||
// Aggregate task for 2.11
|
||||
private def lameAgregateTask(task: String): String =
|
||||
s"all control/$task collections/$task io/$task completion/$task"
|
||||
def buildSettings = Seq(
|
||||
organization := "org.scala-sbt",
|
||||
version := "0.13.6-SNAPSHOT",
|
||||
|
|
@ -43,8 +47,6 @@ object Sbt extends Build {
|
|||
},
|
||||
// TODO - To some extent these should take args to figure out what to do.
|
||||
commands += Command.command("release-libs-211") { state =>
|
||||
def lameAgregateTask(task: String): String =
|
||||
s"all control/$task collections/$task io/$task completion/$task"
|
||||
"setupBuildScala211" ::
|
||||
/// First test
|
||||
lameAgregateTask("test") ::
|
||||
|
|
@ -53,8 +55,16 @@ object Sbt extends Build {
|
|||
// Now restore the defaults.
|
||||
"reload" :: state
|
||||
},
|
||||
commands += Command.command("release-sbt-local") { state =>
|
||||
"publishLocal" ::
|
||||
"setupBuildScala211" ::
|
||||
lameAgregateTask("publishLocal") ::
|
||||
"reload" ::
|
||||
state
|
||||
},
|
||||
commands += Command.command("release-sbt") { state =>
|
||||
// TODO - Any sort of validation
|
||||
"checkCredentials" ::
|
||||
"publishSigned" ::
|
||||
"publishLauncher" ::
|
||||
"release-libs-211" ::
|
||||
|
|
@ -98,7 +108,7 @@ object Sbt extends Build {
|
|||
// Utilities related to reflection, managing Scala versions, and custom class loaders
|
||||
lazy val classpathSub = testedBaseProject(utilPath / "classpath", "Classpath") dependsOn (launchInterfaceSub, interfaceSub, ioSub) settings (scalaCompiler)
|
||||
// Command line-related utilities.
|
||||
lazy val completeSub = testedBaseProject(utilPath / "complete", "Completion") dependsOn (collectionSub, controlSub, ioSub) settings (jline)
|
||||
lazy val completeSub = testedBaseProject(utilPath / "complete", "Completion") dependsOn (collectionSub, controlSub, ioSub) settings (jline) settings (Util.crossBuild: _*)
|
||||
// logging
|
||||
lazy val logSub = testedBaseProject(utilPath / "log", "Logging") dependsOn (interfaceSub, processSub) settings (jline)
|
||||
// Relation
|
||||
|
|
@ -304,7 +314,7 @@ object Sbt extends Build {
|
|||
moduleName := "sbt-launch",
|
||||
autoScalaLibrary := false,
|
||||
description := "sbt application launcher",
|
||||
publishLauncher <<= publish,
|
||||
publishLauncher <<= Release.deployLauncher,
|
||||
packageBin in Compile <<= (proguard in Proguard, Transform.conscriptConfigs).map((x, y) => x)
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue