| |
| |
| <!-- |
| Documentation generated by Skydoc |
| --> |
| <!DOCTYPE html> |
| <html> |
| <head> |
| <meta charset="utf-8"> |
| <meta name="viewport" content="width=device-width initial-scale=1" /> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| |
| <title>Kotlin Toolchains</title> |
| |
| <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,600,700" type="text/css"> |
| <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> |
| <link rel="stylesheet" href="https://code.getmdl.io/1.1.1/material.green-light_blue.min.css"> |
| <script defer src="https://code.getmdl.io/1.1.1/material.min.js"></script> |
| <link rel="stylesheet" href="https://bazelbuild.github.io/rules_kotlin/main.css"> |
| </head> |
| <body> |
| <div class="mdl-layout mdl-js-layout mdl-layout--fixed-drawer |
| mdl-layout--fixed-header"> |
| <header class="mdl-layout__header"> |
| <div class="mdl-layout__header-row"> |
| <span class="mdl-layout-title">Kotlin Toolchains</span> |
| </div> |
| </header> |
| <div class="mdl-layout__drawer"> |
| <span class="mdl-layout-title">Bazel</span> |
| <nav class="drawer-nav"> |
| <ul class="drawer-nav"> |
| |
| <li><a href="https://bazelbuild.github.io/rules_kotlin/index.html">Overview</a></li> |
| <li> |
| <a href="https://bazelbuild.github.io/rules_kotlin/kotlin/kotlin.html">Kotlin Rules</a> |
| <ul> |
| <li><a href="https://bazelbuild.github.io/rules_kotlin/kotlin/kotlin.html#overview">Overview</a></li> |
| <li> |
| <a href="https://bazelbuild.github.io/rules_kotlin/kotlin/kotlin.html#kt_jvm_binary"> |
| kt_jvm_binary |
| </a> |
| </li> |
| <li> |
| <a href="https://bazelbuild.github.io/rules_kotlin/kotlin/kotlin.html#kt_jvm_import"> |
| kt_jvm_import |
| </a> |
| </li> |
| <li> |
| <a href="https://bazelbuild.github.io/rules_kotlin/kotlin/kotlin.html#kt_jvm_library"> |
| kt_jvm_library |
| </a> |
| </li> |
| <li> |
| <a href="https://bazelbuild.github.io/rules_kotlin/kotlin/kotlin.html#kt_jvm_test"> |
| kt_jvm_test |
| </a> |
| </li> |
| </ul> |
| </li> |
| <li> |
| <a href="https://bazelbuild.github.io/rules_kotlin/kotlin/toolchains.html">Kotlin Toolchains</a> |
| <ul> |
| <li><a href="https://bazelbuild.github.io/rules_kotlin/kotlin/toolchains.html#overview">Overview</a></li> |
| <li> |
| <a href="https://bazelbuild.github.io/rules_kotlin/kotlin/toolchains.html#kt_jvm_toolchain"> |
| kt_jvm_toolchain |
| </a> |
| </li> |
| </ul> |
| </li> |
| |
| </ul> |
| </nav> |
| </div> |
| |
| <main class="mdl-layout__content"> |
| <div class="page-content"> |
| <h1>Kotlin Toolchains</h1> |
| |
| <nav class="toc"> |
| <h2><a href="#overview">Overview</a></h2> |
| <h2>Rules</h2> |
| <ul> |
| <li><a href="#kt_jvm_toolchain">kt_jvm_toolchain</a></li> |
| </ul> |
| <h2>Macros</h2> |
| <ul> |
| <li><a href="#define_kt_jvm_toolchain">define_kt_jvm_toolchain</a></li> |
| <li><a href="#kt_register_jvm_toolchain">kt_register_jvm_toolchain</a></li> |
| </ul> |
| </nav> |
| <hr> |
| <h2 id="overview">Overview</h2> |
| <p>This file contains macros for defining and registering specific toolchains.</p> |
| <h3>Examples</h3> |
| <p>To override a tool chain use the appropriate macro in a <code>BUILD</code> file to declare the toolchain:</p> |
| <pre><code class="lang-bzl">load("@io_bazel_rules_kotlin//kotlin:toolchains.bzl", "define_kt_jvm_toolchain") |
| |
| define_kt_jvm_toolchain( |
| name= "custom_toolchain", |
| api_version = "1.1", |
| language_version = "1.1", |
| ) |
| </code></pre> |
| <p>and then register it in the <code>WORKSPACE</code>:</p> |
| <pre><code class="lang-bzl">register_toolchains("//:custom_toolchain") |
| </code></pre> |
| |
| <hr> |
| |
| <h2 id="define_kt_jvm_toolchain">define_kt_jvm_toolchain</h2> |
| |
| <pre>define_kt_jvm_toolchain(<a href="#define_kt_jvm_toolchain.name">name</a>, <a href="#define_kt_jvm_toolchain.language_version">language_version</a>, <a href="#define_kt_jvm_toolchain.api_version">api_version</a>, <a href="#define_kt_jvm_toolchain.jvm_target">jvm_target</a>, <a href="#define_kt_jvm_toolchain.coroutines">coroutines</a>)</pre> |
| |
| <p>Define a Kotlin JVM Toolchain, the name is used in the <code>toolchain</code> rule so can be used to register the toolchain in the WORKSPACE file.</p> |
| |
| |
| <h3 id="define_kt_jvm_toolchain_args">Attributes</h3> |
| |
| <table class="params-table"> |
| <colgroup> |
| <col class="col-param" /> |
| <col class="col-description" /> |
| </colgroup> |
| <tbody> |
| <tr id="define_kt_jvm_toolchain.name"> |
| <td><code>name</code></td> |
| <td> |
| <p><code><a href="https://bazel.build/docs/build-ref.html#name">Name</a>; Required</code></p> |
| <p>A unique name for this rule.</p> |
| </td> |
| </tr> |
| <tr id="define_kt_jvm_toolchain.language_version"> |
| <td><code>language_version</code></td> |
| <td> |
| <p><code>Unknown; Optional</code></p> |
| |
| </td> |
| </tr> |
| <tr id="define_kt_jvm_toolchain.api_version"> |
| <td><code>api_version</code></td> |
| <td> |
| <p><code>Unknown; Optional</code></p> |
| |
| </td> |
| </tr> |
| <tr id="define_kt_jvm_toolchain.jvm_target"> |
| <td><code>jvm_target</code></td> |
| <td> |
| <p><code>Unknown; Optional</code></p> |
| |
| </td> |
| </tr> |
| <tr id="define_kt_jvm_toolchain.coroutines"> |
| <td><code>coroutines</code></td> |
| <td> |
| <p><code>Unknown; Optional</code></p> |
| |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| <hr> |
| |
| <h2 id="kt_register_jvm_toolchain">kt_register_jvm_toolchain</h2> |
| |
| <pre>kt_register_jvm_toolchain()</pre> |
| |
| <p>Register the default JVM toolchain.</p> |
| |
| |
| <hr> |
| |
| <h2 id="kt_jvm_toolchain">kt_jvm_toolchain</h2> |
| |
| <pre>kt_jvm_toolchain(<a href="#kt_jvm_toolchain.name">name</a>, <a href="#kt_jvm_toolchain.api_version">api_version</a>, <a href="#kt_jvm_toolchain.coroutines">coroutines</a>, <a href="#kt_jvm_toolchain.jvm_target">jvm_target</a>, <a href="#kt_jvm_toolchain.language_version">language_version</a>)</pre> |
| |
| <p>The kotlin jvm toolchain</p> |
| |
| |
| <h3 id="kt_jvm_toolchain_args">Attributes</h3> |
| |
| <table class="params-table"> |
| <colgroup> |
| <col class="col-param" /> |
| <col class="col-description" /> |
| </colgroup> |
| <tbody> |
| <tr id="kt_jvm_toolchain.name"> |
| <td><code>name</code></td> |
| <td> |
| <p><code><a href="https://bazel.build/docs/build-ref.html#name">Name</a>; Required</code></p> |
| <p>A unique name for this rule.</p> |
| </td> |
| </tr> |
| <tr id="kt_jvm_toolchain.api_version"> |
| <td><code>api_version</code></td> |
| <td> |
| <p><code>String; Optional; Default is '1.2'</code></p> |
| <p>the -api_version flag <a href="https://kotlinlang.org/docs/reference/compatibility.html">see</a>.</p> |
| </td> |
| </tr> |
| <tr id="kt_jvm_toolchain.coroutines"> |
| <td><code>coroutines</code></td> |
| <td> |
| <p><code>String; Optional; Default is 'enable'</code></p> |
| <p>the -Xcoroutines flag, enabled by default as it's considered production ready 1.2.0 onward.</p> |
| </td> |
| </tr> |
| <tr id="kt_jvm_toolchain.jvm_target"> |
| <td><code>jvm_target</code></td> |
| <td> |
| <p><code>String; Optional; Default is '1.8'</code></p> |
| <p>the -jvm_target flag.</p> |
| </td> |
| </tr> |
| <tr id="kt_jvm_toolchain.language_version"> |
| <td><code>language_version</code></td> |
| <td> |
| <p><code>String; Optional; Default is '1.2'</code></p> |
| <p>the -languag_version flag <a href="https://kotlinlang.org/docs/reference/compatibility.html">see</a>.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| |
| |
| </div> |
| |
| <footer class="mdl-mini-footer"> |
| <div class="mdl-mini-footer__left-section"> |
| <div class="mdl-logo">Bazel</div> |
| <ul class="mdl-mini-footer__link-list"> |
| <li><a href="https://bazel.build">Home</a></li> |
| <li><a href="https://github.com/bazelbuild">GitHub</a></li> |
| </ul> |
| </div> |
| </footer> |
| </main> |
| </div> |
| </body> |
| </html> |