summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2018-02-17 11:40:11 -0800
committerLi Haoyi <haoyi.sg@gmail.com>2018-02-17 11:40:11 -0800
commitb2482da1c24afea76b575345c028b38dde8b8b02 (patch)
tree289b25103bfa3d8a489dfa0b0208f5f0223a8da0
parente9c95bfc06ed371566a9df0890f92702a4f14c7f (diff)
downloadmill-b2482da1c24afea76b575345c028b38dde8b8b02.tar.gz
mill-b2482da1c24afea76b575345c028b38dde8b8b02.tar.bz2
mill-b2482da1c24afea76b575345c028b38dde8b8b02.zip
more-docs
-rw-r--r--docs/pages/1 - Intro to Mill.md84
-rw-r--r--docs/pages/3 - Common Project Layouts.md2
2 files changed, 85 insertions, 1 deletions
diff --git a/docs/pages/1 - Intro to Mill.md b/docs/pages/1 - Intro to Mill.md
index b07595a2..37709c30 100644
--- a/docs/pages/1 - Intro to Mill.md
+++ b/docs/pages/1 - Intro to Mill.md
@@ -351,5 +351,89 @@ you would depend on tasks from within your build file.
You can use this REPL to run build commands quicker, due to keeping the JVM warm
between runs, or to interactively explore your build to see what is available.
+## Deploying your code
+The two most common things to do once your code is complete is to make an
+assembly (e.g. for deployment/installation) or publishing (e.g. to Maven
+Central). Mill comes with both capabilities built in.
+Mill comes built-in with the ability to make assemblies. Given a simple Mill
+build:
+
+```scala
+// build.sc
+import mill._, scalalib._
+
+object foo extends ScalaModule{
+ def scalaVersion = "2.12.4"
+}
+```
+
+You can make a self-contained assembly via:
+
+```bash
+$ mill foo.assembly
+
+$ ls -lh out/foo/assembly/dest/out.jar
+-rw-r--r-- 1 lihaoyi staff 5.0M Feb 17 11:14 out/foo/assembly/dest/out.jar
+```
+
+You can then move the `out.jar` file anywhere you would like, and run it
+standalone using `java`:
+
+```bash
+$ java -cp out/foo/assembly/dest/out.jar foo.Example
+Hello World!
+```
+
+To publish to Maven Central, you need to make `foo` extend Mill's
+`PublishModule` trait:
+
+```scala
+// build.sc
+import mill._, scalalib._, publish._
+
+object foo extends PublishModule{
+ def scalaVersion = "2.12.4"
+ def publishVersion = "0.0.1"
+
+ def pomSettings = PomSettings(
+ description = "Hello",
+ organization = "com.lihaoyi",
+ url = "https://github.com/lihaoyi/example",
+ licenses = Seq(
+ License("MIT license", "http://www.opensource.org/licenses/mit-license.php")
+ ),
+ scm = SCM(
+ "git://github.com/lihaoyi/example.git",
+ "scm:git://github.com/lihaoyi/example.git"
+ ),
+ developers = Seq(
+ Developer("lihaoyi", "Li Haoyi","https://github.com/lihaoyi")
+ )
+ )
+}
+```
+
+Which you can then publish using the `mill foo.publish` command, which takes
+your sonatype credentials (e.g. `lihaoyi:foobarbaz`) and GPG password as inputs:
+
+```bash
+$ mill foo.publish
+Missing arguments: (--sonatypeCreds: String, --gpgPassphrase: String, --release: Boolean)
+
+Arguments provided did not match expected signature:
+
+publish
+ --sonatypeCreds String
+ --gpgPassphrase String
+ --release Boolean
+```
+
+You also need to specify `release` as `true` or `false`, depending on whether
+you just want to stage your module on `oss.sonatype.org` or you want Mill to
+complete the release process to Maven Central.
+
+If you are publishing multiple artifacts, you can also use `target/bin/mill
+mill.scalalib.PublishModule/publishAll1 as described
+[here](http://www.lihaoyi.com/mill/page/common-project-layouts.html#publishing) \ No newline at end of file
diff --git a/docs/pages/3 - Common Project Layouts.md b/docs/pages/3 - Common Project Layouts.md
index 0ae5fa51..788750a8 100644
--- a/docs/pages/3 - Common Project Layouts.md
+++ b/docs/pages/3 - Common Project Layouts.md
@@ -143,7 +143,7 @@ The `artifactName` defaults to the name of your module (in this case `foo`) but
can be overriden. The `organization` is defined in `pomSettings`.
Once you've mixed in `PublishModule`, you can publish your libraries to maven
-central via:
+central via:
```bash
target/bin/mill mill.scalalib.PublishModule/publishAll \