commit | 97b1d494e3cd3c2f9f9468608a46f5b74d40c169 | [log] [tgz] |
---|---|---|
author | hsyed <h.a.syed@gmail.com> | Tue Aug 07 03:15:32 2018 +0100 |
committer | Hassan Syed <h.a.syed@gmail.com> | Wed Aug 08 20:40:47 2018 +0100 |
tree | c1f47cc2d5deadb374a5a841185bcea38bbcc7e6 | |
parent | d97fc6a14f553b125636700da1c8883229913922 [diff] |
various tidy ups and reorganizations (for a task-model and from the android and js branches)
>=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
Consult the generated documentation. This section just contains a quick overview.
In the project's WORKSPACE
, declare the external repository and initialize the toolchains, like this:
kotlin_release_version="1.2.30" 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(kotlin_release_version=kotlin_release_version) kt_register_toolchains()
If you omit kotlin_release_version
and just call kotlin_repositories()
with no arguments, you'll get the current kotlin compiler version (at least as known to the rules_kotlin project).
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.