Don't strip quotes in _sbt_ scripted command arguments

Stripping quotation marks makes it impossible to cleanly test certain
sbt features without resorting to weird hacks. For example:
> set Compile / scalacOptions += "-Xfatal-warnings"
did not work while
> set Compile / scalacOptions += '"-Xfatal-warnings"'
did.

I leave the single quote parser unchanged since single quotes are not
really used in sbt and so there is utility in leaving them as a way to
group arguments that should not be split apart.

This change should only affect the scripted tests in the sbt repo. We
can consider making stripQuotes = false the default for the plugin as
well.
This commit is contained in:
Ethan Atkins
2020-01-11 16:50:22 -08:00
parent 3d510e27ad
commit 639b812a01
9 changed files with 70 additions and 46 deletions
@@ -443,7 +443,7 @@ final class ScriptedTests(
catching(classOf[TestException]).withApply(testFailed).andFinally(log.clear).apply {
preScriptedHook(testDirectory)
val parser = new TestScriptParser(handlers)
val handlersAndStatements = parser.parse(file)
val handlersAndStatements = parser.parse(file, stripQuotes = false)
runner.apply(handlersAndStatements, states)
// Handle successful tests