mirror of https://github.com/sbt/sbt.git
Add workaround for sbt 1.0.0-M6
This commit is contained in:
parent
6d08ced648
commit
b964497f1c
|
|
@ -178,11 +178,70 @@ object Settings {
|
|||
)
|
||||
}
|
||||
|
||||
lazy val scripted100M6Workaround = {
|
||||
|
||||
// see https://github.com/sbt/sbt/issues/3245#issuecomment-306045952
|
||||
|
||||
ScriptedPlugin.scripted := Def.inputTask {
|
||||
|
||||
val args = ScriptedPlugin
|
||||
.asInstanceOf[{
|
||||
def scriptedParser(f: File): complete.Parser[Seq[String]]
|
||||
}]
|
||||
.scriptedParser(sbtTestDirectory.value)
|
||||
.parsed
|
||||
|
||||
val prereq: Unit = scriptedDependencies.value
|
||||
val scriptedTests = ScriptedPlugin.scriptedTests.value
|
||||
|
||||
try {
|
||||
if(sbtVersion.in(pluginCrossBuild).value == "1.0.0-M6")
|
||||
scriptedTests.asInstanceOf[{
|
||||
def run(
|
||||
x1: File,
|
||||
x2: Boolean,
|
||||
x3: Array[String],
|
||||
x4: File,
|
||||
x5: Array[String],
|
||||
x6: java.util.List[File]
|
||||
): Unit
|
||||
}].run(
|
||||
sbtTestDirectory.value,
|
||||
scriptedBufferLog.value,
|
||||
args.toArray,
|
||||
sbtLauncher.value,
|
||||
scriptedLaunchOpts.value.toArray,
|
||||
new java.util.ArrayList()
|
||||
)
|
||||
else
|
||||
scriptedTests.asInstanceOf[{
|
||||
def run(
|
||||
x1: File,
|
||||
x2: Boolean,
|
||||
x3: Array[String],
|
||||
x4: File,
|
||||
x5: Array[String]
|
||||
): Unit
|
||||
}].run(
|
||||
sbtTestDirectory.value,
|
||||
scriptedBufferLog.value,
|
||||
args.toArray,
|
||||
sbtLauncher.value,
|
||||
scriptedLaunchOpts.value.toArray
|
||||
)
|
||||
} catch {
|
||||
case e: java.lang.reflect.InvocationTargetException =>
|
||||
throw e.getCause
|
||||
}
|
||||
}.evaluated
|
||||
}
|
||||
|
||||
lazy val plugin =
|
||||
javaScalaPluginShared ++
|
||||
divertThingsPlugin ++
|
||||
withScriptedTests ++
|
||||
Seq(
|
||||
scripted100M6Workaround,
|
||||
scriptedLaunchOpts ++= Seq(
|
||||
"-Xmx1024M",
|
||||
"-Dplugin.version=" + version.value,
|
||||
|
|
|
|||
Loading…
Reference in New Issue