From 13e62fd6452974a77eb9b9ac9a60a613316b1d14 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Sat, 5 May 2012 20:35:05 -0400 Subject: [PATCH] Use binary version for cross-version even for snapshots and milestones Rely instead on users not publishing the same stable version against both stable Scala or sbt releases and snapshots/milestones. --- main/Defaults.scala | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/main/Defaults.scala b/main/Defaults.scala index 6b9def2b8..151a0b13d 100755 --- a/main/Defaults.scala +++ b/main/Defaults.scala @@ -11,7 +11,7 @@ package sbt import Load.LoadedBuild import Artifact.{DocClassifier, SourceClassifier} import Configurations.{Compile, CompilerPlugin, IntegrationTest, names, Provided, Runtime, Test} - import CrossVersion.{binarySbtVersion, binaryScalaVersion, isStable, selectVersion} + import CrossVersion.{binarySbtVersion, binaryScalaVersion} import complete._ import std.TaskExtra._ import inc.{FileValueCache, Locate} @@ -197,12 +197,7 @@ object Defaults extends BuildCommon scalaInstance <<= scalaInstanceSetting, scalaVersion in GlobalScope <<= appConfiguration( _.provider.scalaProvider.version), scalaBinaryVersion in GlobalScope <<= scalaVersion apply binaryScalaVersion, - crossVersion <<= (crossPaths, scalaVersion) { (enabled, sv) => - if(enabled) - if(isStable(sv)) CrossVersion.binary else CrossVersion.full - else - CrossVersion.Disabled - }, + crossVersion <<= (crossPaths) { enabled => if(enabled) CrossVersion.binary else CrossVersion.Disabled }, crossScalaVersions in GlobalScope <<= Seq(scalaVersion).join, crossTarget <<= (target, scalaBinaryVersion, sbtBinaryVersion, sbtPlugin, crossPaths)(makeCrossTarget) ) @@ -867,7 +862,7 @@ object Classpaths val id = app.provider.id val scalaVersion = app.provider.scalaProvider.version val binVersion = binaryScalaVersion(scalaVersion) - val cross = if(id.crossVersioned) if(isStable(scalaVersion)) CrossVersion.binary else CrossVersion.full else CrossVersion.Disabled + val cross = if(id.crossVersioned) CrossVersion.binary else CrossVersion.Disabled val base = ModuleID(id.groupID, id.name, id.version, crossVersion = cross) CrossVersion(scalaVersion, binVersion)(base).copy(crossVersion = CrossVersion.Disabled) } @@ -878,12 +873,9 @@ object Classpaths log.warn("Multiple resolvers having different access mechanism configured with same name '" + name + "'. To avoid conflict, Remove duplicate project resolvers (`resolvers`) or rename publishing resolver (`publishTo`).") } } - def pluginProjectID: Initialize[ModuleID] = (sbtVersion in update, sbtBinaryVersion in update, scalaVersion in update, scalaBinaryVersion in update, projectID, sbtPlugin) { - (sbtV, sbtBV, scalaV, scalaBV, pid, isPlugin) => - if(isPlugin) - sbtPluginExtra(pid, selectVersion(sbtV, sbtBV), selectVersion(scalaV, scalaBV)) - else - pid + def pluginProjectID: Initialize[ModuleID] = (sbtBinaryVersion in update, scalaBinaryVersion in update, projectID, sbtPlugin) { + (sbtBV, scalaBV, pid, isPlugin) => + if(isPlugin) sbtPluginExtra(pid, sbtBV, scalaBV) else pid } def ivySbt0: Initialize[Task[IvySbt]] = (ivyConfiguration, credentials, streams) map { (conf, creds, s) =>