diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 04bf63037..ed916ffd8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,9 +12,10 @@ Contributing There are lots of ways to contribute to sbt ecosystem depending on your interests and skill level. -- Help someone at work or online help their build problem. +- Help someone at work or online fix their build problem. - Answer StackOverflow questions. -- Create plugins that extends sbt's feature. +- Ask StackOverflow questions. +- Create plugins that extend sbt's features. - Maintain and update [documentation]. - Garden the issue tracker. - Report issues. @@ -230,7 +231,7 @@ Afterwhich start sbt with a stable launcher: `sbt -sbt-jar ~/.sbt/launchers/1.1. ### Clearing out boot and local cache -When you run a locally built sbt, the JAR artifacts will be now cached under `$HOME/.sbt/boot/scala-2.12.4/org.scala-sbt/sbt/1.$MINOR.$PATCH-SNAPSHOT` directory. To clear this out run: `reboot dev` command from sbt's session of your test application. +When you run a locally built sbt, the JAR artifacts will be now cached under `$HOME/.sbt/boot/scala-2.12.6/org.scala-sbt/sbt/1.$MINOR.$PATCH-SNAPSHOT` directory. To clear this out run: `reboot dev` command from sbt's session of your test application. One drawback of `-SNAPSHOT` version is that it's slow to resolve as it tries to hit all the resolvers. You can workaround that by using a version name like `1.$MINOR.$PATCH-LOCAL1`. A non-SNAPSHOT artifacts will now be cached under `$HOME/.ivy/cache/` directory, so you need to clear that out using [sbt-dirty-money](https://github.com/sbt/sbt-dirty-money)'s `cleanCache` task. diff --git a/main/src/main/scala/sbt/PluginCross.scala b/main/src/main/scala/sbt/PluginCross.scala index 3e3fd4bba..ea0d3fda1 100644 --- a/main/src/main/scala/sbt/PluginCross.scala +++ b/main/src/main/scala/sbt/PluginCross.scala @@ -96,7 +96,7 @@ private[sbt] object PluginCross { VersionNumber(sv) match { case VersionNumber(Seq(0, 12, _*), _, _) => "2.9.2" case VersionNumber(Seq(0, 13, _*), _, _) => "2.10.7" - case VersionNumber(Seq(1, 0, _*), _, _) => "2.12.4" + case VersionNumber(Seq(1, 0, _*), _, _) => "2.12.6" case _ => sys.error(s"Unsupported sbt binary version: $sv") } } diff --git a/project/Dependencies.scala b/project/Dependencies.scala index bcefc8b4e..b1e9fd0ab 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -4,7 +4,7 @@ import sbt.contraband.ContrabandPlugin.autoImport._ object Dependencies { // WARNING: Please Scala update versions in PluginCross.scala too - val scala212 = "2.12.5" + val scala212 = "2.12.6" val baseScalaVersion = scala212 // sbt modules diff --git a/project/build.properties b/project/build.properties index 05313438a..64cf32f7f 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.1.2 +sbt.version=1.1.4 diff --git a/project/plugins.sbt b/project/plugins.sbt index c525802ca..46054b0a0 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,4 @@ -scalaVersion := "2.12.4" +scalaVersion := "2.12.6" scalacOptions ++= Seq("-feature", "-language:postfixOps") addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.2.0") diff --git a/sbt/src/sbt-test/tests/fork-async/build.sbt b/sbt/src/sbt-test/tests/fork-async/build.sbt index bb42b0c17..3ddfca63c 100644 --- a/sbt/src/sbt-test/tests/fork-async/build.sbt +++ b/sbt/src/sbt-test/tests/fork-async/build.sbt @@ -2,7 +2,7 @@ testFrameworks += new TestFramework("utest.runner.Framework") lazy val root = (project in file(".")). settings( - scalaVersion := "2.12.4", + scalaVersion := "2.12.6", libraryDependencies += "com.lihaoyi" %% "utest" % "0.6.4" % Test, fork in Test := true ) diff --git a/sbt/src/test/scala/sbt/RunFromSourceMain.scala b/sbt/src/test/scala/sbt/RunFromSourceMain.scala index 59e686ed1..84c229de0 100644 --- a/sbt/src/test/scala/sbt/RunFromSourceMain.scala +++ b/sbt/src/test/scala/sbt/RunFromSourceMain.scala @@ -15,7 +15,7 @@ import xsbti._ object RunFromSourceMain { private val sbtVersion = "1.1.4" // TestBuildInfo.version - private val scalaVersion = "2.12.4" + private val scalaVersion = "2.12.6" def fork(workingDirectory: File): Try[Unit] = { val fo = ForkOptions() @@ -67,12 +67,46 @@ object RunFromSourceMain { def apply[T](lockFile: File, run: java.util.concurrent.Callable[T]) = run.call() } + private lazy val bootDirectory: File = file(sys.props("user.home")) / ".sbt" / "boot" + private lazy val scalaHome: File = { + val log = sbt.util.LogExchange.logger("run-from-source") + val scalaHome0 = bootDirectory / s"scala-$scalaVersion" + if ((scalaHome0 / "lib").exists) scalaHome0 + else { + log.info(s"""scalaHome ($scalaHome0) wasn't found""") + val fakeboot = file(sys.props("user.home")) / ".sbt" / "fakeboot" + val scalaHome1 = fakeboot / s"scala-$scalaVersion" + val scalaHome1Lib = scalaHome1 / "lib" + val scalaHome1Temp = scalaHome1 / "temp" + if (scalaHome1Lib.exists) log.info(s"""using $scalaHome1 that was found""") + else { + log.info(s"""creating $scalaHome1 by downloading scala-compiler $scalaVersion""") + IO.createDirectories(List(scalaHome1Lib, scalaHome1Temp)) + val lm = { + import sbt.librarymanagement.ivy.IvyDependencyResolution + val ivyConfig = InlineIvyConfiguration().withLog(log) + IvyDependencyResolution(ivyConfig) + } + val Name = """(.*)(\-[\d|\.]+)\.jar""".r + val module = "org.scala-lang" % "scala-compiler" % scalaVersion + lm.retrieve(module, scalaModuleInfo = None, scalaHome1Temp, log) match { + case Right(_) => + (scalaHome1Temp ** "*.jar").get foreach { x => + val Name(head, _) = x.getName + IO.copyFile(x, scalaHome1Lib / (head + ".jar")) + } + case Left(w) => sys.error(w.toString) + } + } + scalaHome1 + } + } + private def getConf(baseDir: File, args: Seq[String]): AppConfiguration = new AppConfiguration { def baseDirectory = baseDir def arguments = args.toArray + def provider = new AppProvider { appProvider => - def bootDirectory: File = file(sys.props("user.home")) / ".sbt" / "boot" - def scalaHome: File = bootDirectory / s"scala-$scalaVersion" def scalaProvider = new ScalaProvider { scalaProvider => def scalaOrg = "org.scala-lang" def launcher = new Launcher { @@ -82,7 +116,7 @@ object RunFromSourceMain { def app(id: xsbti.ApplicationID, version: String) = appProvider def topLoader = new java.net.URLClassLoader(Array(), null) def globalLock = noGlobalLock - def bootDirectory = appProvider.bootDirectory + def bootDirectory = RunFromSourceMain.bootDirectory def ivyHome = file(sys.props("user.home")) / ".ivy2" final case class PredefRepo(id: Predefined) extends PredefinedRepository import Predefined._ @@ -92,11 +126,14 @@ object RunFromSourceMain { def checksums = Array("sha1", "md5") } def version = scalaVersion - def libDir: File = scalaHome / "lib" + lazy val libDir: File = RunFromSourceMain.scalaHome / "lib" def jar(name: String): File = libDir / s"$name.jar" - def libraryJar = jar("scala-library") - def compilerJar = jar("scala-compiler") - def jars = libDir.listFiles(f => !f.isDirectory && f.getName.endsWith(".jar")) + lazy val libraryJar = jar("scala-library") + lazy val compilerJar = jar("scala-compiler") + lazy val jars = { + assert(libDir.exists) + libDir.listFiles(f => !f.isDirectory && f.getName.endsWith(".jar")) + } def loader = new java.net.URLClassLoader(jars map (_.toURI.toURL), null) def app(id: xsbti.ApplicationID) = appProvider }