Skip to content

Commit

Permalink
feat: allow multiple lockfiles for WORKSPACE users as well (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle committed Mar 17, 2024
1 parent 23ec04e commit 81842f6
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions multitool/private/multitool.bzl
Expand Up @@ -232,7 +232,20 @@ def hub(name, lockfiles):
)
_multitool_hub(name = name, lockfiles = lockfiles)

def multitool(name, lockfile):
"(non-bzlmod) Create a multitool hub and register its toolchains."
hub(name, [lockfile])
def multitool(name, lockfile = None, lockfiles = None):
"""(non-bzlmod) Create a multitool hub and register its toolchains.
Args:
name: resulting "hub" repo name to load tools from
lockfile: a label for a lockfile, see /lockfile.schema.json
lockfiles: a list of labels of multiple lockfiles
"""
if lockfile and lockfiles:
fail("Only one of lockfile and lockfiles may be set")
if not lockfile and not lockfiles:
fail("Exactly one of lockfile and lockfiles must be set")
if lockfile:
hub(name, [lockfile])
else:
hub(name, lockfiles)
native.register_toolchains("@{name}//toolchains:all".format(name = name))

0 comments on commit 81842f6

Please sign in to comment.