-
-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate new kotlin examples into docsite (#3592)
Apart from adding `.adoc` pages for all the kotlin examples #3585 #3589 #3555 and the palantir java format example from https://github.com/com-lihaoyi/mill/pulls?page=2&q=is%3Apr+is%3Aclosed, I moved some docs around: the first few things under `Foo Example Builds` really belong under `Foo Module Configuration`, the `external/libraries/` folder should be in `depth/libraries/` The test for `Custom Main Argument Parsers` seems to have bitrotted since it was implemented, and it accidentally wasn't running in the test suite before so we didn't notice. For now just disabling that test and we can fix it later
- Loading branch information
Showing
235 changed files
with
362 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
= Kotlin Build Examples | ||
|
||
++++ | ||
<script> | ||
gtag('config', 'AW-16649289906'); | ||
</script> | ||
++++ | ||
|
||
On this page, we will explore the Mill build tool via a series of simple Kotlin | ||
example projects. Each project demonstrates one particular feature of the Mill | ||
build tool, and is also an executable codebase you can download and run. By the | ||
end of this page, you will be familiar with how to configure Mill to work with | ||
realistic Kotlin codebases: cross-building, testing, and publishing them. | ||
|
||
|
||
Many of the APIs covered here are listed in the API documentation: | ||
|
||
* {mill-doc-url}/api/latest/mill/main/RootModule.html[`mill.kotlinlib.RootModule`] | ||
* {mill-doc-url}/api/latest/mill/scalalib/TestModule$.html[`mill.kotlinlib.TestModule`] | ||
* {mill-doc-url}/api/latest/mill/scalalib/PublishModule.html[`mill.kotlinlib.PublishModule`] | ||
* {mill-doc-url}/api/latest/mill/kotlinlib/KotlinMavenModule.html[`mill.kotlinlib.KotlinMavenModule`] | ||
* {mill-doc-url}/api/latest/mill/kotlinlib/KotlinModule.html[`mill.kotlinlib.KotlinModule`] | ||
== Nesting Modules | ||
|
||
include::example/kotlinlib/builds/1-nested-modules.adoc[] | ||
|
||
== Maven-Compatible Modules | ||
|
||
include::example/kotlinlib/builds/2-compat-modules.adoc[] | ||
|
||
|
||
== Realistic Kotlin Example Project | ||
|
||
include::example/kotlinlib/builds/4-realistic.adoc[] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
= Kotlin Module Configuration | ||
|
||
++++ | ||
<script> | ||
gtag('config', 'AW-16649289906'); | ||
</script> | ||
++++ | ||
|
||
This page goes into more detail about the various configuration options | ||
for `KotlinModule`. | ||
|
||
Many of the APIs covered here are listed in the API documentation: | ||
|
||
* {mill-doc-url}/api/latest/mill/kotlinlib/KotlinModule.html[mill.kotlinlib.KotlinModule] | ||
== Common Configuration Overrides | ||
|
||
include::example/kotlinlib/module/1-common-config.adoc[] | ||
|
||
== Custom Tasks | ||
|
||
include::example/kotlinlib/module/2-custom-tasks.adoc[] | ||
|
||
== Overriding Tasks | ||
|
||
include::example/kotlinlib/module/3-override-tasks.adoc[] | ||
|
||
|
||
== Compilation & Execution Flags | ||
|
||
include::example/kotlinlib/module/4-compilation-execution-flags.adoc[] | ||
|
||
== Adding Ivy Dependencies | ||
|
||
include::example/kotlinlib/module/5-ivy-deps.adoc[] | ||
|
||
== Runtime and Compile-time Dependencies | ||
|
||
include::example/kotlinlib/module/6-run-compile-deps.adoc[] | ||
|
||
== Classpath and Filesystem Resources | ||
|
||
include::example/kotlinlib/module/7-resources.adoc[] | ||
|
||
== Kotlin Compiler Plugins | ||
|
||
include::example/kotlinlib/module/8-kotlin-compiler-plugins.adoc[] | ||
|
||
== Javadoc Config | ||
|
||
include::example/kotlinlib/module/9-docjar.adoc[] | ||
|
||
== Unmanaged Jars | ||
|
||
include::example/kotlinlib/module/10-unmanaged-jars.adoc[] | ||
|
||
== Specifying the Main Class | ||
|
||
include::example/kotlinlib/module/11-main-class.adoc[] | ||
|
||
== Downloading Non-Maven Jars | ||
|
||
include::example/kotlinlib/module/12-downloading-non-maven-jars.adoc[] | ||
|
||
== Customizing the Assembly | ||
|
||
include::example/kotlinlib/module/13-assembly-config.adoc[] | ||
|
||
== Repository Config | ||
|
||
include::example/kotlinlib/module/14-repository-config.adoc[] | ||
|
||
=== Maven Central: Blocked! | ||
|
||
Under some circumstances (e.g. corporate firewalls), you may not have access maven central. The typical symptom will be error messages which look like this; | ||
|
||
---- | ||
1 targets failed | ||
mill.scalalib.ZincWorkerModule.classpath | ||
Resolution failed for 1 modules: | ||
-------------------------------------------- | ||
com.lihaoyi:mill-scalalib-worker_2.13:0.11.1 | ||
not found: C:\Users\partens\.ivy2\local\com.lihaoyi\mill-scalalib-worker_2.13\0.11.1\ivys\ivy.xml | ||
download error: Caught java.io.IOException (Server returned HTTP response code: 503 for URL: https://repo1.maven.org/maven2/com/lihaoyi/mill-scalalib-worker_2.13/0.11.1/mill-scalalib-worker_2.13-0.11.1.pom) while downloading https://repo1.maven.org/maven2/com/lihaoyi/mill-scalalib-worker_2.13/0.11.1/mill-scalalib-worker_2.13-0.11.1.pom | ||
---- | ||
It is expected that basic commands (e.g. clean) will not work, as Mill saying it is unable to resolve it's own, fundamental, dependencies. Under such circumstances, you will normally have access to some proxy, or other corporate repository which resolves maven artefacts. The strategy is simply to tell mill to use that instead. | ||
The idea is to set an environment variable COURSIER_REPOSITORIES (see coursier docs). The below command should set the environment variable for the current shell, and then run the mill command. | ||
---- | ||
COURSIER_REPOSITORIES=https://packages.corp.com/artifactory/maven/ mill resolve _ | ||
---- | ||
If you are using millw, a more permanent solution could be to set the environment variable at the top of the millw script, or as a user environment variable etc. | ||
== Native C Code with JNI | ||
include::example/kotlinlib/module/15-jni.adoc[] | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
= Linting Kotlin Projects | ||
|
||
++++ | ||
<script> | ||
gtag('config', 'AW-16649289906'); | ||
</script> | ||
++++ | ||
|
||
This page will discuss common topics around enforcing the code quality of Kotlin | ||
codebases using the Mill build tool | ||
|
||
== Detekt | ||
|
||
include::example/kotlinlib/linting/1-detekt.adoc[] | ||
|
||
== KtLint | ||
|
||
include::example/kotlinlib/linting/2-ktlint.adoc[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
= Publishing Kotlin Projects | ||
|
||
++++ | ||
<script> | ||
gtag('config', 'AW-16649289906'); | ||
</script> | ||
++++ | ||
|
||
This page will discuss common topics around publishing your Kotlin projects for others to use | ||
|
||
== Publishing Locally | ||
|
||
include::example/kotlinlib/publishing/2-publish-module.adoc[] | ||
|
||
include::partial$Publishing_Footer.adoc[] |
Oops, something went wrong.