Build Tools API
This looks very good!
A special note about Kotlin/Native: currently, Kotlin/Native has a completely separated distribution that is to be supplied by a build system. It can be bundled into BTA, or the provisioning may be encapsulated in it to simplify the integration. The exact way of simplification is an implementation detail.
Could it be possible to clarify in the KEEP that anytime there is a setup step, there should be a way for the build tool to do it separately or not do it at all. For example, the downloading of the Kotlin Native toolchain, the downloading of Node when using JS, etc. It's fine if the BTA implementation does it transparently by default, but there should be a way for build tools to explicitly take responsibility of these steps themselves, without opting out of everything else the BTA offers. For example, because a build tool has better caching capabilities, because internet connection requires specific configuration that the Kotlin daemon won't have, etc.
Will this Build Tools API be able to allow integration into an LSP Server? Such as, it is trivially possible to implement an LSP Server using this API?
Will this Build Tools API be able to allow integration into an LSP Server? Such as, it is trivially possible to implement an LSP Server using this API?
The purpose of this API is different than providing code editor/IDE support for language, but rather support for building Kotlin code. Take a look at https://kotl.in/lsp for information on Kotlin LSP which is built on another API
Could it be possible to clarify in the KEEP that anytime there is a setup step, there should be a way for the build tool to do it separately or not do it at all. For example, the downloading of the Kotlin Native toolchain, the downloading of Node when using JS, etc. It's fine if the BTA implementation does it transparently by default, but there should be a way for build tools to explicitly take responsibility of these steps themselves, without opting out of everything else the BTA offers. For example, because a build tool has better caching capabilities, because internet connection requires specific configuration that the Kotlin daemon won't have, etc.
Thanks for feedback! Sure, we are keeping that in mind. We aim to provide ways to delegate some work to build systems. Another example would be detecting touched files for incremental compilation for further finding of affected code: BTA is capable of doing it, but it can also rely on information provided by the build system instead, if the build system does this anyway.
Do you plan to add Build Server Protocol support or would this be an abstraction on top of BTA?
@hfhbd Build Server Protocol is a standardized protocol allowing any IDE to load project state from a build system. So it is not really related to Build Tools API. BTA is an API for a build system to communicate with Kotlin compiler and ecosystem around.
In general we are investigating as well BSP and whether we could use it for build systems supporting Kotlin for importing process.
I have an unofficial Kotlin compiler (implemented based on official compiler components and compatible with KMP). I would like to know if BTA has any future plans to support such unofficial targets? For example, by opening up interfaces to allow other Gradle plugins to register targets. Another example is Tencent's Kuikly-Base, which added a new target called 'ohos' (Open Harmony OS) within Kotlin/Native. Will supporting something like this also be considered in the future?
Hi Kotlin Team, is there any possibility to use Maven plugin compiler to compile KotlinJS? I.e. avoiding Gradle/NPM?... ? We have legacy multi module Maven projects that teams won't be migrating to Gradle just because of a single KotlinJS module. Rather then invoking Gradle build from a Maven submodule, we would appreciate direct Maven support. Does a mention "Switched the Maven plugin to use Build Tools API since the Kotlin 2.2.0 release. This enables Kotlin Daemon support in the Kotlin 2.2.20 release" on a https://youtrack.jetbrains.com/issue/KT-76255 means that this will be possible in future? Thanks
@jean79 We are not supporting the KMP or JS part of KMP for the Kotlin Maven plugin. And it should not be possible to do it (unless in very hacky way) already for a long time.
In general, we are aiming to add JS support first in the Build Tools API:
- KT-78204 BTA: implement basic Kotlin/JS compilation support
- KT-78205 BTA: implement basic Kotlin/JS binaries linking support
If we will support KMP in the Kotlin Maven plugin in the future currently is an open question.
@Nyayurin no plans right now - we are focusing on supporting the official Kotlin compiler in the API.