-
Notifications
You must be signed in to change notification settings - Fork 211
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
Add support for Bzlmod #1006
Add support for Bzlmod #1006
Conversation
.bazelversion
Outdated
@@ -1 +1 @@ | |||
6.1.1 | |||
7.0.0-pre.20230724.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I don't think we actually need to be using the latest rolling release here.
@Bencodes This means after merging this PR I can set up a Kotlin project with Bzlmod like?
Currently, I finding a way to work around with |
@dkthezero yes it would. |
The bulk of the pre-work has been pulled out into this PR so that we can review it independently. |
a23dd05
to
02ad06e
Compare
MODULE.bazel
Outdated
@@ -0,0 +1,71 @@ | |||
module( | |||
name = "io_bazel_rules_kotlin", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you call this just "rules_kotlin"? This is what gets exported to BCR: https://github.com/bazelbuild/bazel-central-registry/tree/main/modules
So "io_bazel_" prefix would be a precedent.
"repo_name = " attribute controls how this can be used, that is what you need in the load
statements and as dependencies.
examples/trivial/MODULE.bazel
Outdated
) | ||
|
||
bazel_dep(name = "rules_java", version = "6.4.0") | ||
bazel_dep(name = "io_bazel_rules_kotlin") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be rules_kotlin
with optional repo_name="io_bazel_rules_kotlin
".
Thanks for your effort! |
@@ -1,3 +1,5 @@ | |||
common --enable_bzlmod=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enabling Bzlmod by default for rules_kotlin
bazel_dep(name = "bazel_skylib", version = "1.3.0") | ||
bazel_dep(name = "rules_java", version = "6.4.0") | ||
bazel_dep(name = "rules_python", version = "0.24.0") | ||
bazel_dep(name = "rules_cc", version = "0.0.8") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rules_cc
is needed for the remote execution configs.
) | ||
|
||
def _extra_repositories(): | ||
# TODO(bencodes) This really needs to be a development dependency |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a TODO here to move this out into a development dependency. I'll do another pass once this is merged to get these dependencies into better shape so that we can do a production-ready release of rules_kotlin.
Adding support for Bzlmod now that Android is unblocked. What's included in this PR:
examples/trivial
example to use Bzlmod with abazel_dep(name = "rules_java", version = "...")
with alocal_path_override
. It's worth noting that this does not yet exercise the release binary that we distribute for releases.rules_kotlin
(excluding the examples)This PR is largely based on the work that @comius did in #902.
#660