-
-
Notifications
You must be signed in to change notification settings - Fork 360
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
Add Ktfmt support #3620
Add Ktfmt support #3620
Conversation
Thanks @0xnm ! I'll transfer you the bounty using your earlier details |
* Ktfmt version. | ||
*/ | ||
def ktfmtVersion: T[String] = T { | ||
"0.52" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to provide a default at all, we should at least source it from a BuildInfo
generated at build/release time. That way, we can automate bumping this dependency as part of Mill's version management.
|
||
object KtfmtModule extends ExternalModule with KtfmtBaseModule with TaskModule { | ||
|
||
def kotlinVersion = "1.9.24" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this hardcoded version here. We should source it from some generated BuildInfo
.
): Seq[os.Path] = { | ||
|
||
object module extends TestBaseModule with KotlinModule with KtfmtModule { | ||
override def kotlinVersion: T[String] = "1.9.24" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version used here should be defined at the top of the test file. Same, for the other occurences.
Some minor cleanup for the previous work on the Kotlin-related modules: * Read tooling versions from build info (#3620 (comment) and #3620 (comment)) * Declare versions only once in the unit tests * Change parent module to `JavaModule` for Ktfmt support, because we don't need the code to be compiled in this module, so declaring Kotlin version there was looking a bit strange. In fact only `sources()` method is needed, which is available in the `JavaModule`. In the future `KotlinModule` may be split into different traits: the one which collects Kotlin+Java files, but doesn't do any compilation (so Kotlin version is not needed) and the one which actually does compilation. --------- Co-authored-by: 0xnm <[email protected]>
Fixes #3612.
This PR is based on the logic done in #3531, so it looks quite similar.