-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docs for
experimental_use_abi_jars
- Loading branch information
1 parent
9e36fca
commit 8003ee0
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
[![Build Status](https://badge.buildkite.com/a8860e94a7378491ce8f50480e3605b49eb2558cfa851bbf9b.svg)](https://buildkite.com/bazel/kotlin-postsubmit) | ||
|
||
# Compilation Avoidance | ||
|
||
# ABI support | ||
|
||
**rules_kotlin** now supports compilation avoidance through the use of ABI jars (also known as | ||
interface or header jars) for classpath dependencies. This can have significant performance wins for | ||
non-ABI affecting changes since down stream recompilation can be avoided in such cases. | ||
|
||
This feature can be enabled through the `experimental_use_abi_jars` flag in the tool chain as | ||
follows | ||
|
||
```python | ||
load("//kotlin:kotlin.bzl", "define_kt_toolchain") | ||
|
||
|
||
define_kt_toolchain( | ||
name = "kotlin_toolchain", | ||
experimental_use_abi_jars = True, | ||
) | ||
``` | ||
|
||
This feature is implemented using the Jetbrains Kotlin JvmABI compiler plugin for generating headers | ||
for Kotlin code. Unfortunately there are some known bugs with this plugin that affect less than 1% | ||
of targets. | ||
* https://youtrack.jetbrains.com/issue/KT-40340 | ||
* https://youtrack.jetbrains.com/issue/KT-40133 | ||
|
||
If you encounter such bugs, ABI generation can be disabled by setting the following tag | ||
|
||
```python | ||
load("//kotlin:kotlin.bzl", "kt_jvm_library") | ||
|
||
kt_jvm_library( | ||
name = "framework", | ||
tags = ["kt_abi_plugin_incompatible"], | ||
) | ||
``` |