Merge pull request #3342 from sbt/wip/sbt1

sbt 1.0.0-RC2
This commit is contained in:
Dale Wijnand 2017-07-20 10:36:48 +01:00 committed by GitHub
commit a068736836
8 changed files with 39 additions and 25 deletions

View File

@ -16,7 +16,9 @@ matrix:
env: env:
matrix: matrix:
- SBT_CMD=";test:compile;scalafmt::test;test:scalafmt::test;mainSettingsProj/test;safeUnitTests;otherUnitTests" # drop scalafmt on the 1.0.0 branch to dogfood 1.0.0-RC2 before there is a sbt 1.0 of new-sbt-scalafnt
# - SBT_CMD=";test:compile;scalafmt::test;test:scalafmt::test;mainSettingsProj/test;safeUnitTests;otherUnitTests"
- SBT_CMD=";test:compile;mainSettingsProj/test;safeUnitTests;otherUnitTests"
# - SBT_CMD="mimaReportBinaryIssues" # - SBT_CMD="mimaReportBinaryIssues"
- SBT_CMD="scripted actions/*" - SBT_CMD="scripted actions/*"
- SBT_CMD="scripted apiinfo/* compiler-project/* ivy-deps-management/*" - SBT_CMD="scripted apiinfo/* compiler-project/* ivy-deps-management/*"

View File

@ -32,9 +32,9 @@ def buildLevelSettings: Seq[Setting[_]] =
homepage := Some(url("https://github.com/sbt/sbt")), homepage := Some(url("https://github.com/sbt/sbt")),
scmInfo := Some(ScmInfo(url("https://github.com/sbt/sbt"), "git@github.com:sbt/sbt.git")), scmInfo := Some(ScmInfo(url("https://github.com/sbt/sbt"), "git@github.com:sbt/sbt.git")),
resolvers += Resolver.mavenLocal, resolvers += Resolver.mavenLocal,
scalafmtOnCompile := true, // scalafmtOnCompile := true,
// scalafmtVersion 1.0.0-RC3 has regression // scalafmtVersion 1.0.0-RC3 has regression
scalafmtVersion := "0.6.8" // scalafmtVersion := "0.6.8"
)) ))
def commonSettings: Seq[Setting[_]] = def commonSettings: Seq[Setting[_]] =
@ -74,8 +74,8 @@ def testedBaseSettings: Seq[Setting[_]] =
lazy val sbtRoot: Project = (project in file(".")) lazy val sbtRoot: Project = (project in file("."))
.enablePlugins(ScriptedPlugin) // , SiteScaladocPlugin, GhpagesPlugin) .enablePlugins(ScriptedPlugin) // , SiteScaladocPlugin, GhpagesPlugin)
.configs(Sxr.sxrConf) .configs(Sxr.SxrConf)
.aggregateSeq(nonRoots) .aggregate(nonRoots: _*)
.settings( .settings(
buildLevelSettings, buildLevelSettings,
minimalSettings, minimalSettings,

View File

@ -5,7 +5,7 @@ import com.typesafe.sbt.site.SitePlugin.autoImport._
import com.typesafe.sbt.site.SiteScaladocPlugin.autoImport._ import com.typesafe.sbt.site.SiteScaladocPlugin.autoImport._
import com.typesafe.sbt.sbtghpages.GhpagesPlugin.autoImport._ import com.typesafe.sbt.sbtghpages.GhpagesPlugin.autoImport._
import com.typesafe.sbt.SbtGit, SbtGit.{ git, GitKeys } import com.typesafe.sbt.SbtGit, SbtGit.{ git, GitKeys }
import Sxr.{ sxr, sxrConf } import Sxr.{ sxr, SxrConf }
*/ */
object Docs { object Docs {
@ -37,8 +37,8 @@ object Docs {
def siteIncludeSxr(prefix: String) = Def settings ( def siteIncludeSxr(prefix: String) = Def settings (
mappings in sxr := Path.allSubpaths(sxr.value).toSeq, mappings in sxr := Path.allSubpaths(sxr.value).toSeq,
siteSubdirName in sxrConf := prefix, siteSubdirName in SxrConf := prefix,
addMappingsToSiteDir(mappings in sxr, siteSubdirName in sxrConf) addMappingsToSiteDir(mappings in sxr, siteSubdirName in SxrConf)
) )
def synchLocalImpl = Def task { def synchLocalImpl = Def task {

View File

@ -1,6 +1,7 @@
import sbt._, Keys._ import sbt._, Keys._
import sbt.internal.librarymanagement.PublishConfiguration import sbt.librarymanagement.PublishConfiguration
import sbt.librarymanagement.ConfigRef
/** This local plugin provides ways of publishing just the binary jar. */ /** This local plugin provides ways of publishing just the binary jar. */
object PublishBinPlugin extends AutoPlugin { object PublishBinPlugin extends AutoPlugin {
@ -18,13 +19,24 @@ object PublishBinPlugin extends AutoPlugin {
override def projectSettings = Def settings ( override def projectSettings = Def settings (
publishLocalBin := Classpaths.publishTask(publishLocalBinConfig, deliverLocal).value, publishLocalBin := Classpaths.publishTask(publishLocalBinConfig, deliverLocal).value,
publishLocalBinConfig := Classpaths.publishConfig(
(packagedArtifacts in publishLocalBin).value, publishLocalBinConfig := {
Some(deliverLocal.value), val _ = deliverLocal.value
(checksums in publishLocalBin).value, Classpaths.publishConfig(
logging = ivyLoggingLevel.value, publishMavenStyle.value,
overwrite = isSnapshot.value deliverPattern(crossTarget.value),
), if (isSnapshot.value) "integration" else "release",
ivyConfigurations.value.map(c => ConfigRef(c.name)).toVector,
(packagedArtifacts in publishLocalBin).value.toVector,
(checksums in publishLocalBin).value,
resolverName = "local",
logging = ivyLoggingLevel.value,
overwrite = isSnapshot.value)
},
packagedArtifacts in publishLocalBin := Classpaths.packaged(Seq(packageBin in Compile)).value packagedArtifacts in publishLocalBin := Classpaths.packaged(Seq(packageBin in Compile)).value
) )
def deliverPattern(outputPath: File): String =
(outputPath / "[artifact]-[revision](-[classifier]).[ext]").absolutePath
} }

View File

@ -1,6 +1,7 @@
import sbt.io.Path._ import sbt.io.Path._
import sbt._ import sbt._
import Keys._ import Keys._
import sbt.io.CopyOptions
object SbtLauncherPlugin extends AutoPlugin { object SbtLauncherPlugin extends AutoPlugin {
override def requires = plugins.IvyPlugin override def requires = plugins.IvyPlugin
@ -40,7 +41,7 @@ object SbtLauncherPlugin extends AutoPlugin {
// TODO - Check if we should rebuild the jar or not.... // TODO - Check if we should rebuild the jar or not....
IO.withTemporaryDirectory { dir => IO.withTemporaryDirectory { dir =>
IO.unzip(jar, dir) IO.unzip(jar, dir)
IO.copy(overrides.map({ case (n, f) => (f, dir / n) }), overwrite = true) IO.copy(overrides.map({ case (n, f) => (f, dir / n) }), CopyOptions().withOverwrite(true))
// TODO - is the ok for creating a jar? // TODO - is the ok for creating a jar?
IO.zip((dir.allPaths --- dir) pair relativeTo(dir), target) IO.zip((dir.allPaths --- dir) pair relativeTo(dir), target)
} }

View File

@ -2,22 +2,20 @@ import sbt._
import Keys._ import Keys._
import Scope.ThisScope import Scope.ThisScope
import sbt.librarymanagement.syntax._
import sbt.internal.inc.RawCompiler import sbt.internal.inc.RawCompiler
object Sxr { object Sxr {
val sxrConf = config("sxr").hide val SxrConf = config("sxr").hide
val sxr = TaskKey[File]("sxr") val sxr = TaskKey[File]("sxr")
val sourceDirectories = TaskKey[Seq[File]]("sxr-source-directories") val sourceDirectories = TaskKey[Seq[File]]("sxr-source-directories")
lazy val settings: Seq[Setting[_]] = inTask(sxr)(inSxrSettings) ++ baseSettings lazy val settings: Seq[Setting[_]] = inTask(sxr)(inSxrSettings) ++ baseSettings
def baseSettings = Seq( def baseSettings = Seq(
libraryDependencies += "org.scala-sbt.sxr" % "sxr_2.10" % "0.3.0" % sxrConf.name libraryDependencies += "org.scala-sbt.sxr" % "sxr_2.10" % "0.3.0" % SxrConf
) )
def inSxrSettings = Seq( def inSxrSettings = Seq(
managedClasspath := update.value.matching(configurationFilter(sxrConf.name)).classpath, managedClasspath := update.value.matching(configurationFilter(SxrConf.name)).classpath,
scalacOptions += "-P:sxr:base-directory:" + sourceDirectories.value.absString, scalacOptions += "-P:sxr:base-directory:" + sourceDirectories.value.absString,
scalacOptions += "-Xplugin:" + managedClasspath.value.files scalacOptions += "-Xplugin:" + managedClasspath.value.files
.filter(_.getName.contains("sxr")) .filter(_.getName.contains("sxr"))

View File

@ -1 +1 @@
sbt.version=1.0.0-M6 sbt.version=1.0.0-RC2

View File

@ -6,7 +6,8 @@ scalacOptions ++= Seq("-feature", "-language:postfixOps")
// addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.9.2") // addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.9.2")
// addSbtPlugin("com.typesafe.sbt" % "sbt-javaversioncheck" % "0.1.0") // addSbtPlugin("com.typesafe.sbt" % "sbt-javaversioncheck" % "0.1.0")
// addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.2.0") // addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.2.0")
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.4.0")
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.1")
addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.3.0-M9") addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.3.0-M9")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0-M1") addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0-M1")
addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.3") // addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.3")