summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorrockjam <5min4eq.unity@gmail.com>2018-06-10 00:10:11 +0300
committerrockjam <5min4eq.unity@gmail.com>2018-06-10 00:10:11 +0300
commite8c1a8647a4dd938f1f9e6dfb192c45002de0b51 (patch)
tree14f3e6e60044d7e5d253963bea13364bf820c613 /docs
parenteb7082b284c35e968cf6ef8dff19274870b8fbe4 (diff)
downloadmill-e8c1a8647a4dd938f1f9e6dfb192c45002de0b51.tar.gz
mill-e8c1a8647a4dd938f1f9e6dfb192c45002de0b51.tar.bz2
mill-e8c1a8647a4dd938f1f9e6dfb192c45002de0b51.zip
add docs section about assembly rules
Diffstat (limited to 'docs')
-rw-r--r--docs/pages/2 - Configuring Mill.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/docs/pages/2 - Configuring Mill.md b/docs/pages/2 - Configuring Mill.md
index 036fbe6b..1d0ff4b5 100644
--- a/docs/pages/2 - Configuring Mill.md
+++ b/docs/pages/2 - Configuring Mill.md
@@ -474,6 +474,30 @@ compilation output, but if there is more than one or the main class comes from
some library you can explicitly specify which one to use. This also adds the
main class to your `foo.jar` and `foo.assembly` jars.
+## Merge/exclude files from assembly
+
+When you make a runnable jar of your project with `assembly` command,
+you may want to exclude some files from a final jar (like signature files, and manifest files from library jars),
+and merge duplicated files (for instance reference.conf files from library dependencies).
+
+By default mill excludes all `*.sf`, `*.dsa`, `*.rsa`, and `META-INF/MANIFEST.MF` files from assembly, and concatenates all `reference.conf` files.
+You can also define your own merge/exclude rules.
+
+```scala
+// build.sc
+import mill._, scalalib._
+import mill.modules.Assembly._
+
+object foo extends ScalaModule {
+ def scalaVersion = "2.12.4"
+ def assemblyRules = Seq(
+ Rule.Append("application.conf"), // all application.conf files will be concatenated into single file
+ Rule.AppendPattern(".*\\.conf"), // all *.conf files will be concatenated into single file
+ Rule.ExcludePattern("*.temp") // all *.temp files will be excluded from a final jar
+ )
+}
+```
+
## Downloading Non-Maven Jars
```scala