diff options
author | Francis De Brabandere <francisdb@gmail.com> | 2018-03-05 17:32:18 +0100 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-03-05 08:32:18 -0800 |
commit | eedd0b2eed3dc7259fcd6c9cef306e7e4972c62c (patch) | |
tree | bee14a043447cc8c866940601286faa8738dfae2 | |
parent | f86222d4c4dbf3d7963dfee739e7e1a8c5a1293f (diff) | |
download | mill-eedd0b2eed3dc7259fcd6c9cef306e7e4972c62c.tar.gz mill-eedd0b2eed3dc7259fcd6c9cef306e7e4972c62c.tar.bz2 mill-eedd0b2eed3dc7259fcd6c9cef306e7e4972c62c.zip |
re #180 document global configuration (#200)
-rw-r--r-- | docs/pages/2 - Configuring Mill.md | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/docs/pages/2 - Configuring Mill.md b/docs/pages/2 - Configuring Mill.md index 81f26e34..4d9894b2 100644 --- a/docs/pages/2 - Configuring Mill.md +++ b/docs/pages/2 - Configuring Mill.md @@ -217,6 +217,30 @@ consistent configuration: every module often has the same scala-version, uses the same testing framework, etc. and all that can be extracted out into the `trait`. +## Global configuration + +Mill builds on ammonite which allows you to +[define global configuration](http://ammonite.io/#ScriptPredef). Depending on +how you start mill 2 different files will be loaded. For interactive mode it's +`~/.mill/ammonite/predef.sc` and from the command line it's +`~/.mill/ammonite/predefScript.sc`. You might want to create a symlink from one +to the other to avoid duplication. + +Example `~/.mill/ammonite/predef.sc` +```scala +val nexusUser = "myuser" +val nexusPassword = "mysecret" +``` + +Everything declared in the above file will be available to any build you run. + +```scala + def repositories = super.repositories ++ Seq( + // login and pass are globally configured + MavenRepository("https://nexus.mycompany.com/repository/maven-releases", authentication = Some(coursier.core.Authentication(nexusUser, nexusPassword))) + ) +``` + ## Custom Tasks ```scala |