-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Manually register the Twirl compiler toolchain"
This reverts commit 1379dc6.
- Loading branch information
Jaden Peterson
committed
Dec 6, 2024
1 parent
cb4f57c
commit 9fcd964
Showing
6 changed files
with
49 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
workspace(name = "rules_twirl") | ||
|
||
# Twirl compiler | ||
load("//twirl-toolchain:register-toolchains.bzl", "twirl_register_toolchains") | ||
|
||
twirl_register_toolchains(default_toolchain_name = "twirl-3") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
def _toolchain_configuration_repository_impl(repository_ctx): | ||
repository_ctx.file( | ||
"BUILD.bazel", | ||
"""\ | ||
load("@bazel_skylib//rules:common_settings.bzl", "string_setting") | ||
string_setting( | ||
name = "twirl-toolchain", | ||
build_setting_default = "{}", | ||
visibility = ["//visibility:public"], | ||
) | ||
string_setting( | ||
name = "original-twirl-toolchain", | ||
build_setting_default = "", | ||
visibility = ["//visibility:public"], | ||
) | ||
""".format(repository_ctx.attr.default_toolchain_name), | ||
) | ||
|
||
_toolchain_configuration_repository = repository_rule( | ||
attrs = { | ||
"default_toolchain_name": attr.string(mandatory = True), | ||
}, | ||
doc = "Defines build settings used by the Twirl toolchains to use. This is done in a separate repository so we can provide the default dynamically.", | ||
implementation = _toolchain_configuration_repository_impl, | ||
) | ||
|
||
def twirl_register_toolchains( | ||
default_toolchain_name, | ||
toolchains = [ | ||
"//twirl-toolchain:twirl-3", | ||
"//twirl-toolchain:twirl-2-13", | ||
]): | ||
_toolchain_configuration_repository( | ||
name = "rules_twirl_toolchain", | ||
default_toolchain_name = default_toolchain_name, | ||
) | ||
|
||
native.register_toolchains(*toolchains) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters