summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJoseph K. Strauss <joseph.k.strauss@gmail.com>2018-06-06 23:39:08 -0400
committerLi Haoyi <haoyi.sg@gmail.com>2018-06-06 20:39:08 -0700
commitc627dd1c20577115a111b293296dd06392220880 (patch)
tree1313fd32d87d1c8b6102b393fde1590eceee0cf6 /docs
parentecb931f769080c89f17f76e51840c560ed079d57 (diff)
downloadmill-c627dd1c20577115a111b293296dd06392220880.tar.gz
mill-c627dd1c20577115a111b293296dd06392220880.tar.bz2
mill-c627dd1c20577115a111b293296dd06392220880.zip
Allow hyphens in module and task names (#362)
* Allow bacticked tasks * Prevent stack overflow * Test for illegal bacticked identifiers * Filter out illegal backticked identifiers The only legal identifiers are aplanumeric, unserscore (_), and hyphens (-). * Remove unused method that is invalid * Document valid characters for module/task names
Diffstat (limited to 'docs')
-rw-r--r--docs/pages/2 - Configuring Mill.md38
1 files changed, 38 insertions, 0 deletions
diff --git a/docs/pages/2 - Configuring Mill.md b/docs/pages/2 - Configuring Mill.md
index 43191950..03489f68 100644
--- a/docs/pages/2 - Configuring Mill.md
+++ b/docs/pages/2 - Configuring Mill.md
@@ -372,6 +372,44 @@ object foo extends MySpecialModule
object bar extends MySpecialModule
```
+## Module/Task Names
+
+```scala
+// build.sc
+import mill._
+import mill.scalalib._
+
+object `hyphenated-module` extends Module {
+ def `hyphenated-target` = T{
+ println("This is a hyphenated target in a hyphenated module.")
+ }
+}
+
+object unhyphenatedModule extends Module {
+ def unhyphenated_target = T{
+ println("This is an unhyphenated target in an unhyphenated module.")
+ }
+ def unhyphenated_target2 = T{
+ println("This is the second unhyphenated target in an unhyphenated module.")
+ }
+}
+```
+
+Mill modules and tasks may be composed of any of the following characters types:
+ - Alphanumeric (A-Z, a-z, and 0-9)
+ - Underscore (_)
+ - Hyphen (-)
+
+Due to Scala naming restrictions, module and task names with hyphens must be surrounded by back-ticks (`).
+
+Using hyphenated names at the command line is unaffected by these restrictions.
+
+```bash
+mill hyphenated-module.hyphenated-target
+mill unhyphenatedModule.unhyphenated_target
+mill unhyphenatedModule.unhyphenated_target2
+```
+
## Overriding Tasks
```scala