-
-
Notifications
You must be signed in to change notification settings - Fork 347
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 kotlinlib example/module
examples
#3585
Conversation
@@ -134,6 +135,83 @@ trait KotlinModule extends JavaModule { outer => | |||
() | |||
} | |||
|
|||
override def docJar: T[PathRef] = T[PathRef] { | |||
T.log.info("docJar task shouldn't be used for Kotlin modules, using dokkaJar instead") |
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 wonder if we really need this warning? e.g. for both Java and Scala 2.x and Scala 3.x they all use docJar
, despite being wildly different backend implementations. Can we just let KotlineModule users use docJar
as well?
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.
Sure, I added Dokka backend for docJar
directly, without a dedicated dokkaJar
task (although the example is still called 7-dokkajar
to avoid copying lines from scalalib
).
I think this looks pretty good. Left one more comment, and lemme try to get tests green before merging |
Seems the mockito tests are flaky, will merge regardless and deal with the flaky test after |
Thanks @0xnm! Just need the |
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
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.6-annotation-processors
- I usedkotlinx.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
- obviouslyjavadoc
cannot be used to generate docs for Kotlin classes, so I added support for Dokka toKotlinModule
and added a forwarding ofdocJar
calls todokkaJar
.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 tojavac
to generate headers), so I dropped header generation.