mirror of https://github.com/sbt/sbt.git
Bump to sbt 1.0.0-M6
This commit is contained in:
parent
ffd165c6cc
commit
60e1eb6275
|
|
@ -5,7 +5,7 @@ scala:
|
|||
- 2.12.1
|
||||
|
||||
script:
|
||||
- sbt -Dfile.encoding=UTF8 -J-XX:ReservedCodeCacheSize=256M ";++$TRAVIS_SCALA_VERSION test;scalafmtCheck"
|
||||
- sbt -Dfile.encoding=UTF8 -J-XX:ReservedCodeCacheSize=256M ";++$TRAVIS_SCALA_VERSION test;scalafmt::test;test:scalafmt::test"
|
||||
|
||||
jdk:
|
||||
- oraclejdk8
|
||||
|
|
|
|||
32
build.sbt
32
build.sbt
|
|
@ -1,5 +1,7 @@
|
|||
import Dependencies._
|
||||
import com.typesafe.tools.mima.core._, ProblemFilters._
|
||||
import Path._
|
||||
|
||||
// import com.typesafe.tools.mima.core._, ProblemFilters._
|
||||
|
||||
def baseVersion = "1.0.0"
|
||||
|
||||
|
|
@ -12,26 +14,24 @@ def commonSettings: Seq[Setting[_]] = Seq(
|
|||
// concurrentRestrictions in Global += Util.testExclusiveRestriction,
|
||||
testOptions += Tests.Argument(TestFrameworks.ScalaCheck, "-w", "1"),
|
||||
javacOptions in compile ++= Seq("-Xlint", "-Xlint:-serial"),
|
||||
incOptions := incOptions.value.withNameHashing(true),
|
||||
crossScalaVersions := Seq(scala211, scala212),
|
||||
resolvers += Resolver.sonatypeRepo("public"),
|
||||
scalacOptions += "-Ywarn-unused",
|
||||
mimaPreviousArtifacts := Set(), // Some(organization.value %% moduleName.value % "1.0.0"),
|
||||
scalacOptions := {
|
||||
val old = scalacOptions.value
|
||||
scalaVersion.value match {
|
||||
case sv if sv.startsWith("2.10") => old diff List("-Xfuture", "-Ywarn-unused", "-Ywarn-unused-import")
|
||||
case sv if sv.startsWith("2.11") => old ++ List("-Ywarn-unused", "-Ywarn-unused-import")
|
||||
case _ => old ++ List("-Ywarn-unused", "-Ywarn-unused-import", "-YdisableFlatCpCaching")
|
||||
}
|
||||
},
|
||||
// mimaPreviousArtifacts := Set(), // Some(organization.value %% moduleName.value % "1.0.0"),
|
||||
publishArtifact in Compile := true,
|
||||
publishArtifact in Test := false,
|
||||
parallelExecution in Test := false,
|
||||
commands += Command.command("scalafmtCheck") { state =>
|
||||
sys.process.Process("git diff --name-only --exit-code").! match {
|
||||
case 0 => // ok
|
||||
case x => sys.error("git diff detected! Did you compile before committing?")
|
||||
}
|
||||
state
|
||||
}
|
||||
parallelExecution in Test := false
|
||||
)
|
||||
|
||||
lazy val lmRoot = (project in file("."))
|
||||
.aggregate(lm)
|
||||
.disablePlugins(com.typesafe.sbt.SbtScalariform)
|
||||
.settings(
|
||||
inThisBuild(
|
||||
Seq(
|
||||
|
|
@ -40,6 +40,9 @@ lazy val lmRoot = (project in file("."))
|
|||
scmInfo := Some(ScmInfo(url("https://github.com/sbt/librarymanagement"),
|
||||
"git@github.com:sbt/librarymanagement.git")),
|
||||
bintrayPackage := "librarymanagement",
|
||||
scalafmtOnCompile := true,
|
||||
// scalafmtVersion 1.0.0-RC3 has regression
|
||||
scalafmtVersion := "0.6.8",
|
||||
git.baseVersion := baseVersion
|
||||
)),
|
||||
commonSettings,
|
||||
|
|
@ -52,7 +55,6 @@ lazy val lmRoot = (project in file("."))
|
|||
)
|
||||
|
||||
lazy val lm = (project in file("librarymanagement"))
|
||||
.disablePlugins(com.typesafe.sbt.SbtScalariform)
|
||||
.settings(
|
||||
commonSettings,
|
||||
name := "librarymanagement",
|
||||
|
|
@ -71,7 +73,7 @@ lazy val lm = (project in file("librarymanagement"))
|
|||
streams.value,
|
||||
(compile in Compile).value))
|
||||
.taskValue,
|
||||
mimaBinaryIssueFilters ++= Seq(),
|
||||
// mimaBinaryIssueFilters ++= Seq(),
|
||||
contrabandFormatsForType in generateContrabands in Compile := DatatypeConfig.getFormats,
|
||||
// WORKAROUND sbt/sbt#2205 include managed sources in packageSrc
|
||||
mappings in (Compile, packageSrc) ++= {
|
||||
|
|
|
|||
|
|
@ -3,4 +3,4 @@ package sbt.internal.librarymanagement
|
|||
private[sbt] object IvyUtil {
|
||||
def separate[A, B](l: Seq[Either[A, B]]): (Seq[A], Seq[B]) =
|
||||
(l.flatMap(_.left.toOption), l.flatMap(_.right.toOption))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,66 +0,0 @@
|
|||
import org.scalafmt.bootstrap.ScalafmtBootstrap
|
||||
import org.scalafmt.sbt.ScalafmtPlugin
|
||||
import sbt._
|
||||
import sbt.Keys._
|
||||
import sbt.inc.Analysis
|
||||
|
||||
// Taken from https://github.com/akka/alpakka/blob/master/project/AutomateScalafmtPlugin.scala
|
||||
object AutomateScalafmtPlugin extends AutoPlugin {
|
||||
object autoImport {
|
||||
def automateScalafmtFor(configurations: Configuration*): Seq[Setting[_]] =
|
||||
configurations.flatMap { c =>
|
||||
inConfig(c)(
|
||||
Seq(
|
||||
compileInputs.in(compile) := {
|
||||
scalafmtInc.value
|
||||
compileInputs.in(compile).value
|
||||
},
|
||||
sourceDirectories.in(scalafmtInc) := Seq(scalaSource.value),
|
||||
scalafmtInc := {
|
||||
val cache = streams.value.cacheDirectory / "scalafmt"
|
||||
val include = includeFilter.in(scalafmtInc).value
|
||||
val exclude = excludeFilter.in(scalafmtInc).value
|
||||
val sources =
|
||||
sourceDirectories
|
||||
.in(scalafmtInc)
|
||||
.value
|
||||
.descendantsExcept(include, exclude)
|
||||
.get
|
||||
.toSet
|
||||
def format(handler: Set[File] => Unit, msg: String) = {
|
||||
def update(handler: Set[File] => Unit, msg: String)(in: ChangeReport[File],
|
||||
out: ChangeReport[File]) = {
|
||||
val label = Reference.display(thisProjectRef.value)
|
||||
val files = in.modified -- in.removed
|
||||
Analysis
|
||||
.counted("Scala source", "", "s", files.size)
|
||||
.foreach(count => streams.value.log.info(s"$msg $count in $label ..."))
|
||||
handler(files)
|
||||
files
|
||||
}
|
||||
FileFunction.cached(cache)(FilesInfo.hash, FilesInfo.exists)(update(handler, msg))(
|
||||
sources
|
||||
)
|
||||
}
|
||||
def formattingHandler(files: Set[File]) =
|
||||
if (files.nonEmpty) {
|
||||
val filesArg = files.map(_.getAbsolutePath).mkString(",")
|
||||
ScalafmtBootstrap.main(List("--quiet", "-i", "-f", filesArg))
|
||||
}
|
||||
format(formattingHandler, "Formatting")
|
||||
format(_ => (), "Reformatted") // Recalculate the cache
|
||||
}
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private val scalafmtInc = taskKey[Unit]("Incrementally format modified sources")
|
||||
|
||||
override def requires = ScalafmtPlugin
|
||||
|
||||
override def trigger = allRequirements
|
||||
|
||||
override def projectSettings =
|
||||
(includeFilter.in(scalafmtInc) := "*.scala") +: autoImport.automateScalafmtFor(Compile, Test)
|
||||
}
|
||||
|
|
@ -2,8 +2,8 @@ import sbt._
|
|||
import Keys._
|
||||
|
||||
object Dependencies {
|
||||
val scala211 = "2.11.8"
|
||||
val scala212 = "2.12.1"
|
||||
val scala211 = "2.11.11"
|
||||
val scala212 = "2.12.2"
|
||||
|
||||
private val ioVersion = "1.0.0-M11"
|
||||
private val utilVersion = "1.0.0-M23"
|
||||
|
|
@ -34,7 +34,7 @@ object Dependencies {
|
|||
c: Option[Configuration] = None) =
|
||||
path match {
|
||||
case Some(f) =>
|
||||
p dependsOn c.fold[ClasspathDependency](ProjectRef(file(f), projectName))(
|
||||
p dependsOn c.fold[ClasspathDep[ProjectReference]](ProjectRef(file(f), projectName))(
|
||||
ProjectRef(file(f), projectName) % _)
|
||||
case None => p settings (libraryDependencies += c.fold(m)(m % _))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,21 +3,23 @@ import Keys._
|
|||
import sbt.IO
|
||||
|
||||
import java.io.File
|
||||
import xsbti.compile.CompileAnalysis
|
||||
|
||||
object Util {
|
||||
|
||||
def versionLine(version: String): String = "version=" + version
|
||||
def containsVersion(propFile: File, version: String): Boolean =
|
||||
IO.read(propFile).contains(versionLine(version))
|
||||
def lastCompilationTime(analysis: sbt.inc.Analysis): Long = {
|
||||
def lastCompilationTime(analysis0: CompileAnalysis): Long = {
|
||||
val analysis = analysis0 match { case a: sbt.internal.inc.Analysis => a }
|
||||
val lastCompilation = analysis.compilations.allCompilations.lastOption
|
||||
lastCompilation.map(_.startTime) getOrElse 0L
|
||||
lastCompilation.map(_.getStartTime) getOrElse 0L
|
||||
}
|
||||
|
||||
def generateVersionFile(version: String,
|
||||
dir: File,
|
||||
s: TaskStreams,
|
||||
analysis: sbt.inc.Analysis): Seq[File] = {
|
||||
analysis: CompileAnalysis): Seq[File] = {
|
||||
import java.util.{ Date, TimeZone }
|
||||
val formatter = new java.text.SimpleDateFormat("yyyyMMdd'T'HHmmss")
|
||||
formatter.setTimeZone(TimeZone.getTimeZone("GMT"))
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
sbt.version=0.13.15
|
||||
sbt.version=1.0.0-M6
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
addSbtPlugin("org.scala-sbt" % "sbt-houserules" % "0.3.2")
|
||||
addSbtPlugin("com.eed3si9n" % "sbt-doge" % "0.1.3")
|
||||
addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.3.0-M4")
|
||||
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0")
|
||||
addSbtPlugin("com.geirsson" % "sbt-scalafmt" % "0.6.8")
|
||||
addSbtPlugin("org.scala-sbt" % "sbt-houserules" % "0.3.3")
|
||||
addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.3.0-M5")
|
||||
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.4.0")
|
||||
addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.3")
|
||||
|
||||
scalacOptions += "-language:postfixOps"
|
||||
|
|
|
|||
Loading…
Reference in New Issue