com-lihaoyi / mill

Mill is a fast JVM build tool that supports Java, Scala and Kotlin. 2-4x faster than Gradle and 4-10x faster than Maven for common workflows, Mill aims to make your project’s build process performant, maintainable, and flexible
https://mill-build.org/
MIT License
2.23k stars 359 forks source link

Standardize common utility naming conventions between languages? #3630

Open lihaoyi opened 1 month ago

lihaoyi commented 1 month ago

We now support 3 languages: Scala, Java, and Kotlin. Each of these has linters, autoformatters, code coverage reporters, on top of the existing "standard" tasks like compile, run, test, publish, etc.

It would be nice if we could standardize .lint, .autoformat, .coverage, etc. as well. That will help keep the experience of using Mill consistent regardless of what language the codebase is written in, and would especially help in multi-language polyglot codebases

lefou commented 1 month ago

I'd like to extends this also for standard build steps. For example have a no-op trait defining compile, and all existing Languages extend that, so that we can easily stack languages on top of each other. Currently we can stack Kotlin on top of Java, but not Java on top of Kotlin.

As a more in-depth motivation: Although Kotlin as well as Scala support Java sources, they get in trouble when there comes a newer Java language feature or when the Java code is supposed to be processed further (thinking of annotation processors or AspectJ compilers). Having a interface-only trait as a base, we can make sure, a super-call is always possible. Being free to stack in arbitrary order would be of great help.

And since we try to learn from this, we also should introduce interface-only traits for Linting and coverage collecting, so users can easily stack these in whatever order to achieve their setups.

lihaoyi commented 1 month ago

Gradle calls these Lifecycle Tasks https://docs.gradle.org/current/userguide/organizing_tasks.html, which are tasks which don't do any of the work themselves but are used to group related tasks together under standardized labels for easy discoverability and usage