Hassan Syed | f6e3010 | 2018-07-12 16:29:48 +0100 | [diff] [blame] | 1 | # Copyright 2018 The Bazel Authors. All rights reserved. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | package(default_visibility = ["//visibility:public"]) |
| 15 | |
| 16 | # Kotlin home filegroup containing everything that is needed. |
| 17 | filegroup( |
| 18 | name = "home", |
| 19 | srcs = glob(["**"]), |
| 20 | ) |
| 21 | |
| 22 | # Kotlin dependencies that are internal to this repo and are meant to be loaded at runtime. |
| 23 | [ |
| 24 | java_import( |
| 25 | name = "%s" % art, |
| 26 | jars = ["lib/%s.jar" % art], |
| 27 | neverlink = 1, |
| 28 | ) |
| 29 | for art in [ |
| 30 | "kotlin-annotation-processing", |
| 31 | "kotlin-annotation-processing-runtime", |
| 32 | "kotlin-compiler", |
| 33 | ] |
| 34 | ] |
| 35 | |
| 36 | # Kotlin dependencies that are internal to this repo and may be linked. |
| 37 | [ |
| 38 | java_import( |
| 39 | name = "%s" % art, |
| 40 | jars = ["lib/%s.jar" % art], |
| 41 | ) |
| 42 | for art in [ |
| 43 | "kotlin-preloader", |
| 44 | ] |
| 45 | ] |
| 46 | |
hsyed | 234b4ea | 2018-07-14 18:23:29 +0100 | [diff] [blame] | 47 | # Kotlin annotations jar. Contains annotations like NotNull. |
| 48 | java_import( |
| 49 | name = "annotations", |
| 50 | jars = ["lib/annotations-13.0.jar"], |
| 51 | ) |
| 52 | |
Hassan Syed | f6e3010 | 2018-07-12 16:29:48 +0100 | [diff] [blame] | 53 | load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_import") |
| 54 | |
| 55 | # The Kotlin standard libraries. These should be setup in a Toolchain. |
| 56 | [ |
| 57 | kt_jvm_import( |
| 58 | name = "kotlin-%s" % art, |
| 59 | jars = ["lib/kotlin-%s.jar" % art], |
| 60 | srcjar = "lib/kotlin-%s-sources.jar" % art, |
| 61 | visibility = ["//visibility:public"], |
| 62 | ) |
| 63 | for art in [ |
| 64 | "runtime", |
| 65 | "stdlib", |
| 66 | "stdlib-jdk7", |
| 67 | "stdlib-jdk8", |
| 68 | "reflect", |
| 69 | "test", |
| 70 | "script-runtime", |
| 71 | ] |
| 72 | ] |