Skip to content

Commit 4397dc7

Browse files
authored
More config and script module doc updates (#6037)
1 parent 770c073 commit 4397dc7

File tree

84 files changed

+290
-188
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+290
-188
lines changed

example/javalib/basic/1-script/build.mill

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@ compiling 1 Java source to...
3131

3232
//// SNIPPET:END
3333

34+
//// SNIPPET:RESOLVE
35+
/** Usage
36+
37+
> ./mill resolve Foo.java:_
38+
run
39+
runMain
40+
compile
41+
assembly
42+
...
43+
44+
*/
45+
//// SNIPPET:END
3446
//// SNIPPET:TEST
3547

3648
/** See Also: FooTest.java */

example/javalib/basic/3-simple/build.mill

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
//// SNIPPET:DEPENDENCIES
22
//
3-
// This is a basic Mill build for a single `JavaModule`, with two
4-
// third-party dependencies and a test suite using the JUnit framework.
53
// This example project uses two third-party dependencies - https://argparse4j.github.io/[ArgParse4J] for CLI
6-
// argument parsing, https://www.thymeleaf.org//[Thymeleaf] for HTML rendering - and uses them to wrap a
4+
// argument parsing, https://www.thymeleaf.org/[Thymeleaf] for HTML rendering - and uses them to wrap a
75
// given input string in HTML templates with proper escaping.
6+
// The `test/` submodule contains its own `mvnDeps`
7+
// for dependencies that are only used in the test suite.
88
//
99
//// SNIPPET:TREE
1010
// ----
@@ -27,9 +27,9 @@
2727
// ...
2828
// ----
2929
//
30-
// NOTE: The default Mill source folder layout `src/` differs from that of Maven/Gradle's
31-
// `src/main/java/`.
32-
// If you wish to use the Maven source folder layout, e.g. for migrating
30+
// NOTE: The default Mill source folder layout `src/` and `test/src/` differs from that of
31+
// Maven/Gradle's `src/main/java/` and `src/test/java/`.
32+
// If you wish to use the Maven source folder layout, e.g. for compatibility with
3333
// an existing codebase, you should use
3434
// xref:#_maven_compatible_modules[Maven-Compatible Modules]
3535
//
@@ -58,11 +58,12 @@ Test foo.FooTest.testEscaping finished...
5858
//// SNIPPET:END
5959
//// SNIPPET:REPL
6060
//
61-
// You can start a JShell REPL attached to your `foo` module via:
61+
// You can start a JShell REPL attached to your root module or the `test` submodule via:
6262
//
6363
// [source,console]
6464
// ----
6565
// > ./mill -i jshell
66+
// > ./mill -i test.jshell
6667
// ----
6768
//
6869
// You can also start a standalone JShell console
Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,20 @@
1-
//// SNIPPET:ALL
2-
// Mill's default folder layout of `foo/src/` and `foo/test/src` differs from that
3-
// of Maven or Gradle's `foo/src/main/java/` and `foo/src/test/java/`. If you are
4-
// migrating an existing codebase, you can use Mill's `MavenModule` and
5-
// `MavenTests` as shown below to preserve filesystem compatibility with an existing
6-
// Maven or Gradle build:
7-
8-
/** See Also: build.mill.yaml */
1+
//// SNIPPET:FIRST
92

103
// `MavenModule` is a variant of `JavaModule`
11-
// that uses the more verbose folder layout of Maven, `sbt`, and other tools:
4+
// that uses the more verbose folder layout of Maven, SBT, and other tools:
125
//
13-
// - `foo/src/main/java/`
14-
// - `foo/src/test/java/`
6+
// - `src/main/java/`
7+
// - `src/test/java/`
158
//
169
// Rather than Mill's
1710
//
18-
// - `foo/src/`
19-
// - `foo/test/src/`
11+
// - `src/`
12+
// - `test/src/`
2013
//
2114

22-
// This is especially useful if you are migrating to Mill, as during the migration a
23-
// particular module may be built using both Maven/Gradle and Mill at the
24-
// same time. That means that during migration, you can leave all your source files
25-
// in place while setting up your Mill build, and do not need to invasively move them
26-
// around to match the Mill default module layout.
27-
//
28-
// Although the source layout of these compatibility modules is different from the
29-
// default `JavaModule`, the command-line usage is the same:
15+
//// SNIPPET:END
16+
17+
//// SNIPPET:SECOND
3018

3119
/** Usage
3220

@@ -46,5 +34,3 @@ compiling 1 Java source...
4634
...foo.FooIntegrationTests.hello ...
4735

4836
*/
49-
50-
// For more details on migrating from other build tools, see xref:migrating/migrating.adoc[]

example/javalib/config/3-linting/build.mill

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class Foo {
3535
// xref:javalib/linting.adoc#_auto_formatting_with_spotless[mill.javalib.spotless.SpotlessModule]
3636
// that can also be used
3737

38-
// === Autofixing
38+
// === Linting
3939

4040
// To lint your code with https://errorprone.info/index[ErrorProne], you can
4141
// make yor module extend `mill.javalib.errorprone.ErrorProneModule`, which will
@@ -56,5 +56,7 @@ public class Foo {
5656

5757
// See xref:javalib/linting.adoc#_linting_with_errorprone[Linting with ErrorProne] for more
5858
// details on how ErrorProne can be configured. Apart from ErrorProne, Mill also comes with
59-
// xref:javalib/linting.adoc#_linting_with_checkstyle[mill.contrib.checkstyle.CheckstyleModule] and
60-
// xref:javalib/linting.adoc#_static_analysis_with_pmd[mill.javalib.pmd.PmdModule]
59+
// support for other linters via:
60+
//
61+
// - xref:javalib/linting.adoc#_linting_with_checkstyle[mill.contrib.checkstyle.CheckstyleModule]
62+
// - xref:javalib/linting.adoc#_static_analysis_with_pmd[mill.javalib.pmd.PmdModule]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
extends: [mill.javalib.JavaModule, mill.javalib.NativeImageModule]
2+
jvmId: "graalvm-community:24"
3+
nativeImageOptions: ["--no-fallback"]

example/javalib/config/4-publishing/build.mill.yaml renamed to example/javalib/config/5-publishing/build.mill.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
extends: [mill.javalib.JavaModule, mill.javalib.PublishModule, mill.javalib.NativeImageModule]
2-
jvmId: "graalvm-community:24"
3-
nativeImageOptions: ["--no-fallback"]
1+
extends: [mill.javalib.JavaModule, mill.javalib.PublishModule]
42
publishVersion: "0.0.1"
53
artifactName: "example"
64
pomSettings:
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public class Bar {
2+
public static void main(String[] args) {
3+
System.out.println("Hello Graal Native: " + System.getProperty("java.version"));
4+
}
5+
}

0 commit comments

Comments
 (0)