From 38fd81362824b062ebe79cfaec8ed6075039f116 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Thu, 20 Sep 2018 17:39:16 +0800 Subject: re-enable scaladoc plugin on existing modules to ensure their doccomments are captured --- build.sc | 2 ++ 1 file changed, 2 insertions(+) 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] } -- cgit v1.2.3 From d96840222f265d6db98fcb9950ef3f9e8125c1c4 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Thu, 20 Sep 2018 19:59:13 +0800 Subject: fix publishing to work with 0.2.7 --- ci/release.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ci/release.sh b/ci/release.sh index 28768dc0..c5a334ff 100755 --- a/ci/release.sh +++ b/ci/release.sh @@ -9,11 +9,10 @@ gpg --import gpg_key rm gpg_key mill mill.scalalib.PublishModule/publishAll \ - lihaoyi:$SONATYPE_PASSWORD \ - $GPG_PASSWORD \ - __.publishArtifacts \ - --release \ - true + --sonatypeCreds lihaoyi:$SONATYPE_PASSWORD \ + --gpgPassphrase $GPG_PASSWORD \ + --publishArtifacts __.publishArtifacts \ + --release true mill uploadToGithub $GITHUB_ACCESS_TOKEN -- cgit v1.2.3 From db852551bccaa05dad8dfce8413c3b7a94f5d672 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Thu, 20 Sep 2018 20:01:02 +0800 Subject: Re-order `publishAll` arguments to get rarely used `signed` arg out of the way --- scalalib/src/mill/scalalib/PublishModule.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- cgit v1.2.3 From 8018de39d421290462e5fefd8778ae42200e015a Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Thu, 20 Sep 2018 20:48:26 +0800 Subject: bootstrap off latest master --- .appveyor.yml | 2 +- .travis.yml | 2 +- ci/release.sh | 9 +++++---- 3 files changed, 7 insertions(+), 6 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/ci/release.sh b/ci/release.sh index c5a334ff..28768dc0 100755 --- a/ci/release.sh +++ b/ci/release.sh @@ -9,10 +9,11 @@ gpg --import gpg_key rm gpg_key mill mill.scalalib.PublishModule/publishAll \ - --sonatypeCreds lihaoyi:$SONATYPE_PASSWORD \ - --gpgPassphrase $GPG_PASSWORD \ - --publishArtifacts __.publishArtifacts \ - --release true + lihaoyi:$SONATYPE_PASSWORD \ + $GPG_PASSWORD \ + __.publishArtifacts \ + --release \ + true mill uploadToGithub $GITHUB_ACCESS_TOKEN -- cgit v1.2.3 From 55e7f92c7796bbaa22db03c656082fb3de855353 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Fri, 21 Sep 2018 19:24:24 +0800 Subject: start running DocAnnotationsTests in CI --- ci/test-mill-2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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}" -- cgit v1.2.3 From e27de4a1ea2f4f9186d0963e1dbdd03fe4bb7c00 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Fri, 21 Sep 2018 20:02:41 +0800 Subject: 0.2.8 --- docs/pages/1 - Intro to Mill.md | 13 +++++++++---- readme.md | 10 ++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) 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/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 -- cgit v1.2.3 From 5b9caaa034ecb402b3f5572d3ee74aa9c2478a0b Mon Sep 17 00:00:00 2001 From: Brandon Elam Barker Date: Tue, 25 Sep 2018 04:15:48 -0400 Subject: Adding import for PomSettings (publishing) (#439) --- docs/pages/3 - Common Project Layouts.md | 1 + 1 file changed, 1 insertion(+) 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" -- cgit v1.2.3 From bc645c444c04d4d53692fd9882b892bb21263e81 Mon Sep 17 00:00:00 2001 From: Brandon Elam Barker Date: Tue, 2 Oct 2018 08:16:09 -0400 Subject: minor typo in doc: four->three (#444) --- docs/pages/4 - Tasks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pages/4 - Tasks.md b/docs/pages/4 - Tasks.md index d87b324b..a08bd032 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 {...}` -- cgit v1.2.3 From b1082cf0ab772108fdd82b79a366ab59829a9907 Mon Sep 17 00:00:00 2001 From: Julian Michael Date: Thu, 4 Oct 2018 23:20:25 -0700 Subject: Elaborate docs on using traits v classes for modules (#449) --- docs/pages/5 - Modules.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3 From 718907eb9b5252e44d704609f63fe280765ba776 Mon Sep 17 00:00:00 2001 From: Tobias Roeser Date: Fri, 5 Oct 2018 14:43:37 +0200 Subject: Example how to make case class serializable (#450) * Example how to make case class serializable * Fixed typo in docs --- docs/pages/4 - Tasks.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/pages/4 - Tasks.md b/docs/pages/4 - Tasks.md index a08bd032..6c7737e0 100644 --- a/docs/pages/4 - Tasks.md +++ b/docs/pages/4 - Tasks.md @@ -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 -- cgit v1.2.3 From 114208c4cbdbc2bc8a224b986d358526542a69b2 Mon Sep 17 00:00:00 2001 From: Brandon Elam Barker Date: Fri, 5 Oct 2018 08:58:30 -0400 Subject: fix for allowing subgroups of a given staging profile (#441) --- scalalib/src/mill/scalalib/publish/SonatypeHttpApi.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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( -- cgit v1.2.3 From 482f5407082ff44b0c084ad80adbf903d7fdc6b9 Mon Sep 17 00:00:00 2001 From: Tobias Roeser Date: Tue, 9 Oct 2018 03:36:46 +0200 Subject: Configure Idea project generator per module (#458) * Sketched how to skip some projects from Idea project generator * Better trait comment * Moved skipIdea flag into JavaModule --- scalalib/src/mill/scalalib/GenIdeaImpl.scala | 6 ++++-- scalalib/src/mill/scalalib/JavaModule.scala | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) 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 { -- cgit v1.2.3