commit | cab5eaffc2012dfe46260c03d6419c0d2fa10be0 | [log] [tgz] |
---|---|---|
author | Laurent Le Brun <laurentlb@gmail.com> | Wed Nov 28 15:57:47 2018 +0100 |
committer | GitHub <noreply@github.com> | Wed Nov 28 15:57:47 2018 +0100 |
tree | 95113985423b4d28277cad460a60acf79a114aa9 | |
parent | 1b64e494ade5a3c80ca209f2945ca24af620ddd3 [diff] |
Cleanup for Bazel incompatible changes (#169) - Avoid depset concatenation and implicit iteration - Avoid '+' operator on dictionaries - Migrate to the Args methods - Separate tools from other inputs Tested: bazel0.20 test :all --all_incompatible_changes --incompatible_disallow_legacy_javainfo=false
examples/node
.kotlin/internal/jvm/android.bzl
.>=0.14
. JDK9 host issues were fixed as well some other deprecations. I recommend skipping 0.15.0
if you are on a Mac.kt_jvm_test
which allows the test to access internal members of the module under test.kotlin_
to kt_jvm_
.These rules were initially forked from pubref/rules_kotlin. Key changes:
kt_jvm_binary
, kt_jvm_library
and kt_jvm_test
.java_dep
and dep
.data
resource_jars
runtime_deps
resources
resources_strip_prefix
exports
This section just contains a quick overview. Consult the generated documentation. Note: Skydoc documentation is no longer being generated. Comprehensive documentation will have to wait till the new documentation generation tool is ready. A contribution to port the documentation to the RST format like rules_go
has would be very welcome !
In the project's WORKSPACE
, declare the external repository and initialize the toolchains, like this:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") rules_kotlin_version = "67f4a6050584730ebae7f8a40435a209f8e0b48e" http_archive( name = "io_bazel_rules_kotlin", urls = ["https://github.com/bazelbuild/rules_kotlin/archive/%s.zip" % rules_kotlin_version], type = "zip", strip_prefix = "rules_kotlin-%s" % rules_kotlin_version ) load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories", "kt_register_toolchains") kotlin_repositories() kt_register_toolchains()
In your project's BUILD
files, load the kotlin rules and use them like so:
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_library") kt_jvm_library( name = "package_name", srcs = glob(["*.kt"]), deps = [ "//path/to/dependency", ], )
This project is licensed under the Apache 2.0 license, as are all contributions
See the CONTRIBUTING doc for information about how to contribute to this project.