mirror of https://github.com/sbt/sbt.git
commit
627a79c254
|
|
@ -14,6 +14,7 @@ import sbt.util.CacheStoreFactory
|
|||
import sbt.util.Logger
|
||||
import xsbti.Reporter
|
||||
import xsbti.compile.JavaTools
|
||||
import sbt.internal.inc.MappedFileConverter
|
||||
|
||||
object Doc {
|
||||
import RawCompileLike._
|
||||
|
|
@ -44,6 +45,7 @@ object Doc {
|
|||
classpath map { x =>
|
||||
PlainVirtualFile(x.toPath)
|
||||
},
|
||||
MappedFileConverter.empty,
|
||||
outputDirectory.toPath,
|
||||
options,
|
||||
maxErrors,
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ object Defaults extends BuildCommon {
|
|||
) ++ serverHandlers.value :+ ServerHandler.fallback
|
||||
},
|
||||
timeWrappedStamper := Stamps
|
||||
.timeWrapLibraryStamps(Stamps.uncachedStamps(fileConverter.value), fileConverter.value),
|
||||
.timeWrapBinaryStamps(Stamps.uncachedStamps(fileConverter.value), fileConverter.value),
|
||||
reusableStamper := {
|
||||
val converter = fileConverter.value
|
||||
val unmanagedCache = unmanagedFileStampCache.value
|
||||
|
|
@ -1942,7 +1942,8 @@ object Defaults extends BuildCommon {
|
|||
compileOrder.value,
|
||||
None.toOptional: Optional[NioPath],
|
||||
Some(fileConverter.value).toOptional,
|
||||
Some(reusableStamper.value).toOptional
|
||||
Some(reusableStamper.value).toOptional,
|
||||
None.toOptional: Optional[xsbti.compile.Output],
|
||||
)
|
||||
},
|
||||
compilerReporter := {
|
||||
|
|
|
|||
|
|
@ -955,12 +955,7 @@ object BuiltinCommands {
|
|||
|
||||
def registerCompilerCache(s: State): State = {
|
||||
s.get(Keys.stateCompilerCache).foreach(_.clear())
|
||||
|
||||
val maxCompilers: Int = SysProp.residentLimit
|
||||
val cache =
|
||||
if (maxCompilers <= 0) CompilerCache.fresh
|
||||
else CompilerCache.createCacheFor(maxCompilers)
|
||||
s.put(Keys.stateCompilerCache, cache)
|
||||
s.put(Keys.stateCompilerCache, CompilerCache.fresh)
|
||||
}
|
||||
|
||||
def clearCaches: Command = {
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ object SysProp {
|
|||
def watchMode: String =
|
||||
sys.props.get("sbt.watch.mode").getOrElse("auto")
|
||||
|
||||
@deprecated("Resident compilation is no longer supported", "1.4.0")
|
||||
def residentLimit: Int = int("sbt.resident.limit", 0)
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ object Dependencies {
|
|||
private val ioVersion = nightlyVersion.getOrElse("1.4.0-M6")
|
||||
private val lmVersion =
|
||||
sys.props.get("sbt.build.lm.version").orElse(nightlyVersion).getOrElse("1.4.0-M1")
|
||||
val zincVersion = nightlyVersion.getOrElse("1.4.0-M6")
|
||||
val zincVersion = nightlyVersion.getOrElse("1.4.0-M7")
|
||||
|
||||
private val sbtIO = "org.scala-sbt" %% "io" % ioVersion
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
public class A {
|
||||
public Integer x() { return 3; }
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
public class B extends A {}
|
||||
|
|
@ -1 +0,0 @@
|
|||
public class C extends B {}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
public class D {
|
||||
public static final C c = new C();
|
||||
public static String x() { return c.x().toString(); }
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
public class E {
|
||||
public static void main(String[] args) {
|
||||
assert(D.x() == "3");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import sbt.internal.inc.Analysis
|
||||
import complete.DefaultParsers._
|
||||
|
||||
// Reset compiler iterations, necessary because tests run in batch mode
|
||||
val recordPreviousIterations = taskKey[Unit]("Record previous iterations.")
|
||||
recordPreviousIterations := {
|
||||
val log = streams.value.log
|
||||
CompileState.previousIterations = {
|
||||
val previousAnalysis = (previousCompile in Compile).value.analysis.asScala
|
||||
previousAnalysis match {
|
||||
case None =>
|
||||
log.info("No previous analysis detected")
|
||||
0
|
||||
case Some(a: Analysis) => a.compilations.allCompilations.size
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val checkIterations = inputKey[Unit]("Verifies the accumulated number of iterations of incremental compilation.")
|
||||
|
||||
checkIterations := {
|
||||
val expected: Int = (Space ~> NatBasic).parsed
|
||||
val actual: Int = ((compile in Compile).value match { case a: Analysis => a.compilations.allCompilations.size }) - CompileState.previousIterations
|
||||
assert(expected == actual, s"Expected $expected compilations, got $actual")
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
public class A {
|
||||
public String x() { return "3"; }
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
// This is necessary because tests are run in batch mode
|
||||
object CompileState {
|
||||
@volatile var previousIterations: Int = -1
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
# 1 iteration from initial full compile
|
||||
> recordPreviousIterations
|
||||
> run
|
||||
$ copy-file changes/A2.java A.java
|
||||
|
||||
# 1 iteration for the initial changes
|
||||
# 1 iteration to recompile all descendents and direct dependencies
|
||||
# no further iteration, because APIs of directs don't change
|
||||
> run
|
||||
> checkIterations 3
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
class A {
|
||||
def x = 3
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
class B extends A
|
||||
|
|
@ -1 +0,0 @@
|
|||
class C extends B
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
object D {
|
||||
val c = new C
|
||||
def x: String = c.x.toString
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
object E extends App {
|
||||
assert(D.x == "3")
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import sbt.internal.inc.Analysis
|
||||
import complete.DefaultParsers._
|
||||
|
||||
// Reset compiler iterations, necessary because tests run in batch mode
|
||||
val recordPreviousIterations = taskKey[Unit]("Record previous iterations.")
|
||||
recordPreviousIterations := {
|
||||
val log = streams.value.log
|
||||
CompileState.previousIterations = {
|
||||
val previousAnalysis = (previousCompile in Compile).value.analysis.asScala
|
||||
previousAnalysis match {
|
||||
case None =>
|
||||
log.info("No previous analysis detected")
|
||||
0
|
||||
case Some(a: Analysis) => a.compilations.allCompilations.size
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val checkIterations = inputKey[Unit]("Verifies the accumulated number of iterations of incremental compilation.")
|
||||
|
||||
checkIterations := {
|
||||
val expected: Int = (Space ~> NatBasic).parsed
|
||||
val actual: Int = ((compile in Compile).value match { case a: Analysis => a.compilations.allCompilations.size }) - CompileState.previousIterations
|
||||
assert(expected == actual, s"Expected $expected compilations, got $actual")
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
class A {
|
||||
def x = "3"
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
// This is necessary because tests are run in batch mode
|
||||
object CompileState {
|
||||
@volatile var previousIterations: Int = -1
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
# 1 iteration from initial full compile
|
||||
> recordPreviousIterations
|
||||
> run
|
||||
$ copy-file changes/A2.scala A.scala
|
||||
|
||||
# 1 iteration for the initial changes
|
||||
# 1 iteration to recompile all descendents and direct dependencies
|
||||
# no further iteration, because APIs of directs don't change
|
||||
> run
|
||||
> checkIterations 3
|
||||
|
|
@ -9,7 +9,6 @@ package testpkg
|
|||
|
||||
import scala.concurrent.duration._
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
import sbt.Exec
|
||||
|
||||
// starts svr using server-test/events and perform event related tests
|
||||
object EventsTest extends AbstractServerTest {
|
||||
|
|
@ -67,7 +66,9 @@ object EventsTest extends AbstractServerTest {
|
|||
})
|
||||
}
|
||||
|
||||
/* This test is timing out.
|
||||
test("cancel on-going task with string id") { _ =>
|
||||
import sbt.Exec
|
||||
val id = Exec.newExecId
|
||||
svr.sendJsonRpc(
|
||||
s"""{ "jsonrpc": "2.0", "id": "$id", "method": "sbt/exec", "params": { "commandLine": "run" } }"""
|
||||
|
|
@ -83,4 +84,5 @@ object EventsTest extends AbstractServerTest {
|
|||
s contains """"result":{"status":"Task cancelled""""
|
||||
})
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue