mirror of https://github.com/sbt/sbt.git
Merge pull request #3635 from PanAeon/escape-sbt-file-imports
Escape imports from sbt files
This commit is contained in:
commit
4ce4fb72bd
|
|
@ -61,7 +61,7 @@ private[sbt] final class DefinedSbtValues(val sbtFiles: Seq[compiler.EvalDefinit
|
|||
file <- sbtFiles
|
||||
m = file.enclosingModule
|
||||
v <- file.valNames
|
||||
} yield s"import ${m}.${v}"
|
||||
} yield s"import ${m}.`${v}`"
|
||||
}
|
||||
def generated: Seq[File] =
|
||||
sbtFiles flatMap (_.generated)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
[@panaeon]: https://github.com/panaeon
|
||||
|
||||
[#3464]: https://github.com/sbt/sbt/issues/3464
|
||||
[#3566]: https://github.com/sbt/sbt/pull/3566
|
||||
|
||||
### Bug fixes
|
||||
|
||||
- Escape imports from sbt files, so if user creates a backquoted definition then task evalution will not fail.
|
||||
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
lazy val `import` = (project in file("."))
|
||||
.settings(
|
||||
name := "Hello"
|
||||
)
|
||||
|
||||
val `return` = inputKey[Unit]("Check that commands can be defined as back-ticked variables")
|
||||
|
||||
|
||||
`return` := {
|
||||
()
|
||||
}
|
||||
|
||||
|
||||
val `ї` = inputKey[Unit]("Check that we can defined unicode commands")
|
||||
|
||||
`ї` := {
|
||||
()
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
# This test verifies that top-level literal identifiers, like `return`, are loaded correctly
|
||||
|
||||
# Initial load should succeed
|
||||
|
||||
# Check that we can modify project properties
|
||||
> 'set version := "1.0.0"'
|
||||
|
||||
# Check that we can run command defined in back-quotes
|
||||
> return
|
||||
|
||||
# Check that we can define unicode commands
|
||||
> ї
|
||||
Loading…
Reference in New Issue