-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
First Party Support for the Kotlin language (2000USD) #3451
Comments
If I claim this, can others also claim or start work on the bounty? |
@githubbin765 As mentioned in https://github.com/orgs/com-lihaoyi/discussions/5, bounties remain open until completed. In this case I (just) broke up the bounty into two phases so it's not such a big all-or-nothing ticket, and I can break it up further if you think it would be useful. But fundamentally there is no locking of bounties, so others can pick it up as well, and first PR wins (at my discretion) |
I see, that makes sense. Changing the bounty rules based on specific participation seems like a good idea potentially. Ok I seem to have identified how to in-source the library may be able to complete translating remaining examples today for the first part of this. I will create two separate PRs one for the in-sourcing, another for examples. |
I would suggest doing everything in (1) above in one PR: both the insourced library and the translated |
The above isn't ChatGPT output. You also suggested using ChatGPT in the first post in order to help resolve this bounty. I shared the above because you stated wanting the example/javalib/basic examples converted to Kotlin and included on the docsite so I created a docsite format using Markdown. For the docsite, does the above look ok to you? |
@githubbin765 I don't think the output you gave above is relevant to the bounty at hand. I'm going to clean up the thread to make space for any further discussion that may occur. Feel free to open a PR when you have the working examples and we can take it from there |
@lihaoyi I see. I will do that. I will open a second PR for the second bounty with the doc site code. |
This PR solves Part 1 from #3451: * It in-sources https://github.com/lefou/mill-kotlin with minimal changes * It adds basic samples I still need to finalize it (especially automated test for example `4-builtin-commands` fails right now), but most of the work is done. Things I noticed in the original implementation (https://github.com/lefou/mill-kotlin): * Kotlin stdlib is added by overriding `ivyDeps`, meaning that if the user of `KotlinModule` wants to add its own deps and forget to call `super.ivyDeps() ++ <their deps>` and just does `def ivyDeps = <their deps>`, then no stdlib will be in the classpath during the compilation and it will fail with cryptic error. Such approach is thus error-prone. * No Kotlin Reflection library is added automatically to the compile classpath, meaning that if code to compile contains any Kotlin Reflection classes, compilation will fail (because `-nostdlib` [flag](https://kotlinlang.org/docs/compiler-reference.html#nostdlib) is used for compilation) @lihaoyi Feel free to give your feedback while this is in a Draft state if you want. --------- Co-authored-by: 0xnm <0xnm@users.noreply.github.com>
@lihaoyi I may look into Part 2 as well. Do you have any ideas/suggestions about Kotlin libraries/frameworks you would like to see there? |
@0xnm most of the rest of the
|
TBH the list of stuff above seems like a lot. I'd be ok if you skipped the |
I think the compiler plugin stuff is essential. Showcasing usage of |
@lefou Anyone else notice that the GH Issues UI creates text overflow when resizing browser windows? |
@llvee Please open a PR if you have one that satisfies the bounty requirements, otherwise there isnt that much to continue discussing here |
This PR partially addresses Part 2 of #3451, it add `builds` and `linting` examples. For the linting example I used [detekt](https://github.com/detekt/detekt) for the static code analysis (`error-prone` doesn't support Kotlin) and [ktlint](https://github.com/pinterest/ktlint) for formatting. Note: `builds/8-compat-modules` used `src/java` structure which is dictated by the `MavenModule`, but ideally it should be `src/kotlin` for Kotlin files and _maybe_ `src/java` for Java files. --------- Co-authored-by: 0xnm <0xnm@users.noreply.github.com>
This PR adds more stuff for #3451, namely `example/kotlinlib/module` examples. Few notes about things being done: * `1-compilation-execution-flags` - there is not so many flags which can be passed to the Kotlin Compiler itself. I simply used [-Werror](https://kotlinlang.org/docs/compiler-reference.html#werror). * `6-annotation-processors` - I used `kotlinx.serialization` as proposed by @lefou. It seems Kotlin Compiler doesn't automatically pick compilation plugins from the classpath, so I had to pass path to it explicitly using `-Xplugin` option. * `7-dokkajar` - obviously `javadoc` cannot be used to generate docs for Kotlin classes, so I added support for [Dokka](https://github.com/Kotlin/dokka) to `KotlinModule` and added a forwarding of `docJar` calls to `dokkaJar`. * `13-jni` - there is no possibility to generate header files from Kotlin files (unless an ugly trick is used to take compiled `.class` files, decompile them back, clean-up and pass to `javac` to generate headers), so I dropped header generation. --------- Co-authored-by: 0xnm <0xnm@users.noreply.github.com>
Another addition for #3451: it adds `publishing` and `testing` examples for Kotlin. The only thing that needs to be mentioned is test filtering in Kotest: it doesn't have `package.class.method` format to do the filtering, instead it is using `specs` + `classes` parameters (see [here](https://kotest.io/docs/framework/conditional/conditional-tests-with-gradle.html)). Also `mockito-kotlin` requires JVM bytecode target to be 11. Co-authored-by: 0xnm <0xnm@users.noreply.github.com> Co-authored-by: Li Haoyi <haoyi.sg@gmail.com>
From the maintainer Li Haoyi: I'm putting a 2000USD bounty on this issue, payable by bank transfer on a merged PR implementing this.
https://github.com/lefou/mill-kotlin/ exists, but it is a standalone project without many examples, and not enough for a newbie to pick up and begin using Mill with Kotlin. This ticket is to do the following:
kotlinlib
submoduleexample/javalib/{basic,builds,module,testing}
example integration tests, where reasonableAs this ticket is large, I am splitting the bounty into two parts:
mill-kotlin
in-sourced and theexample/javalib/basic
examples converted to Kotlin and included on the docsiteexample/javalib/{builds,module,testing,publishing}
converted to Kotlin and included on the docsiteThe end result is that we have a suite of tested example documentation demonstrating how to use the Mill build tool to build a large variety of Kotlin projects mirroring the example documentation for Java and Scala projects.
Some code may be adaptable from https://github.com/rife2/bld-kotlin. ChatGPT (or claude or whatever) would probably also be a great help translating the examples; I used it heavily when setting up the Java example tests, but in the end the human still needs to debug things and polish it up so it's presentable for pedagogical purposes
The text was updated successfully, but these errors were encountered: