Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs for 0.12.0 #3410

Merged
merged 21 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ jobs:
# Group these tests together to try and balance out the runtimes of each job
# Just running in `local` mode since they shouldn't depend on the mode
- java-version: 17
millargs: "'example.{basic,scalabuilds,scalamodule,web}[_].local.test'"
millargs: "'example.{basic,scalabuilds,scalamodule,scalatesting,web}[_].local.test'"
- java-version: 17
millargs: "'example.{basicjava,javabuilds,javamodule,javaweb}[_].local.test'"
millargs: "'example.{basicjava,javabuilds,javamodule,javatesting,javaweb}[_].local.test'"
- java-version: 11
millargs: "'example.thirdparty[{mockito,acyclic,commons-io}].local.test'"
- java-version: 17
Expand Down
18 changes: 8 additions & 10 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,9 @@ object example extends Module {
object basic extends Cross[ExampleCrossModule](listIn(millSourcePath / "basic"))
object basicjava extends Cross[ExampleCrossModuleJava](listIn(millSourcePath / "basicjava"))
object scalabuilds extends Cross[ExampleCrossModule](listIn(millSourcePath / "scalabuilds"))
object scalatesting extends Cross[ExampleCrossModule](listIn(millSourcePath / "scalatesting"))
object javabuilds extends Cross[ExampleCrossModuleJava](listIn(millSourcePath / "javabuilds"))
object javatesting extends Cross[ExampleCrossModuleJava](listIn(millSourcePath / "javatesting"))
object scalamodule extends Cross[ExampleCrossModule](listIn(millSourcePath / "scalamodule"))
object javamodule extends Cross[ExampleCrossModuleJava](listIn(millSourcePath / "javamodule"))
object tasks extends Cross[ExampleCrossModule](listIn(millSourcePath / "tasks"))
Expand All @@ -1229,6 +1231,7 @@ object example extends Module {
case "basicjava" => basic
case "javabuilds" => scalabuilds
case "javamodule" => scalamodule
case "javatesting" => scalatesting
}
def testRepoRoot = T{
os.copy.over(super.testRepoRoot().path, T.dest)
Expand All @@ -1242,10 +1245,7 @@ object example extends Module {
case None => T {None}
case Some(upstream) => T {
Some {
val upstreamLines = os.read.lines(
upstream
.testRepoRoot().path / "build.sc"
)
val upstreamLines = os.read.lines(upstream.testRepoRoot().path / "build.sc")
val lines = os.read.lines(super.testRepoRoot().path / "build.sc")

import collection.mutable
Expand All @@ -1255,23 +1255,21 @@ object example extends Module {
case s"//// SNIPPET:$name" =>
current = Some(name)
groupedLines(name) = mutable.Buffer()
case s => groupedLines(current.get).append(s)
case s => current.foreach(groupedLines(_).append(s))
}

current = None
upstreamLines.flatMap {
case s"//// SNIPPET:$name" =>
if (name != "END") {

current = Some(name)
groupedLines(name)
} else {
current = None
Nil
}

case s =>
if (current.nonEmpty) None
else Some(s)
case s => if (current.nonEmpty) None else Some(s)
}
}
}
Expand Down Expand Up @@ -1808,7 +1806,7 @@ object docs extends Module {
|""".stripMargin
}
s"""site:
| title: Mill
| title: The Mill Build Tool
| url: ${if (authorMode) s"${T.dest}/site" else Settings.docUrl}
| start_page: mill::Java_Intro_to_Mill.adoc
| keys:
Expand Down
26 changes: 14 additions & 12 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,25 @@
// but we intentionally skim over them and do not go into depth: the focus is
// on end user goals and how to achieve them.

.Java Quick Start
* xref:Java_Intro_to_Mill.adoc[]
.xref:Java_Intro_to_Mill.adoc[]
* xref:Java_Installation_IDE_Support.adoc[]
* xref:Java_Builtin_Commands.adoc[]
* xref:Java_Build_Examples.adoc[]
* xref:Java_Module_Config.adoc[]
* xref:Java_Web_Build_Examples.adoc[]
* xref:Java_Build_Examples.adoc[]
* xref:Testing_Java_Projects.adoc[]
// * xref:Publishing_Java_Projects.adoc[]
* xref:Java_Web_Examples.adoc[]
* xref:Case_Study_Mill_vs_Maven.adoc[]
* xref:Case_Study_Mill_vs_Gradle.adoc[]

.Scala Quick Start
* xref:Scala_Intro_to_Mill.adoc[]
.xref:Scala_Intro_to_Mill.adoc[]
* xref:Scala_Installation_IDE_Support.adoc[]
* xref:Scala_Builtin_Commands.adoc[]
* xref:Scala_Build_Examples.adoc[]
* xref:Scala_Module_Config.adoc[]
* xref:Scala_Web_Build_Examples.adoc[]
* xref:Scala_Build_Examples.adoc[]
* xref:Testing_Scala_Projects.adoc[]
// * xref:Publishing_Scala_Projects.adoc[]
* xref:Scala_Web_Examples.adoc[]

// This section is all about developing a deeper understanding of specific
// topics in Mill. This is the opposite of `Quick Start` above: while we touch
Expand All @@ -33,21 +35,21 @@
* xref:Modules.adoc[]
* xref:Cross_Builds.adoc[]
* xref:Target_Query_Syntax.adoc[]
* xref:Extending_Mill.adoc[]

* xref:The_Mill_Evaluation_Model.adoc[]

// This section talks about Mill plugins. While it could theoretically fit in
// either section above, it is probably an important enough topic it is worth
// breaking out on its own
.Mill Plugins
.Extending Mill
* xref:Import_File_And_Import_Ivy.adoc[]
* xref:Using_Plugins.adoc[]
* xref:Contrib_Plugins.adoc[]
// See also the list in Contrib_Plugins.adoc
** xref:contrib/artifactory.adoc[]
** xref:contrib/bintray.adoc[]
** xref:contrib/bloop.adoc[]
** xref:contrib/buildinfo.adoc[]
** xref:Plugin_BSP.adoc[]
** xref:contrib/codeartifact.adoc[]
** xref:contrib/docker.adoc[]
** xref:contrib/flyway.adoc[]
Expand All @@ -60,8 +62,8 @@
** xref:contrib/testng.adoc[]
** xref:contrib/twirllib.adoc[]
** xref:contrib/versionfile.adoc[]

* xref:Thirdparty_Plugins.adoc[]
* xref:The_Mill_Meta_Build.adoc[]

// Reference pages that a typical user would not typically read top-to-bottom,
// but may need to look up once in a while, and thus should be written down
Expand Down
8 changes: 7 additions & 1 deletion docs/modules/ROOT/pages/Contrib_Plugins.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
= Contrib Plugins
:page-aliases: Contrib_Modules.adoc


The ((plugins)) in this section are hosted in the Mill git tree and developed / maintained by the community.

For details about including plugins in your `build.sc` read xref:Using_Plugins.adoc[Using Mill Plugins].
Expand Down Expand Up @@ -46,4 +47,9 @@ import $ivy.`com.lihaoyi::mill-contrib-bloop:`
* xref:contrib/scoverage.adoc[]
* xref:contrib/testng.adoc[]
* xref:contrib/twirllib.adoc[]
* xref:contrib/versionfile.adoc[]
* xref:contrib/versionfile.adoc[]


== Importing Contrib Modules

include::example/misc/6-contrib-import.adoc[]
91 changes: 0 additions & 91 deletions docs/modules/ROOT/pages/Extending_Mill.adoc

This file was deleted.

4 changes: 4 additions & 0 deletions docs/modules/ROOT/pages/Import_File_And_Import_Ivy.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
= import $file and import $ivy

include::example/misc/3-import-file-ivy.adoc[]

4 changes: 0 additions & 4 deletions docs/modules/ROOT/pages/Java_Build_Examples.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ include::example/javabuilds/3-override-tasks.adoc[]

include::example/javabuilds/4-nested-modules.adoc[]

== Java Module With Test Suite

include::example/javabuilds/5-test-suite.adoc[]

== Publish Module

include::example/javabuilds/6-publish-module.adoc[]
Expand Down
4 changes: 2 additions & 2 deletions docs/modules/ROOT/pages/Java_Intro_to_Mill.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ include::partial$Intro_to_Mill_Header.adoc[]
Mill is used to build some real-world Java projects, such as the
https://github.com/swaldman/c3p0[C3P0 JDBC Connection Pool], and
can be used for applications built on top of common Java frameworks like
xref:Java_Web_Build_Examples.adoc#_spring_boot_todomvc_app[Spring Boot] or
xref:Java_Web_Build_Examples.adoc#_micronaut_todomvc_app[Micronaut].
xref:Java_Web_Examples.adoc#_spring_boot_todomvc_app[Spring Boot] or
xref:Java_Web_Examples.adoc#_micronaut_todomvc_app[Micronaut].

Mill borrows ideas from other tools like https://maven.apache.org/[Maven],
https://gradle.org/[Gradle], https://bazel.build/[Bazel], but tries to learn from the
Expand Down
4 changes: 0 additions & 4 deletions docs/modules/ROOT/pages/Java_Module_Config.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ include::example/javamodule/2-ivy-deps.adoc[]

include::example/javamodule/3-run-compile-deps.adoc[]

== Test Dependencies

include::example/javamodule/4-test-deps.adoc[]

== Classpath and Filesystem Resources

include::example/javamodule/5-resources.adoc[]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= Java Web Build Examples
= Java Web Examples

++++
<script>
Expand Down
35 changes: 2 additions & 33 deletions docs/modules/ROOT/pages/Modules.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -58,40 +58,9 @@ service & cache that is shared between all ``ScalaModule``s, and
`mill.scalalib.GenIdea/idea` lets you generate IntelliJ projects without
needing to define your own `T.command` in your `build.sc` file

== Foreign Modules

Mill can load other mill projects from external (or sub) folders,
using Ammonite's `$file` magic import, allowing to depend on foreign modules.
This allows, for instance, to depend on other projects' sources, or split
your build logic into smaller files.
== Nested `module.sc` files

For instance, assuming the following structure :
include::example/tasks/10-module-sc.adoc[]

[source,text]
----
foo/
build.sc
bar/
build.sc
baz/
build.sc
----

you can write the following in `foo/build.sc` :

[source,scala]
----

import $file.bar.build
import $file.^.baz.build
import mill._

def someFoo = T {

^.baz.build.someBaz(...)
bar.build.someBar(...)
...
}
----

The output of the foreign tasks will be cached under `foo/out/foreign-modules/`.
4 changes: 0 additions & 4 deletions docs/modules/ROOT/pages/Scala_Build_Examples.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ include::example/scalabuilds/3-override-tasks.adoc[]

include::example/scalabuilds/4-nested-modules.adoc[]

== Scala Module With Test Suite

include::example/scalabuilds/5-test-suite.adoc[]

== Publish Module

include::example/scalabuilds/6-publish-module.adoc[]
Expand Down
6 changes: 1 addition & 5 deletions docs/modules/ROOT/pages/Scala_Module_Config.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ include::example/scalamodule/2-ivy-deps.adoc[]

include::example/scalamodule/3-run-compile-deps.adoc[]

== Test Dependencies

include::example/scalamodule/4-test-deps.adoc[]

== Classpath and Filesystem Resources

include::example/scalamodule/5-resources.adoc[]
Expand Down Expand Up @@ -172,7 +168,7 @@ The older your used Mill version or the newer the Scala version you want to use,

== Disabling incremental compilation with Zinc

By default all `ScalaModule`s use incremental compilation via https://github.com/sbt/zinc[Zinc] to
By default all ``ScalaModule``s use incremental compilation via https://github.com/sbt/zinc[Zinc] to
only recompile sources that have changed since the last compile, or ones that have been invalidated
by changes to upstream sources.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= Scala Web Build Examples
= Scala Web Examples

++++
<script>
Expand Down
Loading
Loading