Skip to content

Commit

Permalink
Move ErrorProneModule and CheckstyleModule into mill.javalib (#…
Browse files Browse the repository at this point in the history
…3663)

This brings them in line with `palantirformat`, `scalafmt`, and the
various `kotlinlib.*` packages

The modules are pretty small so hopefully won't do much to bloat
`mill.javalib`, especially once we split up `javalib` and `scalalib`
  • Loading branch information
lihaoyi authored Oct 4, 2024
1 parent 86606fb commit 661613e
Show file tree
Hide file tree
Showing 32 changed files with 179 additions and 208 deletions.
2 changes: 0 additions & 2 deletions build.mill
Original file line number Diff line number Diff line change
Expand Up @@ -758,8 +758,6 @@ object dist0 extends MillPublishJavaModule {
build.contrib.jmh.testDep(),
build.contrib.playlib.testDep(),
build.contrib.playlib.worker("2.8").testDep(),
build.contrib.errorprone.testDep(),
build.contrib.checkstyle.testDep(),
build.bsp.worker.testDep(),
build.testkit.testDep()
)
Expand Down
128 changes: 0 additions & 128 deletions contrib/checkstyle/readme.adoc

This file was deleted.

31 changes: 0 additions & 31 deletions contrib/errorprone/readme.adoc

This file was deleted.

14 changes: 0 additions & 14 deletions contrib/package.mill
Original file line number Diff line number Diff line change
Expand Up @@ -211,18 +211,4 @@ object `package` extends RootModule {
def compileModuleDeps = Seq(build.scalalib)
def testModuleDeps = super.testModuleDeps ++ Seq(build.scalalib)
}

object errorprone extends ContribModule with BuildInfo {
def compileModuleDeps = Seq(build.scalalib)
def testModuleDeps = super.testModuleDeps ++ Seq(build.scalalib)
def buildInfoPackageName = "mill.contrib.errorprone"
def buildInfoObjectName = "BuildInfo"
def buildInfoMembers =
Seq(BuildInfo.Value("errorProneVersion", Deps.RuntimeDeps.errorProneCore.version))
}

object checkstyle extends ContribModule {
def compileModuleDeps = Seq(build.scalalib)
def testModuleDeps = super.testModuleDeps ++ Seq(build.scalalib)
}
}
2 changes: 0 additions & 2 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@
** xref:contrib/buildinfo.adoc[]
** xref:contrib/codeartifact.adoc[]
** xref:contrib/docker.adoc[]
** xref:contrib/errorprone.adoc[]
** xref:contrib/checkstyle.adoc[]
** xref:contrib/flyway.adoc[]
** xref:contrib/gitlab.adoc[]
** xref:contrib/jmh.adoc[]
Expand Down
2 changes: 0 additions & 2 deletions docs/modules/ROOT/pages/extending/contrib-plugins.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ import $ivy.`com.lihaoyi::mill-contrib-bloop:`
* xref:contrib/buildinfo.adoc[]
* xref:contrib/codeartifact.adoc[]
* xref:contrib/docker.adoc[]
* xref:contrib/errorprone.adoc[]
* xref:contrib/checkstyle.adoc[]
* xref:contrib/flyway.adoc[]
* xref:contrib/gitlab.adoc[]
* xref:contrib/jmh.adoc[]
Expand Down
38 changes: 33 additions & 5 deletions example/javalib/linting/1-error-prone/build.mill
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// When adding the xref:contrib/errorprone.adoc[`ErrorPromeModule`] to your `JavaModule`,
// When adding the `ErrorPromeModule` to your `JavaModule`,
// the `error-prone` compiler plugin automatically detects various kind of programming errors.


package build
import mill._, javalib._
import mill.contrib.errorprone._
import mill._, javalib._, errorprone._

import $ivy.`com.lihaoyi::mill-contrib-errorprone:`

object `package` extends RootModule with JavaModule with ErrorProneModule {
def errorProneOptions = Seq("-XepAllErrorsAsWarnings")
Expand All @@ -29,4 +27,34 @@ object `package` extends RootModule with JavaModule with ErrorProneModule {
[warn] ^
*/

// Find more details on the xref:contrib/errorprone.adoc[ErrorProne plugin page].
// :page-aliases: Plugin_ErrorProne.adoc
//
// https://errorprone.info/index[Error Prone] augments the Java compiler's type checker and detect common mistakes at compile time.
//
// You just need to mix the `ErrorProneModule` into your `JavaModule` and it will automatically run with every compilation.
//
// .`build.mill.scala`: Enable `ErrorProne` in a module
// [source,scala]
// ----
// package build
// import mill._, scalalib._
//
// import $ivy.`com.lihaoyi::mill-contrib-errorprone:`
// import mill.contrib.errorprone.ErrorProneModule
//
// object foo extends JavaModule with ErrorProneModule {
// }
// ----
//
// === Configuration
//
// The following configuration options exist:
//
// `def errorProneVersion: T[String]`::
// The `error-prone` version to use. Defaults to [[BuildInfo.errorProneVersion]], the version used to build and test the module.
// Find the latest at https://mvnrepository.com/artifact/com.google.errorprone/error_prone_core[mvnrepository.com]
//
// `def errorProneOptions: T[Seq[String]]`::
// Options directly given to the `error-prone` processor.
// Those are documented as "flags" at https://errorprone.info/docs/flags
//
Loading

0 comments on commit 661613e

Please sign in to comment.