Skip to content

Commit 19658cd

Browse files
Corbin Smithcgruber
authored andcommitted
Fix release packaging to exclude references to non-release targets.
Added a query check to release.sh to ensure that the release graph is correct.
1 parent 0517738 commit 19658cd

File tree

18 files changed

+153
-23
lines changed

18 files changed

+153
-23
lines changed

WORKSPACE

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,24 @@
1313
# limitations under the License.
1414
workspace(name = "io_bazel_rules_kotlin")
1515

16-
1716
load("//kotlin:dependencies.bzl", "kt_download_local_dev_dependencies")
17+
1818
kt_download_local_dev_dependencies()
1919

2020
load("//kotlin:kotlin.bzl", "kotlin_repositories", "kt_register_toolchains")
21+
2122
kotlin_repositories()
23+
2224
kt_register_toolchains()
2325

2426
# Creates toolchain configuration for remote execution with BuildKite CI
2527
# for rbe_ubuntu1604
2628
load("@bazel_toolchains//rules:rbe_repo.bzl", "rbe_autoconfig")
29+
2730
rbe_autoconfig(
2831
name = "buildkite_config",
2932
)
3033

3134
android_sdk_repository(name = "androidsdk")
35+
3236
android_ndk_repository(name = "androidndk")

WORKSPACE.release.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
workspace(name = "io_bazel_rules_kotlin")
14+
workspace(name = "io_bazel_rules_kotlin")

examples/android/WORKSPACE

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ local_repository(
5252
path = "../..",
5353
)
5454

55-
5655
load("@io_bazel_rules_kotlin//kotlin:dependencies.bzl", "kt_download_local_dev_dependencies")
56+
5757
kt_download_local_dev_dependencies()
5858

5959
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories", "kt_register_toolchains")
@@ -62,7 +62,6 @@ kotlin_repositories()
6262

6363
kt_register_toolchains()
6464

65-
6665
# Skylib, for build_test, so don't bother initializing the unit test infrastructure.
6766
http_archive(
6867
name = "bazel_skylib",
@@ -74,6 +73,6 @@ http_archive(
7473

7574
http_archive(
7675
name = "rules_pkg",
77-
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz",
7876
sha256 = "4ba8f4ab0ff85f2484287ab06c0d871dcb31cc54d439457d28fd4ae14b18450a",
79-
)
77+
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz",
78+
)

examples/node/WORKSPACE

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@ workspace(name = "kotlin_node_examples")
33
# Directly load the kotlin rules from the parent repo.
44
local_repository(
55
name = "io_bazel_rules_kotlin",
6-
path = "../.."
6+
path = "../..",
77
)
88

99
load("@io_bazel_rules_kotlin//kotlin:dependencies.bzl", "kt_download_local_dev_dependencies")
10+
1011
kt_download_local_dev_dependencies()
1112

1213
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories", "kt_register_toolchains")
14+
1315
kotlin_repositories()
16+
1417
kt_register_toolchains()
1518

1619
# Node example dependencies
@@ -40,4 +43,4 @@ yarn_install(
4043
name = "node_ws",
4144
package_json = "//:package.json",
4245
yarn_lock = "//:yarn.lock",
43-
)
46+
)

examples/trivial/WORKSPACE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ local_repository(
66
)
77

88
load("@io_bazel_rules_kotlin//kotlin:dependencies.bzl", "kt_download_local_dev_dependencies")
9+
910
kt_download_local_dev_dependencies()
1011

1112
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories", "kt_register_toolchains")
@@ -48,6 +49,6 @@ maven_install(
4849

4950
http_archive(
5051
name = "rules_pkg",
51-
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz",
5252
sha256 = "4ba8f4ab0ff85f2484287ab06c0d871dcb31cc54d439457d28fd4ae14b18450a",
53+
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz",
5354
)

kotlin/BUILD

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
1717

1818
release_archive(
1919
name = "pkg",
20-
srcs = glob(["*.*"]) + ["BUILD"],
20+
srcs = glob(["*.bzl"]),
21+
src_map = {
22+
"BUILD.release.bazel": "BUILD.bazel",
23+
},
2124
deps = [
2225
"//kotlin/internal:pkg",
2326
],
@@ -37,6 +40,18 @@ stardoc(
3740
out = "kotlin.md",
3841
input = "rules.bzl",
3942
rule_template = "//kotlin:doc-templates/rule.vm",
43+
symbol_names = [
44+
"define_kt_toolchain",
45+
"kt_js_library",
46+
"kt_js_import",
47+
"kt_register_toolchains",
48+
"kt_jvm_binary",
49+
"kt_jvm_import",
50+
"kt_jvm_library",
51+
"kt_jvm_test",
52+
"kt_android_library",
53+
"kt_compiler_plugin",
54+
],
4055
deps = [
4156
"kotlin",
4257
],

kotlin/BUILD.release.bazel

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright 2020 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.

kotlin/internal/defs.bzl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
# The Kotlin Toolchain type.
1616
TOOLCHAIN_TYPE = "@io_bazel_rules_kotlin//kotlin/internal:kt_toolchain_type"
1717

18+
# Java toolchains
19+
JAVA_TOOLCHAIN_TYPE = "@bazel_tools//tools/jdk:toolchain_type"
20+
JAVA_RUNTIME_TOOLCHAIN_TYPE = "@bazel_tools//tools/jdk:runtime_toolchain_type"
21+
1822
# The name of the Kotlin compiler workspace.
1923
KT_COMPILER_REPO = "com_github_jetbrains_kotlin"
2024

kotlin/internal/jvm/BUILD

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,17 @@ load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
1717

1818
release_archive(
1919
name = "pkg",
20-
srcs = glob(["*.bzl"]) + ["BUILD"],
20+
srcs = glob(["*.bzl"]),
21+
src_map = {
22+
"BUILD.release.bazel": "BUILD.bazel",
23+
},
2124
)
2225

2326
bzl_library(
2427
name = "jvm",
2528
srcs = glob(["*.bzl"]),
2629
visibility = ["//kotlin:__subpackages__"],
30+
deps = [
31+
"//third_party:java_tools_bzl",
32+
],
2733
)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2020 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+
15+
load("//kotlin/internal:toolchains.bzl", "kt_configure_toolchains")
16+
17+
kt_configure_toolchains()

0 commit comments

Comments
 (0)