Skip to content

Commit 6e8b04f

Browse files
authored
Fix release default options visibility (#441)
* Update README.md for 1.5.0-alpha-2 release. * Fix release option default visibility * Move default options to kt_configure_toolchains for a single source of truth Limit kt_configure_toolchains to kotlin/internal as it defines the toolchain_type which is a well known target. Configuring them elsewhere could have unexpected issues. Move the kt_configure_toolchains out of jvm. (I'm pretty sure I did that, and it's just wrong.)
1 parent 5884879 commit 6e8b04f

File tree

6 files changed

+24
-30
lines changed

6 files changed

+24
-30
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@
33
# Bazel Kotlin Rules
44

55
Current release: ***`legacy-1.3.0`***<br />
6-
Release candidate: ***`1.5.0-alpha-1`***<br />
6+
Release candidate: ***`1.5.0-alpha-2`***<br />
77
Main branch: `master`
88

99
# News!
10+
* <b>Dec 30, 2020.</b> Released version [1.5.0-alpha-2](https://github.com/bazelbuild/rules_kotlin/releases/tag/v1.5.0-alpha-2). Includes:
11+
- Expanded kotlinc options
12+
- New optimized compilation path (using JavaBuilder) `--define=experimental_use_abi_jars=1`.
13+
- *Caveat*: compilation may fail due to https://youtrack.jetbrains.com/issue/KT-40133, https://youtrack.jetbrains.com/issue/KT-40340, https://youtrack.jetbrains.com/issue/KT-41381
14+
- *Workaround*: add `tags=['kt_abi_plugin_incompatible']`
1015
* <b>Dec 3, 2020.</b> Released version [1.5.0-alpha-1](https://github.com/bazelbuild/rules_kotlin/releases/tag/v1.5.0-alpha-1). Includes:
1116
- Kotlin 1.4 support
1217
- Lots of different fixes, especially to kotlinc plugins, `exported_compiler_plugins`, etc.

examples/android/WORKSPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ load("@io_bazel_rules_kotlin//kotlin:dependencies.bzl", "kt_download_local_dev_d
6464

6565
kt_download_local_dev_dependencies()
6666

67-
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories", "kt_register_toolchains")
67+
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories")
6868

6969
kotlin_repositories()
7070

kotlin/internal/BUILD

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,10 @@
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-
load("//kotlin/internal:opts.bzl", "kt_javac_options", "kt_kotlinc_options")
1514
load("//kotlin/internal:toolchains.bzl", "kt_configure_toolchains")
1615
load("//kotlin/internal/utils:packager.bzl", "release_archive")
1716
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
1817

19-
kt_kotlinc_options(
20-
name = "default_kotlinc_options",
21-
# Used internally as the rule default. This should be
22-
# considered an implementation detail and not used externally
23-
visibility = ["//visibility:public"],
24-
)
25-
26-
kt_javac_options(
27-
name = "default_javac_options",
28-
# Used internally as the rule default. This should be
29-
# considered an implementation detail and not used externally
30-
visibility = ["//visibility:public"],
31-
)
32-
3318
# Configures the toolchains
3419
kt_configure_toolchains()
3520

kotlin/internal/BUILD.release.bazel

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
load("//kotlin/internal:opts.bzl", "kt_javac_options", "kt_kotlinc_options")
1615
load("//kotlin/internal:toolchains.bzl", "kt_configure_toolchains")
1716

1817
kt_configure_toolchains()
19-
20-
kt_kotlinc_options(
21-
name = "default_kotlinc_options",
22-
)
23-
24-
kt_javac_options(
25-
name = "default_javac_options",
26-
)

kotlin/internal/jvm/BUILD.release.bazel

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +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-
load("//kotlin/internal:toolchains.bzl", "kt_configure_toolchains")
15-
16-
kt_configure_toolchains()
17-
1814
exports_files(["jetbrains-deshade.jarjar"])

kotlin/internal/toolchains.bzl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ load(
1515
"//kotlin/internal:opts.bzl",
1616
"JavacOptions",
1717
"KotlincOptions",
18+
"kt_javac_options",
19+
"kt_kotlinc_options",
1820
)
1921
load(
2022
"//kotlin/internal:defs.bzl",
@@ -262,7 +264,22 @@ def define_kt_toolchain(
262264
def kt_configure_toolchains():
263265
"""
264266
Defines the toolchain_type and default toolchain for kotlin compilation.
267+
268+
Must be called in kotlin/internal/BUILD.bazel
265269
"""
270+
if native.package_name() != "kotlin/internal":
271+
fail("kt_configure_toolchains must be called in kotlin/internal not %s" % native.package_name())
272+
273+
kt_kotlinc_options(
274+
name = "default_kotlinc_options",
275+
visibility = ["//visibility:public"],
276+
)
277+
278+
kt_javac_options(
279+
name = "default_javac_options",
280+
visibility = ["//visibility:public"],
281+
)
282+
266283
native.config_setting(
267284
name = "experimental_use_abi_jars",
268285
values = {"define": "experimental_use_abi_jars=1"},

0 commit comments

Comments
 (0)