summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2018-10-18 09:15:53 +0800
committerLi Haoyi <haoyi.sg@gmail.com>2018-10-18 09:15:53 +0800
commitbcf1891fed8febfac2dbf8f7f82a97e139f5b645 (patch)
tree0d76184e904f459d8c8973e0cad3a06639a68e03
parentc1b8b3de8fe123317a07e0a4454606767876cb41 (diff)
parent482f5407082ff44b0c084ad80adbf903d7fdc6b9 (diff)
downloadmill-bcf1891fed8febfac2dbf8f7f82a97e139f5b645.tar.gz
mill-bcf1891fed8febfac2dbf8f7f82a97e139f5b645.tar.bz2
mill-bcf1891fed8febfac2dbf8f7f82a97e139f5b645.zip
Merge branch 'master' of github.com:lihaoyi/mill
-rw-r--r--.appveyor.yml2
-rw-r--r--.travis.yml2
-rwxr-xr-xbuild.sc2
-rwxr-xr-xci/test-mill-2.sh2
-rw-r--r--docs/pages/1 - Intro to Mill.md13
-rw-r--r--docs/pages/3 - Common Project Layouts.md1
-rw-r--r--docs/pages/4 - Tasks.md12
-rw-r--r--docs/pages/5 - Modules.md6
-rw-r--r--readme.md10
-rw-r--r--scalalib/src/mill/scalalib/GenIdeaImpl.scala6
-rw-r--r--scalalib/src/mill/scalalib/JavaModule.scala5
-rw-r--r--scalalib/src/mill/scalalib/PublishModule.scala4
-rw-r--r--scalalib/src/mill/scalalib/publish/SonatypeHttpApi.scala3
13 files changed, 54 insertions, 14 deletions
diff --git a/.appveyor.yml b/.appveyor.yml
index 86234df4..1bd0c4c7 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -21,7 +21,7 @@ environment:
JAVA_HOME: C:\Program Files\Java\jdk10
install:
- - SET MILL_URL=https://github.com/lihaoyi/mill/releases/download/0.2.7/0.2.7
+ - SET MILL_URL=https://github.com/lihaoyi/mill/releases/download/0.2.7/0.2.7-10-db8525
build_script:
- if [%COMPILER%]==[default] (
diff --git a/.travis.yml b/.travis.yml
index d6e954a9..897c4712 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -40,7 +40,7 @@ matrix:
jdk: oraclejdk8
script:
- - curl -L -o ~/bin/mill https://github.com/lihaoyi/mill/releases/download/0.2.7/0.2.7 && chmod +x ~/bin/mill
+ - curl -L -o ~/bin/mill https://github.com/lihaoyi/mill/releases/download/0.2.7/0.2.7-10-db8525 && chmod +x ~/bin/mill
- export PATH=~/bin/mill:$PATH
- "$CI_SCRIPT"
diff --git a/build.sc b/build.sc
index a31e2b62..bf81ffd7 100755
--- a/build.sc
+++ b/build.sc
@@ -36,6 +36,8 @@ trait MillModule extends MillPublishModule with ScalaModule{ outer =>
def repositories = super.repositories ++ Seq(
MavenRepository("https://oss.sonatype.org/content/repositories/releases")
)
+ def scalacPluginClasspath =
+ super.scalacPluginClasspath() ++ Seq(main.moduledefs.jar())
def testArgs = T{ Seq.empty[String] }
diff --git a/ci/test-mill-2.sh b/ci/test-mill-2.sh
index ceec17ef..83eef7a3 100755
--- a/ci/test-mill-2.sh
+++ b/ci/test-mill-2.sh
@@ -7,4 +7,4 @@ git clean -xdf
mill contrib.testng.publishLocal # Needed for CaffeineTests
# Run tests
-mill integration.test "mill.integration.local.{AcyclicTests,AmmoniteTests}"
+mill integration.test "mill.integration.local.{AcyclicTests,AmmoniteTests,DocAnnotationsTests}"
diff --git a/docs/pages/1 - Intro to Mill.md b/docs/pages/1 - Intro to Mill.md
index 82f78527..7af0436b 100644
--- a/docs/pages/1 - Intro to Mill.md
+++ b/docs/pages/1 - Intro to Mill.md
@@ -36,7 +36,7 @@ pacaur -S mill
### Windows
To get started, download Mill from:
-https://github.com/lihaoyi/mill/releases/download/0.2.7/0.2.7, and save it as
+https://github.com/lihaoyi/mill/releases/download/0.2.8/0.2.8, and save it as
`mill.bat`.
If you're using [Scoop](https://scoop.sh) you can install Mill via
@@ -73,7 +73,7 @@ To get started, download Mill and install it into your system via the following
`curl`/`chmod` command:
```bash
-sudo sh -c '(echo "#!/usr/bin/env sh" && curl -L https://github.com/lihaoyi/mill/releases/download/0.2.7/0.2.7) > /usr/local/bin/mill && chmod +x /usr/local/bin/mill'
+sudo sh -c '(echo "#!/usr/bin/env sh" && curl -L https://github.com/lihaoyi/mill/releases/download/0.2.8/0.2.8) > /usr/local/bin/mill && chmod +x /usr/local/bin/mill'
```
### Development Releases
@@ -156,8 +156,8 @@ $ mill -i foo.repl # start an Ammonite REPL within your project
You can run `mill resolve __` to see a full list of the different tasks that are
available, `mill resolve foo._` to see the tasks within `foo`, `mill inspect
-foo.compile` to see what an individual task depends on, or `mill show
-foo.scalaVersion` to inspect the output of any task.
+foo.compile` to inspect a task's doc-comment documentation or what it depends
+on, or `mill show foo.scalaVersion` to show the output of any task.
The most common **tasks** that Mill can run are cached **targets**, such as
`compile`, and un-cached **commands** such as `foo.run`. Targets do not
@@ -767,6 +767,11 @@ is structured with one folder per `Target`/`Command`, that is run, e.g.:
- `out/main/test/forkTest/`
- `out/scalalib/compile/`
+There are also top-level build-related files in the `out/` folder, prefixed as
+`mill-*`. The most useful is `mill-profile.json`, which logs the tasks run and
+time taken for the last Mill command you executed. This is very useful if you
+want to find out exactly what tasks are being run and Mill is being slow.
+
Each folder currently contains the following files:
- `dest/`: a path for the `Task` to use either as a scratch space, or to place
diff --git a/docs/pages/3 - Common Project Layouts.md b/docs/pages/3 - Common Project Layouts.md
index 747b9403..fe3132e2 100644
--- a/docs/pages/3 - Common Project Layouts.md
+++ b/docs/pages/3 - Common Project Layouts.md
@@ -260,6 +260,7 @@ foo/
```scala
import mill._
import mill.scalalib._
+import mill.scalalib.publish._
object foo extends ScalaModule with PublishModule {
def scalaVersion = "2.12.4"
def publishVersion = "0.0.1"
diff --git a/docs/pages/4 - Tasks.md b/docs/pages/4 - Tasks.md
index d87b324b..6c7737e0 100644
--- a/docs/pages/4 - Tasks.md
+++ b/docs/pages/4 - Tasks.md
@@ -69,7 +69,7 @@ arbitrary result from its inputs.
## Different Kinds of Tasks
-There are four primary kinds of *Tasks* that you should care about:
+There are three primary kinds of *Tasks* that you should care about:
- [Targets](#targets), defined using `T {...}`
- [Sources](#sources), defined using `T.sources {...}`
@@ -92,6 +92,16 @@ automatically JSON-serialized and stored at `out/classFiles/meta.json`. The
return-value of targets has to be JSON-serializable via
[uPickle](https://github.com/lihaoyi/upickle).
+In case you want return your own
+case class (e.g. `MyCaseClass`), you can make it JSON-serializable by adding the
+following implicit def to its companion object:
+
+```scala
+object MyCaseClass {
+ implicit def rw: upickle.default.ReadWriter[MyCaseClass] = upickle.default.macroRW
+}
+```
+
If you want to return a file or a set of files as the result of a `Target`,
write them to disk within your `T.ctx().dest` available through the
[Task Context API](#task-context-api) and return a `PathRef` to the files you
diff --git a/docs/pages/5 - Modules.md b/docs/pages/5 - Modules.md
index fa6260f3..973b93d1 100644
--- a/docs/pages/5 - Modules.md
+++ b/docs/pages/5 - Modules.md
@@ -52,12 +52,16 @@ This would make the following targets available from the command line
- `mill show foo2.baz`
- `mill show foo2.qux`
-The built in `mill.scalalib` package uses this to define
+The built-in `mill.scalalib` package uses this to define
`mill.scalalib.ScalaModule`, `mill.scalalib.SbtModule` and
`mill.scalalib.TestScalaModule`, all of which contain a set of "standard"
operations such as `compile` `jar` or `assembly` that you may expect from a
typical Scala module.
+When defining your own module abstractions, in general you should use `trait`s
+and not `class`es, except in the case of
+[Cross Builds](http://www.lihaoyi.com/mill/page/cross-builds.html).
+
## Overriding Targets
```scala
diff --git a/readme.md b/readme.md
index 9640b8b3..fdd2b9e0 100644
--- a/readme.md
+++ b/readme.md
@@ -151,6 +151,16 @@ optimizer without classpath conflicts.
## Changelog
+### 0.2.8
+
+- `mill inspect` now displays out the doc-comment documentation for a task.
+
+- Avoid shutdown hook failures in tests [#422](https://github.com/lihaoyi/mill/pull/422)
+
+- Ignore unreadable output files rather than crashing [#423](https://github.com/lihaoyi/mill/pull/423)
+
+- Don't compile hidden files [#428](https://github.com/lihaoyi/mill/pull/428)
+
### 0.2.7
- Add `visualizePlan` command
diff --git a/scalalib/src/mill/scalalib/GenIdeaImpl.scala b/scalalib/src/mill/scalalib/GenIdeaImpl.scala
index f71a7856..b4f77f16 100644
--- a/scalalib/src/mill/scalalib/GenIdeaImpl.scala
+++ b/scalalib/src/mill/scalalib/GenIdeaImpl.scala
@@ -26,6 +26,7 @@ object GenIdea extends ExternalModule {
implicit def millScoptEvaluatorReads[T] = new mill.main.EvaluatorScopt[T]()
lazy val millDiscover = Discover[this.type]
}
+
object GenIdeaImpl {
def apply(ctx: Log with Home,
@@ -225,8 +226,9 @@ object GenIdeaImpl {
Tuple2(
".idea"/"modules.xml",
allModulesXmlTemplate(
- for((path, mod) <- modules)
- yield moduleName(path)
+ modules
+ .filter(!_._2.skipIdea)
+ .map { case (path, mod) => moduleName(path) }
)
),
Tuple2(
diff --git a/scalalib/src/mill/scalalib/JavaModule.scala b/scalalib/src/mill/scalalib/JavaModule.scala
index b15e0bdb..15fa7264 100644
--- a/scalalib/src/mill/scalalib/JavaModule.scala
+++ b/scalalib/src/mill/scalalib/JavaModule.scala
@@ -527,6 +527,11 @@ trait JavaModule extends mill.Module with TaskModule { outer =>
def intellijModulePath: Path = millSourcePath
def forkWorkingDir = T{ ammonite.ops.pwd }
+
+ /**
+ * Skip Idea project file generation.
+ */
+ def skipIdea: Boolean = false
}
trait TestModule extends JavaModule with TaskModule {
diff --git a/scalalib/src/mill/scalalib/PublishModule.scala b/scalalib/src/mill/scalalib/PublishModule.scala
index 0b7e52c8..5c567452 100644
--- a/scalalib/src/mill/scalalib/PublishModule.scala
+++ b/scalalib/src/mill/scalalib/PublishModule.scala
@@ -97,11 +97,11 @@ object PublishModule extends ExternalModule {
def publishAll(sonatypeCreds: String,
gpgPassphrase: String = null,
- signed: Boolean = true,
publishArtifacts: mill.main.Tasks[PublishModule.PublishData],
release: Boolean = false,
sonatypeUri: String = "https://oss.sonatype.org/service/local",
- sonatypeSnapshotUri: String = "https://oss.sonatype.org/content/repositories/snapshots") = T.command {
+ sonatypeSnapshotUri: String = "https://oss.sonatype.org/content/repositories/snapshots",
+ signed: Boolean = true) = T.command {
val x: Seq[(Seq[(Path, String)], Artifact)] = Task.sequence(publishArtifacts.value)().map{
case PublishModule.PublishData(a, s) => (s.map{case (p, f) => (p.path, f)}, a)
diff --git a/scalalib/src/mill/scalalib/publish/SonatypeHttpApi.scala b/scalalib/src/mill/scalalib/publish/SonatypeHttpApi.scala
index 927d4515..12defa93 100644
--- a/scalalib/src/mill/scalalib/publish/SonatypeHttpApi.scala
+++ b/scalalib/src/mill/scalalib/publish/SonatypeHttpApi.scala
@@ -36,7 +36,8 @@ class SonatypeHttpApi(uri: String, credentials: String) {
ujson
.read(response.body)("data")
.arr
- .find(profile => profile("name").str == groupId)
+ .find(profile =>
+ groupId.split('.').startsWith(profile("name").str.split('.')))
.map(_("resourceURI").str.toString)
resourceUri.getOrElse(