Adjust scripted tests for bridge to scala/scala

- use scriptedBatchExecution and scriptedParallelInstances
- set scala version in tests
- implement shared settings
- delete unrelated tests
- adjust tests for fullName until PR 10542 is merged
- adjust test to hard-coded max filename length of 240, it was
  255 on 2.12 (in the zinc repo)
This commit is contained in:
Lukas Rytz 2023-09-28 13:14:07 +02:00
parent 7d879a0b96
commit 7084271425
395 changed files with 4143 additions and 485 deletions

View File

@ -959,16 +959,16 @@ lazy val sbtTest = project.in(file("test") / "sbt-test")
sbtTestDirectory := baseDirectory.value,
// execute each test in a clean new folder, prevent cross-talk
scriptedBatchExecution := false,
scriptedBatchExecution := true, // set to `false` to execute each test in a separate sbt instance
scriptedParallelInstances := 2, // default is 1
// hide sbt output of scripted tests
scriptedBufferLog := true,
scriptedLaunchOpts ++= Seq(
"-Dplugin.scalaVersion=" + version.value,
"-Dsbt.boot.directory=" + (target.value / ".sbt-scripted").getAbsolutePath // Workaround sbt/sbt#3469
"-Dsbt.boot.directory=" + (target.value / ".sbt-scripted").getAbsolutePath, // Workaround sbt/sbt#3469
"-Dscripted.common=" + (baseDirectory.value / "common.sbt.template").getAbsolutePath,
),
// Pass along ivy home and repositories settings to sbt instances run from the tests

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,2 +1,4 @@
> setup; reload
# test case for http://github.com/sbt/sbt/issues/676
> compile

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1 +1,3 @@
> setup; reload
> compile

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,5 @@
> setup; reload
> compile
> checkMainClasses src/main/java/runjava/MainJava.java: runjava.MainJava runjava.MainJava.StaticInner
> checkMainClasses src/main/java/runjava/oMainJava.java:

View File

@ -0,0 +1 @@
scalacOptions ++= Seq("-sourcepath", "srcpath")

View File

@ -1 +0,0 @@
scalac.options = -sourcepath srcpath

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1 +1,3 @@
> setup; reload
> compile

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,5 @@
> setup; reload
# Tests if existential types are pickled correctly so they
# do not introduce unnecessary compile iterations

View File

@ -0,0 +1,121 @@
incOptions := incOptions.value.withRecompileAllFraction(1.0)
Compile / classDirectory := baseDirectory.value / "target/classes"
Compile / classDirectory := baseDirectory.value / "target/classes"
InputKey[Unit]("checkRecompilations") := {
val stepArg :: expected = complete.DefaultParsers.spaceDelimited("<arg>").parsed
val step = stepArg.toInt
val a = (Compile / compile).value.asInstanceOf[sbt.internal.inc.Analysis]
val allCompilations = a.compilations.allCompilations
val recompiledClasses: Seq[Set[String]] = allCompilations map { c =>
val recompiledClasses = a.apis.internal.collect {
case (className, api) if api.compilationTimestamp() == c.getStartTime => className
}
recompiledClasses.toSet
}
def recompiledClassesInIteration(iteration: Int, classNames: Set[String]) = {
assert(
recompiledClasses(iteration) == classNames,
s"""${recompiledClasses(iteration)} != $classNames
|allCompilations = ${allCompilations.mkString("\n ")}""".stripMargin
)
}
assert(step < allCompilations.size)
recompiledClassesInIteration(step, expected.toSet)
}
InputKey[Unit]("checkDependencies") := {
val cls :: expected = complete.DefaultParsers.spaceDelimited("<arg>").parsed
val className = cls.stripSuffix(":")
val a = (Compile / compile).value.asInstanceOf[sbt.internal.inc.Analysis]
def classDeps(cls: String): Set[String] = a.relations.internalClassDep.forward(cls)
def assertDependencies(expected: Set[String], actual: Set[String]) =
assert(expected == actual, s"Expected $expected dependencies, got $actual")
assertDependencies(expected.toSet, classDeps(className))
}
InputKey[Unit]("checkProducts") := {
val source :: expected = complete.DefaultParsers.spaceDelimited("<arg>").parsed
val a = (Compile / compile).value.asInstanceOf[sbt.internal.inc.Analysis]
val c = fileConverter.value
val products = a.relations.products(c.toVirtualFile(baseDirectory.value.toPath / source.stripSuffix(":")))
assert(expected.toSet == products.map(_.id), s"expected: ${expected.sorted.mkString("\n ", "\n ", "")}\nobtained: ${products.map(_.id).toList.sorted.mkString("\n ", "\n ", "")}")
}
InputKey[Unit]("checkProductsExists") := {
val List(source) = complete.DefaultParsers.spaceDelimited("<arg>").parsed
val a = (Compile / compile).value.asInstanceOf[sbt.internal.inc.Analysis]
val c = fileConverter.value
val missing = a.relations.products(c.toVirtualFile(baseDirectory.value.toPath / source)).filter(p =>
!java.nio.file.Files.exists(c.toPath(p)))
assert(missing.isEmpty, s"missing files: ${missing.map(_.id).toList.sorted.mkString("\n ", "\n ", "")}")
}
InputKey[Unit]("checkIterations") := {
val expected = complete.DefaultParsers.spaceDelimited("<arg>").parsed.head.toInt
val analysis = (Compile / compile).value.asInstanceOf[sbt.internal.inc.Analysis]
val count = analysis.compilations.allCompilations.size
def msg = s"analysis.compilations.allCompilations.size = $count (expected $expected)"
assert(count == expected, msg)
}
InputKey[Unit]("checkMainClasses") := {
val source :: expected = complete.DefaultParsers.spaceDelimited("<arg>").parsed
val analysis = (Compile / compile).value.asInstanceOf[sbt.internal.inc.Analysis]
val c = fileConverter.value
def mainClasses(src: String): Set[String] =
analysis.infos.get(c.toVirtualFile(baseDirectory.value.toPath / src)).getMainClasses.toSet
def assertClasses(expected: Set[String], actual: Set[String]) = {
def msg = s"Expected $expected classes, got $actual\n\n" + analysis.infos.allInfos
assert(expected == actual, msg)
}
assertClasses(expected.toSet, mainClasses(source.stripSuffix(":")))
}
InputKey[Unit]("checkClasses") := {
val source :: expected = complete.DefaultParsers.spaceDelimited("<arg>").parsed
val analysis = (Compile / compile).value.asInstanceOf[sbt.internal.inc.Analysis]
val c = fileConverter.value
def classes(src: String): Set[String] =
analysis.relations.classNames(c.toVirtualFile(baseDirectory.value.toPath / src))
def assertClasses(expected: Set[String], actual: Set[String]) = {
def msg = s"Expected $expected classes, got $actual \n\n" + analysis.relations
assert(expected == actual, msg)
}
assertClasses(expected.toSet, classes(source.stripSuffix(":")))
}
def messages(analysis: sbt.internal.inc.Analysis, severity: xsbti.Severity) = {
val problems = analysis.infos.allInfos.values.toList.flatMap(i => i.getReportedProblems ++ i.getUnreportedProblems)
problems.filter(_.severity == severity)
}
InputKey[Unit]("checkWarnings") := {
val num = complete.DefaultParsers.spaceDelimited("<arg>").parsed.head.toInt
val analysis = (Compile / compile).value.asInstanceOf[sbt.internal.inc.Analysis]
val warnings = messages(analysis, xsbti.Severity.Warn)
def m =
s"""Expected $num warnings but ${warnings.length} found:
|${warnings mkString "\n"}""".stripMargin
assert(warnings.length == num, m)
}
InputKey[Unit]("checkWarning") := {
val num :: expected :: Nil = complete.DefaultParsers.spaceDelimited("<arg>").parsed
val analysis = (Compile / compile).value.asInstanceOf[sbt.internal.inc.Analysis]
val warning = messages(analysis, xsbti.Severity.Warn).apply(num.toInt)
assert(warning.message.contains(expected),
s"message does not contain expected ($expected):\n$warning")
}
InputKey[Unit]("checkNoClassFiles") := {
val classes = (baseDirectory.value / "target/classes" ** "*.class").get.toList.map(_.toString)
assert(classes.isEmpty, s"classes exist:${classes.mkString("\n * ", "\n * ", "")}")
}

View File

@ -1,10 +0,0 @@
// https://github.com/sbt/sbt/issues/3736
// https://github.com/raboof/sbt-run-classloading/blob/master/src/main/scala/Main.scala
object Main extends App {
Class.forName("scala.Int")
val classLoader = Option(Thread.currentThread.getContextClassLoader).get
Class.forName("scala.Int", true, classLoader)
Class.forName("scala.Int", false, classLoader)
}

View File

@ -1 +0,0 @@
> run

View File

@ -1,15 +0,0 @@
{
"projects": [
{
"name": "macro-client",
"dependsOn": [
"macro-provider"
],
"scalaVersion": "2.13.12"
},
{
"name": "macro-provider",
"scalaVersion": "2.13.12"
}
]
}

View File

@ -0,0 +1,4 @@
lazy val `macro-provider` = project.settings(
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value
)
lazy val `macro-client` = project.dependsOn(`macro-provider`)

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,5 @@
> setup; reload
> macro-client/compile
# remove `Foo.str` which is an argument to a macro

View File

@ -1,15 +0,0 @@
{
"projects": [
{
"name": "macro-client",
"dependsOn": [
"macro-provider"
],
"scalaVersion": "2.13.12"
},
{
"name": "macro-provider",
"scalaVersion": "2.13.12"
}
]
}

View File

@ -0,0 +1,4 @@
lazy val `macro-provider` = project.settings(
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value
)
lazy val `macro-client` = project.dependsOn(`macro-provider`)

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,2 +1,4 @@
> setup; reload
# We only want to make sure we can compile this without stack overflow
> macro-client/compile

View File

@ -1,15 +0,0 @@
{
"projects": [
{
"name": "macro-client",
"dependsOn": [
"macro-provider"
],
"scalaVersion": "2.13.12"
},
{
"name": "macro-provider",
"scalaVersion": "2.13.12"
}
]
}

View File

@ -0,0 +1,4 @@
lazy val `macro-provider` = project.settings(
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value
)
lazy val `macro-client` = project.dependsOn(`macro-provider`)

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,5 @@
> setup; reload
> macro-client/compile
# remove `Foo.str` which is an argument to a macro

View File

@ -1,15 +0,0 @@
{
"projects": [
{
"name": "macro-client",
"dependsOn": [
"macro-provider"
],
"scalaVersion": "2.13.12"
},
{
"name": "macro-provider",
"scalaVersion": "2.13.12"
}
]
}

View File

@ -0,0 +1,4 @@
lazy val `macro-provider` = project.settings(
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value
)
lazy val `macro-client` = project.dependsOn(`macro-provider`)

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,5 +1,4 @@
# Marked as pending due to StackOverflow error, see
# https://github.com/sbt/sbt/issues/1544 for details
> setup; reload
> macro-client/compile

View File

@ -1,3 +1,7 @@
> setup; reload
# this test was pending from the beginning; https://github.com/sbt/zinc/commit/80467a3c041484fa839cdb081c08e5e3d05eac8f
-> compile
> checkErrors 1
> checkErrors 1

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,5 @@
> setup; reload
> compile
> checkWarnings 1
> checkWarning 0 "fruitless type test"

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,5 @@
> setup; reload
> compile
$ copy-file changes/C2.scala C.scala
-> compile
-> compile

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,5 @@
> setup; reload
# Test for separate compilation and proper value of
# the OVERRIDE flag when abstract types, type alias
# and structural type are involved

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,5 @@
> setup; reload
> compile
# remove type arguments from S

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,5 @@
> setup; reload
# This test checks that when a source file included in a partial recompilation adds a dependency on
# a file not included in the partial recompilation, the dependency is properly recorded.

View File

@ -1,2 +0,0 @@
# turn off pipelining because compileAllJava over-compiles
pipelining = false

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,5 @@
> setup; reload
# Verifies that changes to annotations in upstream Java sources causes
# recompilation downstream (sbt/zinc#630)

View File

@ -1,2 +0,0 @@
# turn off pipelining because compileAllJava over-compiles
pipelining = false

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,5 @@
> setup; reload
# Verifies that changes to annotations in upstream Java sources causes
# recompilation downstream (sbt/zinc#630) -- in this version, the
# annotation disappears upstream (and downstream compilation is

View File

@ -1,2 +0,0 @@
# turn off pipelining because compileAllJava over-compiles
pipelining = false

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,5 @@
> setup; reload
# Verifies that changes to annotations in upstream Java sources causes
# recompilation downstream (sbt/zinc#630)

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,5 @@
> setup; reload
$ copy-file changes/S1.scala S.scala
> compile
$ copy-file changes/S2.scala S.scala

View File

@ -1,2 +0,0 @@
# turn off pipelining because compileAllJava over-compiles
pipelining = false

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,5 @@
> setup; reload
# Verifies if dependencies introduced by Java inheritance by local classes are handled correctly.
# See sbt-test 'local-class-inheritance' for a similar test in Scala.

View File

@ -5,7 +5,20 @@ object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,5 @@
> setup; reload
> compile
$ copy-file changes/B2.scala B.scala
-> compile

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,5 @@
> setup; reload
> compile
$ copy-file changes/B2.scala B.scala
-> compile

View File

@ -1 +0,0 @@
incOptions := incOptions.value.withNameHashing(true)

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,5 @@
> setup; reload
> compile
# rename def with symbolic name (`=`)

View File

@ -1,10 +0,0 @@
{
"projects": [
{
"name": "use"
},
{
"name": "dep"
}
]
}

View File

@ -0,0 +1,4 @@
lazy val dep = project.in(file("dep")).settings(
Compile / packageBin / artifactPath := baseDirectory.value / "target" / s"${name.value}.jar"
)
lazy val use = project.in(file("use"))

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,5 @@
> setup; reload
> dep/package
$ copy-file dep/target/dep.jar use/lib/dep.jar

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,5 @@
> setup; reload
> compile
# change => Int to Function0

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,5 @@
> setup; reload
# Tests that classpath entries that are different than their canonical representation are
# handled properly. In particular, a symlink from lib/a.jar to lib/../actual/a.jar.0 is
# available on the classpath and read by scalac. scalac 2.10.x does not interpret .jar.0

View File

@ -1,2 +0,0 @@
apiDebug = true
relationsDebug = true

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,6 @@
> setup; reload
> set incOptions := incOptions.value.withApiDebug(true).withRelationsDebug(true)
> compile
$ copy-file changes/A.scala A.scala
-> compile

View File

@ -1 +0,0 @@
scalac.options = -Xfatal-warnings

View File

@ -1,3 +1,7 @@
> setup; reload
> set scalacOptions += "-Werror"
# Compilation with warning should fail
-> compile
@ -7,4 +11,4 @@ $ copy-file changed/Sealed1.scala src/main/scala/foo/Sealed.scala
# Add warning again without touching Child2 definition
$ copy-file changed/Sealed2.scala src/main/scala/foo/Sealed.scala
-> compile
-> compile

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,2 +1,4 @@
> setup; reload
> compile
> checkClasses A.scala: A

View File

@ -0,0 +1,5 @@
> setup; reload
> compile
> checkDependencies A: B

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +0,0 @@
> compile
> checkDependencies A: B

View File

@ -0,0 +1,5 @@
> setup; reload
> compile
> checkDependencies A: B C

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +0,0 @@
> compile
> checkDependencies A: B C

View File

@ -1,2 +1,4 @@
> setup; reload
> compile
> checkProducts A.scala: ${BASE}/target/classes/A.class ${BASE}/target/classes/A$.class
> checkProducts A.scala: ${BASE}/target/classes/A.class ${BASE}/target/classes/A$.class

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,5 @@
> setup; reload
# this was the first checkRecompilations test ever written. it's a good
# one for understanding how checkDependencies and checkRecompilations
# are used.

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,5 @@
> setup; reload
# Test for class-based invalidation of dependencies
# by inheritance. The source file A.scala defines
# A and A2 classes. The B.scala inherits from A2 but

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,3 +1,5 @@
> setup; reload
# Test for class-based invalidation of dependencies by member reference
# This test checks if name hashes are tracked at the class level so
# only classes that depend on an API of a modified class are invalidated

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,2 +1,5 @@
> setup; reload
# Test for regression caused by https://github.com/sbt/zinc/pull/1244 (reverted)
> checkProducts main.scala: ${BASE}/target/classes/p1/p2/B$L$I.class ${BASE}/target/classes/p1/p2/B$L.class ${BASE}/target/classes/p1/p2/B.class ${BASE}/target/classes/p1/p2/D$$anon$1$i$.class ${BASE}/target/classes/p1/p2/D$$anon$1.class ${BASE}/target/classes/p1/p2/D.class ${BASE}/target/classes/p1/p2/G$$anon$2$i$.class ${BASE}/target/classes/p1/p2/G$$anon$2.class ${BASE}/target/classes/p1/p2/G.class
> checkProductsExists main.scala

View File

@ -0,0 +1,24 @@
import sbt._
import Keys._
object ScriptedTestPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements
object autoImport {
val setup = taskKey[StateTransform]("setup scripted test")
val cacheId = AttributeKey[String]("cacheId")
}
import autoImport._
override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion"),
setup := {
IO.copyFile(Path(sys.props("scripted.common")).asFile, baseDirectory.value / "common.sbt")
val id = java.util.UUID.randomUUID().toString
StateTransform(_.put(cacheId, id))
},
// https://github.com/sbt/sbt/issues/7432
Compile / compileAnalysisFilename := (Compile / compileAnalysisFilename).value.dropRight(4) + "-" + state.value.get(cacheId).get + ".zip"
)
}

View File

@ -1,2 +1,8 @@
> checkProducts main.scala: ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVeryVeryVeryLongClassName2.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVeryVeryVeryLongClassName2$OuterLevelWithVeryVeryVeryLongClassName3.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVeryVeryVeryLongClassName2$OuterLevelWithVeryVeryVeryLongClassName3$OuterLevelWithVeryVeryVeryLongClassName4.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVeryVeryVeryLongClassName2$OuterLevelWithVeryVeryVeryLongClassName3$OuterLevelWithVeryVeryVeryLongClassName4$OuterLevelWithVeryVeryVeryLongClassName5.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVeryVeryVeryLongClassName2$OuterLevelWithVeryVeryVeryLongClassName3$OuterLevelWithVeryVeryVeryLongClassName4$OuterLevelWithVeryVeryVeryLongClassName5$OuterLevelWithVeryVeryVeryLongClassName6.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVeryVe$$$$6facba931fe42f8a8c3cee88c4087$$$$ryVeryLongClassName6$OuterLevelWithVeryVeryVeryLongClassName7.class
> checkProductsExists main.scala
> setup; reload
# TODO: adjust after merging https://github.com/scala/scala/pull/10542
#> checkProducts main.scala: ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVeryVeryVeryLongClassName2.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVeryVeryVeryLongClassName2$OuterLevelWithVeryVeryVeryLongClassName3.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVeryVeryVeryLongClassName2$OuterLevelWithVeryVeryVeryLongClassName3$OuterLevelWithVeryVeryVeryLongClassName4.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVeryVeryVeryLongClassName2$OuterLevelWithVeryVeryVeryLongClassName3$OuterLevelWithVeryVeryVeryLongClassName4$OuterLevelWithVeryVeryVeryLongClassName5.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVer$$$$f1136b7659b86ea0804013acf91cbef$$$$eryLongClassName5$OuterLevelWithVeryVeryVeryLongClassName6.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVer$$$$f1136b7659b86ea0804013acf91cbef$$$$eryLongClassName5$OuterLevelWithVeryVeryVeryLongClassName6$OuterLevelWithVeryVeryVeryLongClassName7.class
> checkProducts main.scala: ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVeryVeryVeryLongClassName2.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVeryVeryVeryLongClassName2$OuterLevelWithVeryVeryVeryLongClassName3.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVeryVeryVeryLongClassName2$OuterLevelWithVeryVeryVeryLongClassName3$OuterLevelWithVeryVeryVeryLongClassName4.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVeryVeryVeryLongClassName2$OuterLevelWithVeryVeryVeryLongClassName3$OuterLevelWithVeryVeryVeryLongClassName4$OuterLevelWithVeryVeryVeryLongClassName5.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVeryVeryVeryLongClassName2$OuterLevelWithVeryVeryVeryLongClassName3$OuterLevelWithVeryVeryVeryLongClassName4$OuterLevelWithVeryVeryVeryLongClassName5$OuterLevelWithVeryVeryVeryLongClassName6.class ${BASE}/target/classes/p1/p2/OuterLevelWithVeryVeryVeryLongClassName1$OuterLevelWithVeryVeryVeryLongClassName2$OuterLevelWithVeryVeryVeryLongClassName3$OuterLevelWithVeryVeryVeryLongClassName4$OuterLevelWithVeryVeryVeryLongClassName5$OuterLevelWithVeryVeryVeryLongClassName6$OuterLevelWithVeryVeryVeryLongClassName7.class
# TODO enable after PR above
#> checkProductsExists main.scala

View File

@ -1,4 +0,0 @@
// apparently Travis CI stopped allowing long file names
// it fails with the default setting of 255 characters so
// we have to set lower limit ourselves
scalacOptions ++= Seq("-Xmax-classfile-name", "240")

Some files were not shown because too many files have changed in this diff Show More