commit | a1e819ed5a61e964a9faf40aa1b9218b02d574a7 | [log] [tgz] |
---|---|---|
author | Hassan Syed <h.a.syed@gmail.com> | Fri May 11 19:12:23 2018 +0100 |
committer | GitHub <noreply@github.com> | Fri May 11 19:12:23 2018 +0100 |
tree | ec56294d890b5b8224244f76dbf0a4f4640ed854 | |
parent | 0210af610c02eee90beb0e7dc8f00d4f00b86fe5 [diff] | |
parent | 1b274efa2a4d9b6007012b6b86f2073276e4c19e [diff] |
Merge pull request #64 from bazelbuild/log_out_kapt log out kapt errors
kotlin_
to kt_jvm_
.These rules were initially forked from pubref/rules_kotlin. Key changes:
kotlin_binary
, kotlin_library
and kotlin_test
.java_dep
and dep
.data
resource_jars
runtime_deps
resources
resources_strip_prefix
exports
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.