Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support explicit API mode #576

Merged
merged 1 commit into from
Aug 30, 2021

Conversation

Bencodes
Copy link
Collaborator

@Bencodes Bencodes commented Aug 25, 2021

Support for explicit API mode which was added in Kotlin 1.4.x.

https://github.com/Kotlin/KEEP/blob/master/proposals/explicit-api-mode.md

Example usage:

# Custom kotlinc options that can be provided at the target level 
# to override what is being set globally by `define_kt_toolchain`
kt_kotlinc_options(
    name = "kt_kotlinc_library_options",
    # ...
    x_explicit_api_mode = "strict",
)

kt_jvm_library(
    name = "foo_library",
    # ...
    kotlinc_opts = ":kt_kotlinc_library_options",
    srcs = glob(["*.kt"]),
    deps = [
        # ...
    ],
)

@jeffzoch
Copy link
Contributor

@Bencodes is there anyway to only enable this on certain targets?

@Kernald
Copy link
Contributor

Kernald commented Aug 26, 2021

Agreed, this option would make more sense on a per-target basis.

@Bencodes
Copy link
Collaborator Author

Bencodes commented Aug 26, 2021

This can be configured at the target level using kotlinc_opts.

@Bencodes
Copy link
Collaborator Author

Added an example to the description

@restingbull restingbull merged commit 1db3bb4 into bazelbuild:master Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants