mirror of https://github.com/sbt/sbt.git
Merge branch '1.x' into 1.0.x
This commit is contained in:
commit
8c04b267bf
|
|
@ -1,3 +1,8 @@
|
||||||
target/
|
target/
|
||||||
__pycache__
|
__pycache__
|
||||||
toolbox.classpath
|
toolbox.classpath
|
||||||
|
out
|
||||||
|
node_modules
|
||||||
|
vscode-sbt-scala/client/server
|
||||||
|
npm-debug.log
|
||||||
|
*.vsix
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ matrix:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
matrix:
|
matrix:
|
||||||
- SBT_CMD=";mimaReportBinaryIssues ;scalafmt::test ;test:scalafmt::test ;sbt:scalafmt::test ;test:compile ;mainSettingsProj/test ;safeUnitTests ;otherUnitTests"
|
- SBT_CMD=";mimaReportBinaryIssues ;scalafmt::test ;test:scalafmt::test ;sbt:scalafmt::test ;headerCheck ;test:headerCheck ;test:compile ;mainSettingsProj/test ;safeUnitTests ;otherUnitTests"
|
||||||
- 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/*"
|
||||||
- SBT_CMD="scripted dependency-management/*1of4"
|
- SBT_CMD="scripted dependency-management/*1of4"
|
||||||
|
|
@ -26,7 +26,7 @@ env:
|
||||||
- SBT_CMD="scripted dependency-management/*4of4"
|
- SBT_CMD="scripted dependency-management/*4of4"
|
||||||
- SBT_CMD="scripted java/* package/* reporter/* run/* project-load/*"
|
- SBT_CMD="scripted java/* package/* reporter/* run/* project-load/*"
|
||||||
- SBT_CMD="scripted project/*1of2"
|
- SBT_CMD="scripted project/*1of2"
|
||||||
- SBT_CMD="scripted project/*2of2"
|
- SBT_CMD="scripted project/*2of2 server/*"
|
||||||
- SBT_CMD="scripted source-dependencies/*1of3"
|
- SBT_CMD="scripted source-dependencies/*1of3"
|
||||||
- SBT_CMD="scripted source-dependencies/*2of3"
|
- SBT_CMD="scripted source-dependencies/*2of3"
|
||||||
- SBT_CMD="scripted source-dependencies/*3of3"
|
- SBT_CMD="scripted source-dependencies/*3of3"
|
||||||
|
|
|
||||||
43
LICENSE
43
LICENSE
|
|
@ -1,25 +1,28 @@
|
||||||
Copyright (c) 2008-2014 Typesafe Inc, Mark Harrah, Grzegorz Kossakowski, Josh Suereth, Indrajit Raychaudhuri, Eugene Yokota, and other contributors.
|
Copyright (c) 2011 - 2017, Lightbend, Inc.
|
||||||
|
Copyright (c) 2008 - 2010, Mark Harrah
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions
|
modification, are permitted provided that the following conditions are met:
|
||||||
are met:
|
|
||||||
1. Redistributions of source code must retain the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer.
|
|
||||||
2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer in the
|
|
||||||
documentation and/or other materials provided with the distribution.
|
|
||||||
3. The name of the author may not be used to endorse or promote products
|
|
||||||
derived from this software without specific prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
* Redistributions of source code must retain the above copyright notice, this
|
||||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
list of conditions and the following disclaimer.
|
||||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
||||||
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
||||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
||||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
||||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
||||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
||||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer in the documentation
|
||||||
|
and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
* Neither the name of the copyright holder nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from
|
||||||
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
|
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
|
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
|
||||||
6
NOTICE
6
NOTICE
|
|
@ -1,6 +1,7 @@
|
||||||
sbt
|
sbt
|
||||||
Copyright (c) 2008-2014 Typesafe Inc, Mark Harrah, Grzegorz Kossakowski, Josh Suereth, Indrajit Raychaudhuri, Eugene Yokota, and other contributors.
|
Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
Licensed under BSD-style license (see LICENSE)
|
Copyright 2008 - 2010, Mark Harrah
|
||||||
|
Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
|
||||||
Portions based on code from the Scala compiler. Portions of the Scala
|
Portions based on code from the Scala compiler. Portions of the Scala
|
||||||
library are distributed with the launcher.
|
library are distributed with the launcher.
|
||||||
|
|
@ -33,4 +34,3 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
76
build.sbt
76
build.sbt
|
|
@ -39,13 +39,21 @@ def buildLevelSettings: Seq[Setting[_]] =
|
||||||
|
|
||||||
def commonSettings: Seq[Setting[_]] =
|
def commonSettings: Seq[Setting[_]] =
|
||||||
Seq[SettingsDefinition](
|
Seq[SettingsDefinition](
|
||||||
|
headerLicense := Some(HeaderLicense.Custom(
|
||||||
|
"""|sbt
|
||||||
|
|Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
|Copyright 2008 - 2010, Mark Harrah
|
||||||
|
|Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
|""".stripMargin
|
||||||
|
)),
|
||||||
scalaVersion := baseScalaVersion,
|
scalaVersion := baseScalaVersion,
|
||||||
componentID := None,
|
componentID := None,
|
||||||
resolvers += Resolver.typesafeIvyRepo("releases"),
|
resolvers += Resolver.typesafeIvyRepo("releases"),
|
||||||
resolvers += Resolver.sonatypeRepo("snapshots"),
|
resolvers += Resolver.sonatypeRepo("snapshots"),
|
||||||
resolvers += "bintray-sbt-maven-releases" at "https://dl.bintray.com/sbt/maven-releases/",
|
resolvers += "bintray-sbt-maven-releases" at "https://dl.bintray.com/sbt/maven-releases/",
|
||||||
concurrentRestrictions in Global += Util.testExclusiveRestriction,
|
concurrentRestrictions in Global += Util.testExclusiveRestriction,
|
||||||
testOptions += Tests.Argument(TestFrameworks.ScalaCheck, "-w", "1"),
|
testOptions in Test += Tests.Argument(TestFrameworks.ScalaCheck, "-w", "1"),
|
||||||
|
testOptions in Test += Tests.Argument(TestFrameworks.ScalaCheck, "-verbosity", "2"),
|
||||||
javacOptions in compile ++= Seq("-target", "6", "-source", "6", "-Xlint", "-Xlint:-serial"),
|
javacOptions in compile ++= Seq("-target", "6", "-source", "6", "-Xlint", "-Xlint:-serial"),
|
||||||
crossScalaVersions := Seq(baseScalaVersion),
|
crossScalaVersions := Seq(baseScalaVersion),
|
||||||
bintrayPackage := (bintrayPackage in ThisBuild).value,
|
bintrayPackage := (bintrayPackage in ThisBuild).value,
|
||||||
|
|
@ -132,6 +140,10 @@ val collectionProj = (project in file("internal") / "util-collection")
|
||||||
name := "Collections",
|
name := "Collections",
|
||||||
libraryDependencies ++= Seq(sjsonNewScalaJson.value),
|
libraryDependencies ++= Seq(sjsonNewScalaJson.value),
|
||||||
mimaSettings,
|
mimaSettings,
|
||||||
|
mimaBinaryIssueFilters ++= Seq(
|
||||||
|
// Added private[sbt] method to capture State attributes.
|
||||||
|
exclude[ReversedMissingMethodProblem]("sbt.internal.util.AttributeMap.setCond"),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.configure(addSbtUtilPosition)
|
.configure(addSbtUtilPosition)
|
||||||
|
|
||||||
|
|
@ -230,7 +242,7 @@ lazy val scriptedSbtProj = (project in scriptedPath / "sbt")
|
||||||
libraryDependencies ++= Seq(launcherInterface % "provided"),
|
libraryDependencies ++= Seq(launcherInterface % "provided"),
|
||||||
mimaSettings,
|
mimaSettings,
|
||||||
)
|
)
|
||||||
.configure(addSbtIO, addSbtUtilLogging, addSbtCompilerInterface, addSbtUtilScripted)
|
.configure(addSbtIO, addSbtUtilLogging, addSbtCompilerInterface, addSbtUtilScripted, addSbtLmCore)
|
||||||
|
|
||||||
lazy val scriptedPluginProj = (project in scriptedPath / "plugin")
|
lazy val scriptedPluginProj = (project in scriptedPath / "plugin")
|
||||||
.dependsOn(sbtProj)
|
.dependsOn(sbtProj)
|
||||||
|
|
@ -290,6 +302,14 @@ lazy val commandProj = (project in file("main-command"))
|
||||||
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",
|
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",
|
||||||
contrabandFormatsForType in generateContrabands in Compile := ContrabandConfig.getFormats,
|
contrabandFormatsForType in generateContrabands in Compile := ContrabandConfig.getFormats,
|
||||||
mimaSettings,
|
mimaSettings,
|
||||||
|
mimaBinaryIssueFilters ++= Vector(
|
||||||
|
// Changed the signature of Server method. nacho cheese.
|
||||||
|
exclude[DirectMissingMethodProblem]("sbt.internal.server.Server.*"),
|
||||||
|
// Added method to ServerInstance. This is also internal.
|
||||||
|
exclude[ReversedMissingMethodProblem]("sbt.internal.server.ServerInstance.*"),
|
||||||
|
// Added method to CommandChannel. internal.
|
||||||
|
exclude[ReversedMissingMethodProblem]("sbt.internal.CommandChannel.*"),
|
||||||
|
)
|
||||||
)
|
)
|
||||||
.configure(
|
.configure(
|
||||||
addSbtIO,
|
addSbtIO,
|
||||||
|
|
@ -361,6 +381,19 @@ lazy val mainProj = (project in file("main"))
|
||||||
baseDirectory.value / "src" / "main" / "contraband-scala",
|
baseDirectory.value / "src" / "main" / "contraband-scala",
|
||||||
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",
|
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",
|
||||||
mimaSettings,
|
mimaSettings,
|
||||||
|
mimaBinaryIssueFilters ++= Vector(
|
||||||
|
// Changed the signature of NetworkChannel ctor. internal.
|
||||||
|
exclude[DirectMissingMethodProblem]("sbt.internal.server.NetworkChannel.*"),
|
||||||
|
// ctor for ConfigIndex. internal.
|
||||||
|
exclude[DirectMissingMethodProblem]("sbt.internal.ConfigIndex.*"),
|
||||||
|
// New and changed methods on KeyIndex. internal.
|
||||||
|
exclude[ReversedMissingMethodProblem]("sbt.internal.KeyIndex.*"),
|
||||||
|
exclude[DirectMissingMethodProblem]("sbt.internal.KeyIndex.*"),
|
||||||
|
// Removed unused val. internal.
|
||||||
|
exclude[DirectMissingMethodProblem]("sbt.internal.RelayAppender.jsonFormat"),
|
||||||
|
// Removed unused def. internal.
|
||||||
|
exclude[DirectMissingMethodProblem]("sbt.internal.Load.isProjectThis"),
|
||||||
|
)
|
||||||
)
|
)
|
||||||
.configure(
|
.configure(
|
||||||
addSbtIO,
|
addSbtIO,
|
||||||
|
|
@ -387,6 +420,45 @@ lazy val sbtProj = (project in file("sbt"))
|
||||||
)
|
)
|
||||||
.configure(addSbtCompilerBridge)
|
.configure(addSbtCompilerBridge)
|
||||||
|
|
||||||
|
lazy val vscodePlugin = (project in file("vscode-sbt-scala"))
|
||||||
|
.settings(
|
||||||
|
crossPaths := false,
|
||||||
|
crossScalaVersions := Seq(baseScalaVersion),
|
||||||
|
skip in publish := true,
|
||||||
|
compile in Compile := {
|
||||||
|
val u = update.value
|
||||||
|
val log = streams.value.log
|
||||||
|
import sbt.internal.inc.Analysis
|
||||||
|
import scala.sys.process._
|
||||||
|
val exitCode = Process(s"npm run compile", Option(baseDirectory.value)) ! log
|
||||||
|
if (exitCode != 0) throw new Exception("Process returned exit code: " + exitCode)
|
||||||
|
Analysis.empty
|
||||||
|
},
|
||||||
|
update := {
|
||||||
|
val old = update.value
|
||||||
|
val t = target.value / "updated"
|
||||||
|
val base = baseDirectory.value
|
||||||
|
val log = streams.value.log
|
||||||
|
if (t.exists) ()
|
||||||
|
else {
|
||||||
|
import scala.sys.process._
|
||||||
|
val exitCode = Process("npm install", Option(base)) ! log
|
||||||
|
if (exitCode != 0) throw new Exception("Process returned exit code: " + exitCode)
|
||||||
|
IO.touch(t)
|
||||||
|
}
|
||||||
|
old
|
||||||
|
},
|
||||||
|
cleanFiles ++= {
|
||||||
|
val base = baseDirectory.value
|
||||||
|
Vector(
|
||||||
|
target.value / "updated",
|
||||||
|
base / "node_modules", base / "client" / "node_modules",
|
||||||
|
base / "client" / "server",
|
||||||
|
base / "client" / "out",
|
||||||
|
base / "server" / "node_modules") filter { _.exists }
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
lazy val sbtIgnoredProblems = {
|
lazy val sbtIgnoredProblems = {
|
||||||
Seq(
|
Seq(
|
||||||
// Added more items to Import trait.
|
// Added more items to Import trait.
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package appmacro
|
package appmacro
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package appmacro
|
package appmacro
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package appmacro
|
package appmacro
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package appmacro
|
package appmacro
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util.appmacro
|
package sbt.internal.util.appmacro
|
||||||
|
|
||||||
import scala.reflect.macros.blackbox
|
import scala.reflect.macros.blackbox
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package appmacro
|
package appmacro
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package appmacro
|
package appmacro
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package appmacro
|
package appmacro
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
Simple Build Tool: Collection Component
|
sbt: Collection Component
|
||||||
Copyright 2010 Mark Harrah
|
Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
Licensed under BSD-style license (see LICENSE)
|
Copyright 2008 - 2010, Mark Harrah
|
||||||
|
Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
import Classes.Applicative
|
import Classes.Applicative
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2010 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
import Types._
|
import Types._
|
||||||
|
|
@ -92,6 +96,11 @@ object AttributeKey {
|
||||||
rank0: Int
|
rank0: Int
|
||||||
)(implicit mf: Manifest[T], ojw: OptJsonWriter[T]): AttributeKey[T] =
|
)(implicit mf: Manifest[T], ojw: OptJsonWriter[T]): AttributeKey[T] =
|
||||||
new SharedAttributeKey[T] {
|
new SharedAttributeKey[T] {
|
||||||
|
require(name.headOption match {
|
||||||
|
case Some(c) => c.isLower
|
||||||
|
case None => false
|
||||||
|
}, s"A named attribute key must start with a lowercase letter: $name")
|
||||||
|
|
||||||
def manifest = mf
|
def manifest = mf
|
||||||
val label = Util.hyphenToCamel(name)
|
val label = Util.hyphenToCamel(name)
|
||||||
def description = description0
|
def description = description0
|
||||||
|
|
@ -168,6 +177,11 @@ trait AttributeMap {
|
||||||
/** `true` if there are no mappings in this map, `false` if there are. */
|
/** `true` if there are no mappings in this map, `false` if there are. */
|
||||||
def isEmpty: Boolean
|
def isEmpty: Boolean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the mapping `k -> opt.get` if opt is Some.
|
||||||
|
* Otherwise, it returns this map without the mapping for `k`.
|
||||||
|
*/
|
||||||
|
private[sbt] def setCond[T](k: AttributeKey[T], opt: Option[T]): AttributeMap
|
||||||
}
|
}
|
||||||
|
|
||||||
object AttributeMap {
|
object AttributeMap {
|
||||||
|
|
@ -217,6 +231,12 @@ private class BasicAttributeMap(private val backing: Map[AttributeKey[_], Any])
|
||||||
def entries: Iterable[AttributeEntry[_]] =
|
def entries: Iterable[AttributeEntry[_]] =
|
||||||
for ((k: AttributeKey[kt], v) <- backing) yield AttributeEntry(k, v.asInstanceOf[kt])
|
for ((k: AttributeKey[kt], v) <- backing) yield AttributeEntry(k, v.asInstanceOf[kt])
|
||||||
|
|
||||||
|
private[sbt] def setCond[T](k: AttributeKey[T], opt: Option[T]): AttributeMap =
|
||||||
|
opt match {
|
||||||
|
case Some(v) => put(k, v)
|
||||||
|
case None => remove(k)
|
||||||
|
}
|
||||||
|
|
||||||
override def toString = entries.mkString("(", ", ", ")")
|
override def toString = entries.mkString("(", ", ", ")")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
object Classes {
|
object Classes {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2008, 2009, 2010 David MacIver, Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
trait Dag[Node <: Dag[Node]] { self: Node =>
|
trait Dag[Node <: Dag[Node]] { self: Node =>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2010 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
import Types._
|
import Types._
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
package internal
|
package internal
|
||||||
package util
|
package util
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2010 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
/** A mutable set interface that uses object identity to test for set membership.*/
|
/** A mutable set interface that uses object identity to test for set membership.*/
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
import java.lang.Runnable
|
import java.lang.Runnable
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
import Types._
|
import Types._
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2010 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
import collection.mutable
|
import collection.mutable
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2010 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
// Used to emulate ~> literals
|
// Used to emulate ~> literals
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2011 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
import scala.language.existentials
|
import scala.language.existentials
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
object Signals {
|
object Signals {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2010 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
trait TypeFunctions {
|
trait TypeFunctions {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2010 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
object Types extends Types
|
object Types extends Types
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2011 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.util
|
package sbt.util
|
||||||
|
|
||||||
import sjsonnew.JsonWriter
|
import sjsonnew.JsonWriter
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.util
|
package sbt.util
|
||||||
|
|
||||||
trait Show[A] {
|
trait Show[A] {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2008 Mark Harrah */
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
package internal
|
package internal
|
||||||
package util
|
package util
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
import org.scalacheck._
|
import org.scalacheck._
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2010 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
// compilation test
|
// compilation test
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2010 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
import Types._
|
import Types._
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
import sbt.util.Show
|
import sbt.util.Show
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
import org.scalacheck._
|
import org.scalacheck._
|
||||||
|
|
@ -80,7 +87,12 @@ object SettingsTest extends Properties("settings") {
|
||||||
private def mkAttrKeys[T](nr: Int)(implicit mf: Manifest[T]): Gen[List[AttributeKey[T]]] = {
|
private def mkAttrKeys[T](nr: Int)(implicit mf: Manifest[T]): Gen[List[AttributeKey[T]]] = {
|
||||||
import Gen._
|
import Gen._
|
||||||
val nonEmptyAlphaStr =
|
val nonEmptyAlphaStr =
|
||||||
nonEmptyListOf(alphaChar).map(_.mkString).suchThat(_.forall(_.isLetter))
|
nonEmptyListOf(alphaChar)
|
||||||
|
.map({ xs: List[Char] =>
|
||||||
|
val s = xs.mkString
|
||||||
|
s.take(1).toLowerCase + s.drop(1)
|
||||||
|
})
|
||||||
|
.suchThat(_.forall(_.isLetter))
|
||||||
|
|
||||||
(for {
|
(for {
|
||||||
list <- Gen.listOfN(nr, nonEmptyAlphaStr) suchThat (l => l.size == l.distinct.size)
|
list <- Gen.listOfN(nr, nonEmptyAlphaStr) suchThat (l => l.size == l.distinct.size)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
import org.scalatest._
|
import org.scalatest._
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
Simple Build Tool: Completion Component
|
sbt: Completion Component
|
||||||
Copyright 2010 Mark Harrah
|
Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
Licensed under BSD-style license (see LICENSE)
|
Copyright 2008 - 2010, Mark Harrah
|
||||||
|
Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2008, 2009 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
import jline.console.ConsoleReader
|
import jline.console.ConsoleReader
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2010 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package complete
|
package complete
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package complete
|
package complete
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package complete
|
package complete
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2010 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package complete
|
package complete
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2010 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package complete
|
package complete
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2011 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package complete
|
package complete
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2008, 2010, 2011 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package complete
|
package complete
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2011 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package complete
|
package complete
|
||||||
|
|
||||||
|
|
@ -43,6 +47,12 @@ trait Parsers {
|
||||||
/** Parses a single letter, according to Char.isLetter, into a Char. */
|
/** Parses a single letter, according to Char.isLetter, into a Char. */
|
||||||
lazy val Letter = charClass(_.isLetter, "letter")
|
lazy val Letter = charClass(_.isLetter, "letter")
|
||||||
|
|
||||||
|
/** Parses a single letter, according to Char.isUpper, into a Char. */
|
||||||
|
lazy val Upper = charClass(_.isUpper, "upper")
|
||||||
|
|
||||||
|
/** Parses a single letter, according to Char.isLower, into a Char. */
|
||||||
|
lazy val Lower = charClass(_.isLower, "lower")
|
||||||
|
|
||||||
/** Parses the first Char in an sbt identifier, which must be a [[Letter]].*/
|
/** Parses the first Char in an sbt identifier, which must be a [[Letter]].*/
|
||||||
def IDStart = Letter
|
def IDStart = Letter
|
||||||
|
|
||||||
|
|
@ -67,6 +77,9 @@ trait Parsers {
|
||||||
/** Parses a non-symbolic Scala-like identifier. The identifier must start with [[IDStart]] and contain zero or more [[ScalaIDChar]]s after that.*/
|
/** Parses a non-symbolic Scala-like identifier. The identifier must start with [[IDStart]] and contain zero or more [[ScalaIDChar]]s after that.*/
|
||||||
lazy val ScalaID = identifier(IDStart, ScalaIDChar)
|
lazy val ScalaID = identifier(IDStart, ScalaIDChar)
|
||||||
|
|
||||||
|
/** Parses a non-symbolic Scala-like identifier. The identifier must start with [[Upper]] and contain zero or more [[ScalaIDChar]]s after that.*/
|
||||||
|
lazy val CapitalizedID = identifier(Upper, ScalaIDChar)
|
||||||
|
|
||||||
/** Parses a String that starts with `start` and is followed by zero or more characters parsed by `rep`.*/
|
/** Parses a String that starts with `start` and is followed by zero or more characters parsed by `rep`.*/
|
||||||
def identifier(start: Parser[Char], rep: Parser[Char]): Parser[String] =
|
def identifier(start: Parser[Char], rep: Parser[Char]): Parser[String] =
|
||||||
start ~ rep.* map { case x ~ xs => (x +: xs).mkString }
|
start ~ rep.* map { case x ~ xs => (x +: xs).mkString }
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package complete
|
package complete
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package complete
|
package complete
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package complete
|
package complete
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2008,2010 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package complete
|
package complete
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package complete
|
package complete
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
|
|
||||||
import org.scalatest._
|
import org.scalatest._
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package complete
|
package complete
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package complete
|
package complete
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package complete
|
package complete
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package logic
|
package logic
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt.internal.util
|
package sbt.internal.util
|
||||||
package logic
|
package logic
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
Simple Build Tool Launcher
|
sbt Launcher
|
||||||
Copyright 2008, 2009, 2010 Mark Harrah, David MacIver
|
Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
Licensed under BSD-style license (see LICENSE)
|
Copyright 2008 - 2010, Mark Harrah, David MacIver
|
||||||
|
Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
|
||||||
Classes from the Scala library are distributed with the launcher.
|
Classes from the Scala library are distributed with the launcher.
|
||||||
Copyright 2002-2013 EPFL, Lausanne
|
Copyright 2002-2013 EPFL, Lausanne
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2008, 2009, 2010 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2008, 2009, 2010, 2011 Mark Harrah, Indrajit Raychaudhuri
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2008, 2009, 2010 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2012 Eugene Vigdorchik
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import scala.collection.mutable
|
import scala.collection.mutable
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2010 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import scala.Predef.{ conforms => _, _ }
|
import scala.Predef.{ conforms => _, _ }
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2008, 2009, 2010, 2011 Mark Harrah, Indrajit Raychaudhuri
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2010 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import java.io.{ File, IOException }
|
import java.io.{ File, IOException }
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import sbt.Tests.{ Output, Summary }
|
import sbt.Tests.{ Output, Summary }
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2010 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import std._
|
import std._
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
package compiler
|
package compiler
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import org.scalacheck._
|
import org.scalacheck._
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
package compiler
|
package compiler
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
/**
|
||||||
|
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
|
||||||
|
*/
|
||||||
|
|
||||||
|
// DO NOT EDIT MANUALLY
|
||||||
|
import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
|
||||||
|
trait ServerAuthenticationFormats { self: sjsonnew.BasicJsonProtocol =>
|
||||||
|
implicit lazy val ServerAuthenticationFormat: JsonFormat[sbt.ServerAuthentication] = new JsonFormat[sbt.ServerAuthentication] {
|
||||||
|
override def read[J](jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.ServerAuthentication = {
|
||||||
|
jsOpt match {
|
||||||
|
case Some(js) =>
|
||||||
|
unbuilder.readString(js) match {
|
||||||
|
case "Token" => sbt.ServerAuthentication.Token
|
||||||
|
}
|
||||||
|
case None =>
|
||||||
|
deserializationError("Expected JsString but found None")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
override def write[J](obj: sbt.ServerAuthentication, builder: Builder[J]): Unit = {
|
||||||
|
val str = obj match {
|
||||||
|
case sbt.ServerAuthentication.Token => "Token"
|
||||||
|
}
|
||||||
|
builder.writeString(str)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
/**
|
||||||
|
* This code is generated using [[http://www.scala-sbt.org/contraband/ sbt-contraband]].
|
||||||
|
*/
|
||||||
|
|
||||||
|
// DO NOT EDIT MANUALLY
|
||||||
|
package sbt
|
||||||
|
sealed abstract class ServerAuthentication extends Serializable
|
||||||
|
object ServerAuthentication {
|
||||||
|
|
||||||
|
|
||||||
|
case object Token extends ServerAuthentication
|
||||||
|
}
|
||||||
|
|
@ -12,3 +12,7 @@ type Exec {
|
||||||
type CommandSource {
|
type CommandSource {
|
||||||
channelName: String!
|
channelName: String!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum ServerAuthentication {
|
||||||
|
Token
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2010 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import sbt.util.Level
|
import sbt.util.Level
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import sbt.util.Level
|
import sbt.util.Level
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
@ -17,6 +24,15 @@ object BasicKeys {
|
||||||
val watch = AttributeKey[Watched]("watch", "Continuous execution configuration.", 1000)
|
val watch = AttributeKey[Watched]("watch", "Continuous execution configuration.", 1000)
|
||||||
val serverPort =
|
val serverPort =
|
||||||
AttributeKey[Int]("server-port", "The port number used by server command.", 10000)
|
AttributeKey[Int]("server-port", "The port number used by server command.", 10000)
|
||||||
|
|
||||||
|
val serverHost =
|
||||||
|
AttributeKey[String]("serverHost", "The host used by server command.", 10000)
|
||||||
|
|
||||||
|
val serverAuthentication =
|
||||||
|
AttributeKey[Set[ServerAuthentication]]("serverAuthentication",
|
||||||
|
"Method of authenticating server command.",
|
||||||
|
10000)
|
||||||
|
|
||||||
private[sbt] val interactive = AttributeKey[Boolean](
|
private[sbt] val interactive = AttributeKey[Boolean](
|
||||||
"interactive",
|
"interactive",
|
||||||
"True if commands are currently being entered from an interactive environment.",
|
"True if commands are currently being entered from an interactive environment.",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2009, 2010 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import sbt.internal.inc.ReflectUtilities
|
import sbt.internal.inc.ReflectUtilities
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException
|
import java.lang.reflect.InvocationTargetException
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import java.util.regex.Pattern
|
import java.util.regex.Pattern
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2009, 2010 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2008, 2009, 2010 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2009, 2010 Mikko Peltonen, Stuart Roebuck, Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
package internal
|
package internal
|
||||||
|
|
||||||
|
|
@ -16,6 +23,7 @@ abstract class CommandChannel {
|
||||||
commandQueue.add(exec)
|
commandQueue.add(exec)
|
||||||
def poll: Option[Exec] = Option(commandQueue.poll)
|
def poll: Option[Exec] = Option(commandQueue.poll)
|
||||||
|
|
||||||
|
def publishEvent[A: JsonFormat](event: A, execId: Option[String]): Unit
|
||||||
def publishEvent[A: JsonFormat](event: A): Unit
|
def publishEvent[A: JsonFormat](event: A): Unit
|
||||||
def publishEventMessage(event: EventMessage): Unit
|
def publishEventMessage(event: EventMessage): Unit
|
||||||
def publishBytes(bytes: Array[Byte]): Unit
|
def publishBytes(bytes: Array[Byte]): Unit
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
package internal
|
package internal
|
||||||
|
|
||||||
|
|
@ -31,6 +38,8 @@ private[sbt] final class ConsoleChannel(val name: String) extends CommandChannel
|
||||||
|
|
||||||
def publishBytes(bytes: Array[Byte]): Unit = ()
|
def publishBytes(bytes: Array[Byte]): Unit = ()
|
||||||
|
|
||||||
|
def publishEvent[A: JsonFormat](event: A, execId: Option[String]): Unit = ()
|
||||||
|
|
||||||
def publishEvent[A: JsonFormat](event: A): Unit = ()
|
def publishEvent[A: JsonFormat](event: A): Unit = ()
|
||||||
|
|
||||||
def publishEventMessage(event: EventMessage): Unit =
|
def publishEventMessage(event: EventMessage): Unit =
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2016 Lightbend Inc. <http://www.lightbend.com>
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
package internal
|
package internal
|
||||||
package client
|
package client
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2016 Lightbend Inc. <http://www.typesafe.com>
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
package internal
|
package internal
|
||||||
package client
|
package client
|
||||||
|
|
|
||||||
|
|
@ -1,34 +1,56 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2016 Lightbend Inc. <http://www.typesafe.com>
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
package internal
|
package internal
|
||||||
package server
|
package server
|
||||||
|
|
||||||
|
import java.io.File
|
||||||
import java.net.{ SocketTimeoutException, InetAddress, ServerSocket, Socket }
|
import java.net.{ SocketTimeoutException, InetAddress, ServerSocket, Socket }
|
||||||
import java.util.concurrent.atomic.AtomicBoolean
|
import java.util.concurrent.atomic.AtomicBoolean
|
||||||
import sbt.util.Logger
|
import java.nio.file.attribute.{ UserPrincipal, AclEntry, AclEntryPermission, AclEntryType }
|
||||||
import sbt.internal.util.ErrorHandling
|
import java.security.SecureRandom
|
||||||
|
import java.math.BigInteger
|
||||||
import scala.concurrent.{ Future, Promise }
|
import scala.concurrent.{ Future, Promise }
|
||||||
import scala.util.{ Try, Success, Failure }
|
import scala.util.{ Try, Success, Failure }
|
||||||
|
import sbt.internal.util.ErrorHandling
|
||||||
|
import sbt.internal.protocol.{ PortFile, TokenFile }
|
||||||
|
import sbt.util.Logger
|
||||||
|
import sbt.io.IO
|
||||||
|
import sbt.io.syntax._
|
||||||
|
import sjsonnew.support.scalajson.unsafe.{ Converter, CompactPrinter }
|
||||||
|
import sbt.internal.protocol.codec._
|
||||||
|
|
||||||
private[sbt] sealed trait ServerInstance {
|
private[sbt] sealed trait ServerInstance {
|
||||||
def shutdown(): Unit
|
def shutdown(): Unit
|
||||||
def ready: Future[Unit]
|
def ready: Future[Unit]
|
||||||
|
def authenticate(challenge: String): Boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
private[sbt] object Server {
|
private[sbt] object Server {
|
||||||
|
sealed trait JsonProtocol
|
||||||
|
extends sjsonnew.BasicJsonProtocol
|
||||||
|
with PortFileFormats
|
||||||
|
with TokenFileFormats
|
||||||
|
object JsonProtocol extends JsonProtocol
|
||||||
|
|
||||||
def start(host: String,
|
def start(host: String,
|
||||||
port: Int,
|
port: Int,
|
||||||
onIncomingSocket: Socket => Unit,
|
onIncomingSocket: (Socket, ServerInstance) => Unit,
|
||||||
/*onIncomingCommand: CommandMessage => Unit,*/ log: Logger): ServerInstance =
|
auth: Set[ServerAuthentication],
|
||||||
new ServerInstance {
|
portfile: File,
|
||||||
|
tokenfile: File,
|
||||||
// val lock = new AnyRef {}
|
log: Logger): ServerInstance =
|
||||||
// val clients: mutable.ListBuffer[ClientConnection] = mutable.ListBuffer.empty
|
new ServerInstance { self =>
|
||||||
val running = new AtomicBoolean(false)
|
val running = new AtomicBoolean(false)
|
||||||
val p: Promise[Unit] = Promise[Unit]()
|
val p: Promise[Unit] = Promise[Unit]()
|
||||||
val ready: Future[Unit] = p.future
|
val ready: Future[Unit] = p.future
|
||||||
|
private[this] val rand = new SecureRandom
|
||||||
|
private[this] var token: String = nextToken
|
||||||
|
|
||||||
val serverThread = new Thread("sbt-socket-server") {
|
val serverThread = new Thread("sbt-socket-server") {
|
||||||
override def run(): Unit = {
|
override def run(): Unit = {
|
||||||
|
|
@ -41,12 +63,13 @@ private[sbt] object Server {
|
||||||
case Success(serverSocket) =>
|
case Success(serverSocket) =>
|
||||||
serverSocket.setSoTimeout(5000)
|
serverSocket.setSoTimeout(5000)
|
||||||
log.info(s"sbt server started at $host:$port")
|
log.info(s"sbt server started at $host:$port")
|
||||||
|
writePortfile()
|
||||||
running.set(true)
|
running.set(true)
|
||||||
p.success(())
|
p.success(())
|
||||||
while (running.get()) {
|
while (running.get()) {
|
||||||
try {
|
try {
|
||||||
val socket = serverSocket.accept()
|
val socket = serverSocket.accept()
|
||||||
onIncomingSocket(socket)
|
onIncomingSocket(socket, self)
|
||||||
} catch {
|
} catch {
|
||||||
case _: SocketTimeoutException => // its ok
|
case _: SocketTimeoutException => // its ok
|
||||||
}
|
}
|
||||||
|
|
@ -56,10 +79,79 @@ private[sbt] object Server {
|
||||||
}
|
}
|
||||||
serverThread.start()
|
serverThread.start()
|
||||||
|
|
||||||
|
override def authenticate(challenge: String): Boolean = synchronized {
|
||||||
|
if (token == challenge) {
|
||||||
|
token = nextToken
|
||||||
|
writeTokenfile()
|
||||||
|
true
|
||||||
|
} else false
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Generates 128-bit non-negative integer, and represent it as decimal string. */
|
||||||
|
private[this] def nextToken: String = {
|
||||||
|
new BigInteger(128, rand).toString
|
||||||
|
}
|
||||||
|
|
||||||
override def shutdown(): Unit = {
|
override def shutdown(): Unit = {
|
||||||
log.info("shutting down server")
|
log.info("shutting down server")
|
||||||
|
if (portfile.exists) {
|
||||||
|
IO.delete(portfile)
|
||||||
|
}
|
||||||
|
if (tokenfile.exists) {
|
||||||
|
IO.delete(tokenfile)
|
||||||
|
}
|
||||||
running.set(false)
|
running.set(false)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
private[this] def writeTokenfile(): Unit = {
|
||||||
|
import JsonProtocol._
|
||||||
|
|
||||||
|
val uri = s"tcp://$host:$port"
|
||||||
|
val t = TokenFile(uri, token)
|
||||||
|
val jsonToken = Converter.toJson(t).get
|
||||||
|
|
||||||
|
if (tokenfile.exists) {
|
||||||
|
IO.delete(tokenfile)
|
||||||
|
}
|
||||||
|
IO.touch(tokenfile)
|
||||||
|
ownerOnly(tokenfile)
|
||||||
|
IO.write(tokenfile, CompactPrinter(jsonToken), IO.utf8, true)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Set the persmission of the file such that the only the owner can read/write it. */
|
||||||
|
private[this] def ownerOnly(file: File): Unit = {
|
||||||
|
def acl(owner: UserPrincipal) = {
|
||||||
|
val builder = AclEntry.newBuilder
|
||||||
|
builder.setPrincipal(owner)
|
||||||
|
builder.setPermissions(AclEntryPermission.values(): _*)
|
||||||
|
builder.setType(AclEntryType.ALLOW)
|
||||||
|
builder.build
|
||||||
|
}
|
||||||
|
file match {
|
||||||
|
case _ if IO.isPosix =>
|
||||||
|
IO.chmod("rw-------", file)
|
||||||
|
case _ if IO.hasAclFileAttributeView =>
|
||||||
|
val view = file.aclFileAttributeView
|
||||||
|
view.setAcl(java.util.Collections.singletonList(acl(view.getOwner)))
|
||||||
|
case _ => ()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// This file exists through the lifetime of the server.
|
||||||
|
private[this] def writePortfile(): Unit = {
|
||||||
|
import JsonProtocol._
|
||||||
|
|
||||||
|
val uri = s"tcp://$host:$port"
|
||||||
|
val p =
|
||||||
|
auth match {
|
||||||
|
case _ if auth(ServerAuthentication.Token) =>
|
||||||
|
writeTokenfile()
|
||||||
|
PortFile(uri, Option(tokenfile.toString), Option(tokenfile.toURI.toString))
|
||||||
|
case _ =>
|
||||||
|
PortFile(uri, None, None)
|
||||||
|
}
|
||||||
|
val json = Converter.toJson(p).get
|
||||||
|
IO.write(portfile, CompactPrinter(json))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
/* sbt -- Simple Build Tool
|
/*
|
||||||
* Copyright 2009 Mark Harrah
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package xsbt
|
package xsbt
|
||||||
|
|
||||||
import java.io.{ BufferedReader, BufferedWriter, InputStreamReader, OutputStreamWriter }
|
import java.io.{ BufferedReader, BufferedWriter, InputStreamReader, OutputStreamWriter }
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
final case class ConfigKey(name: String)
|
final case class ConfigKey(name: String)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import sbt.internal.util.Types.const
|
import sbt.internal.util.Types.const
|
||||||
|
|
@ -57,19 +64,38 @@ object Def extends Init[Scope] with TaskMacroExtra {
|
||||||
ref => displayBuildRelative(currentBuild, multi, ref)
|
ref => displayBuildRelative(currentBuild, multi, ref)
|
||||||
))
|
))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a String expression for the given [[Reference]] (BuildRef, [[ProjectRef]], etc)
|
||||||
|
* relative to the current project.
|
||||||
|
*/
|
||||||
|
def displayRelativeReference(current: ProjectRef, project: Reference): String =
|
||||||
|
displayRelative(current, project, false)
|
||||||
|
|
||||||
|
@deprecated("Use displayRelativeReference", "1.1.0")
|
||||||
def displayRelative(current: ProjectRef, multi: Boolean, project: Reference): String =
|
def displayRelative(current: ProjectRef, multi: Boolean, project: Reference): String =
|
||||||
|
displayRelative(current, project, true)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs the String of a given [[Reference]] relative to current.
|
||||||
|
* Note that this no longer takes "multi" parameter, and omits the subproject id at all times.
|
||||||
|
*/
|
||||||
|
private[sbt] def displayRelative(current: ProjectRef,
|
||||||
|
project: Reference,
|
||||||
|
trailingSlash: Boolean): String = {
|
||||||
|
val trailing = if (trailingSlash) " /" else ""
|
||||||
project match {
|
project match {
|
||||||
case BuildRef(current.build) => "{.}/"
|
case BuildRef(current.build) => "ThisBuild" + trailing
|
||||||
case `current` => if (multi) current.project + "/" else ""
|
case `current` => ""
|
||||||
case ProjectRef(current.build, x) => x + "/"
|
case ProjectRef(current.build, x) => x + trailing
|
||||||
case _ => Reference.display(project) + "/"
|
case _ => Reference.display(project) + trailing
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def displayBuildRelative(currentBuild: URI, multi: Boolean, project: Reference): String =
|
def displayBuildRelative(currentBuild: URI, multi: Boolean, project: Reference): String =
|
||||||
project match {
|
project match {
|
||||||
case BuildRef(`currentBuild`) => "{.}/"
|
case BuildRef(`currentBuild`) => "ThisBuild /"
|
||||||
case ProjectRef(`currentBuild`, x) => x + "/"
|
case ProjectRef(`currentBuild`, x) => x + " /"
|
||||||
case _ => Reference.display(project) + "/"
|
case _ => Reference.display(project) + " /"
|
||||||
}
|
}
|
||||||
|
|
||||||
def displayFull(scoped: ScopedKey[_]): String = displayFull(scoped, None)
|
def displayFull(scoped: ScopedKey[_]): String = displayFull(scoped, None)
|
||||||
|
|
@ -80,6 +106,9 @@ object Def extends Init[Scope] with TaskMacroExtra {
|
||||||
def displayMasked(scoped: ScopedKey[_], mask: ScopeMask): String =
|
def displayMasked(scoped: ScopedKey[_], mask: ScopeMask): String =
|
||||||
Scope.displayMasked(scoped.scope, scoped.key.label, mask)
|
Scope.displayMasked(scoped.scope, scoped.key.label, mask)
|
||||||
|
|
||||||
|
def displayMasked(scoped: ScopedKey[_], mask: ScopeMask, showZeroConfig: Boolean): String =
|
||||||
|
Scope.displayMasked(scoped.scope, scoped.key.label, mask, showZeroConfig)
|
||||||
|
|
||||||
def withColor(s: String, color: Option[String]): String = {
|
def withColor(s: String, color: Option[String]): String = {
|
||||||
val useColor = ConsoleAppender.formatEnabledInEnv
|
val useColor = ConsoleAppender.formatEnabledInEnv
|
||||||
color match {
|
color match {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
sealed trait DelegateIndex {
|
sealed trait DelegateIndex {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import sbt.internal.util.complete.Parser
|
import sbt.internal.util.complete.Parser
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
object KeyRanks {
|
object KeyRanks {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
/*
|
||||||
|
* sbt
|
||||||
|
* Copyright 2011 - 2017, Lightbend, Inc.
|
||||||
|
* Copyright 2008 - 2010, Mark Harrah
|
||||||
|
* Licensed under BSD-3-Clause license (see LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
package sbt
|
package sbt
|
||||||
|
|
||||||
import Def.{ Initialize, ScopedKey }
|
import Def.{ Initialize, ScopedKey }
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue