From bd7f9bea23d295ea8f68a6d5b78320f731a6179a Mon Sep 17 00:00:00 2001 From: kon72 Date: Mon, 20 May 2024 15:47:10 +0900 Subject: [PATCH] Remove extensions.bzl as it is unused anymore --- MODULE.bazel | 7 ------- rollup/extensions.bzl | 37 ------------------------------------- 2 files changed, 44 deletions(-) delete mode 100644 rollup/extensions.bzl diff --git a/MODULE.bazel b/MODULE.bazel index 9c3e82e..7b5e833 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -17,13 +17,6 @@ bazel_dep(name = "aspect_rules_js", version = "1.34.0") bazel_dep(name = "rules_nodejs", version = "5.5.3") bazel_dep(name = "platforms", version = "0.0.5") -rollup = use_extension("@aspect_rules_rollup//rollup:extensions.bzl", "rollup") -rollup.toolchain( - name = "rollup", - rollup_version = "v2.70.2", -) -use_repo(rollup, "rollup") - ####### Dev dependencies ######## bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True) diff --git a/rollup/extensions.bzl b/rollup/extensions.bzl deleted file mode 100644 index a681e35..0000000 --- a/rollup/extensions.bzl +++ /dev/null @@ -1,37 +0,0 @@ -"extensions for bzlmod" - -load(":repositories.bzl", "rollup_repositories") - -rollup_toolchain = tag_class(attrs = { - "name": attr.string(doc = "Base name for generated repositories"), - "rollup_version": attr.string(doc = "Explicit version of rollup."), - # TODO: support this variant - # "rollup_version_from": attr.string(doc = "Location of package.json which may have a version for @rollup/core."), -}) - -def _toolchain_extension(module_ctx): - registrations = {} - for mod in module_ctx.modules: - for toolchain in mod.tags.toolchain: - if toolchain.name in registrations.keys(): - if toolchain.rollup_version == registrations[toolchain.name]: - # No problem to register a matching toolchain twice - continue - fail("Multiple conflicting toolchains declared for name {} ({} and {}".format( - toolchain.name, - toolchain.rollup_version, - registrations[toolchain.name], - )) - else: - registrations[toolchain.name] = toolchain.rollup_version - for name, rollup_version in registrations.items(): - rollup_repositories( - name = name, - rollup_version = rollup_version, - register = False, - ) - -rollup = module_extension( - implementation = _toolchain_extension, - tag_classes = {"toolchain": rollup_toolchain}, -)