Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor to properly support bzlmod (#9)
- Loading branch information
Showing
36 changed files
with
458 additions
and
240 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
common --enable_bzlmod | ||
common --enable_bzlmod | ||
|
||
common --lockfile_mode=off |
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 |
---|---|---|
@@ -1 +1 @@ | ||
6.4.0 | ||
7.0.0 |
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
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,3 @@ | ||
common --enable_bzlmod | ||
|
||
common --lockfile_mode=off |
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 @@ | ||
7.0.0 |
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,12 @@ | ||
exports_files( | ||
["multitool.lock.json"], | ||
) | ||
|
||
sh_test( | ||
name = "integration_test", | ||
srcs = ["integration_test.sh"], | ||
args = [ | ||
"$(location @multitool//tools/target-determinator)", | ||
], | ||
data = ["@multitool//tools/target-determinator"], | ||
) |
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,18 @@ | ||
"multitool example using target-determinator" | ||
|
||
module( | ||
name = "multitool_examples__target_determinator", | ||
version = "0.0.0", | ||
compatibility_level = 1, | ||
) | ||
|
||
bazel_dep(name = "platforms", version = "0.0.8") | ||
bazel_dep(name = "rules_multitool", version = "0.0.0") | ||
local_path_override( | ||
module_name = "rules_multitool", | ||
path = "../..", | ||
) | ||
|
||
multitool = use_extension("@rules_multitool//multitool:extension.bzl", "multitool") | ||
multitool.hub(lockfile = "//:multitool.lock.json") | ||
use_repo(multitool, "multitool") |
File renamed without changes.
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,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu | ||
|
||
$1 -version |
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,84 @@ | ||
{ | ||
"target-determinator": { | ||
"binaries": [ | ||
{ | ||
"kind": "file", | ||
"url": "https://github.com/bazel-contrib/target-determinator/releases/download/v0.25.0/target-determinator.darwin.amd64", | ||
"sha256": "8c7245603dede429b978e214ca327c3f3d686a1bc712c1298fca0396a0f25f23", | ||
"os": "macos", | ||
"cpu": "x86_64" | ||
}, | ||
{ | ||
"kind": "file", | ||
"url": "https://github.com/bazel-contrib/target-determinator/releases/download/v0.25.0/target-determinator.darwin.arm64", | ||
"sha256": "8f975b471c4a51d32781b757e1ece9700221bfd4c0ea507c18fa382360d1111f", | ||
"os": "macos", | ||
"cpu": "arm64" | ||
}, | ||
{ | ||
"kind": "file", | ||
"url": "https://github.com/bazel-contrib/target-determinator/releases/download/v0.25.0/target-determinator.linux.amd64", | ||
"sha256": "c8a09143e9fe6eccc4b27a6be92c5929e5a78034a8d0b4c43dbed4ee539ec903", | ||
"os": "linux", | ||
"cpu": "x86_64" | ||
} | ||
] | ||
}, | ||
"gh": { | ||
"binaries": [ | ||
{ | ||
"kind": "archive", | ||
"url": "https://github.com/cli/cli/releases/download/v2.44.1/gh_2.44.1_macOS_amd64.zip", | ||
"sha256": "1c545505b5b88feaffeba00b7284ccac3f2002b67461b1246eaec827eb07c31b", | ||
"file": "gh_2.44.1_macOS_amd64/bin/gh", | ||
"os": "macos", | ||
"cpu": "x86_64" | ||
}, | ||
{ | ||
"kind": "archive", | ||
"url": "https://github.com/cli/cli/releases/download/v2.44.1/gh_2.44.1_macOS_amd64.zip", | ||
"sha256": "1c545505b5b88feaffeba00b7284ccac3f2002b67461b1246eaec827eb07c31b", | ||
"file": "gh_2.44.1_macOS_amd64/bin/gh", | ||
"os": "macos", | ||
"cpu": "arm64" | ||
}, | ||
{ | ||
"kind": "archive", | ||
"url": "https://github.com/cli/cli/releases/download/v2.44.1/gh_2.44.1_linux_amd64.tar.gz", | ||
"sha256": "f11eefb646768e3f53e2185f6d3b01b4cb02112c2c60e65a4b5875150287ff97", | ||
"file": "gh_2.44.1_linux_amd64/bin", | ||
"os": "linux", | ||
"cpu": "x86_64" | ||
} | ||
] | ||
}, | ||
"aws": { | ||
"binaries": [ | ||
{ | ||
"kind": "pkg", | ||
"url": "https://awscli.amazonaws.com/AWSCLIV2-2.8.4.pkg", | ||
"sha256": "df0df526521a5b6c38b6954ec08c16453916daacca83582d37582654e9ca05a3", | ||
"file": "aws-cli.pkg/Payload/aws-cli/aws", | ||
"os": "macos", | ||
"cpu": "x86_64" | ||
}, | ||
{ | ||
"kind": "pkg", | ||
"url": "https://awscli.amazonaws.com/AWSCLIV2-2.8.4.pkg", | ||
"sha256": "df0df526521a5b6c38b6954ec08c16453916daacca83582d37582654e9ca05a3", | ||
"file": "aws-cli.pkg/Payload/aws-cli/aws", | ||
"os": "macos", | ||
"cpu": "arm64" | ||
}, | ||
{ | ||
"kind": "archive", | ||
"url": "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.8.4.zip", | ||
"sha256": "d23b59d08c129daeda7535051eaa082e139cc14d243995aa754d4b250b9c9329", | ||
"file": "aws/dist/aws", | ||
"os": "linux", | ||
"cpu": "x86_64" | ||
} | ||
|
||
] | ||
} | ||
} |
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
common --enable_bzlmod | ||
common --enable_bzlmod | ||
|
||
common --lockfile_mode=off |
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 |
---|---|---|
@@ -1,30 +1,6 @@ | ||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file") | ||
load("@rules_multitool//multitool:multitool.bzl", "multitool") | ||
|
||
http_file( | ||
name = "target_determinator_linux_x86_64", | ||
executable = True, | ||
sha256 = "c8a09143e9fe6eccc4b27a6be92c5929e5a78034a8d0b4c43dbed4ee539ec903", | ||
urls = ["https://github.com/bazel-contrib/target-determinator/releases/download/v0.25.0/target-determinator.linux.amd64"], | ||
) | ||
|
||
http_file( | ||
name = "target_determinator_macos_arm64", | ||
executable = True, | ||
sha256 = "8f975b471c4a51d32781b757e1ece9700221bfd4c0ea507c18fa382360d1111f", | ||
urls = ["https://github.com/bazel-contrib/target-determinator/releases/download/v0.25.0/target-determinator.darwin.arm64"], | ||
) | ||
|
||
http_file( | ||
name = "target_determinator_macos_x86_64", | ||
executable = True, | ||
sha256 = "8c7245603dede429b978e214ca327c3f3d686a1bc712c1298fca0396a0f25f23", | ||
urls = ["https://github.com/bazel-contrib/target-determinator/releases/download/v0.25.0/target-determinator.darwin.amd64"], | ||
) | ||
|
||
multitool( | ||
name = "target-determinator", | ||
linux_x86_64_binary = "@target_determinator_linux_x86_64//file", | ||
macos_arm64_binary = "@target_determinator_macos_arm64//file", | ||
macos_x86_64_binary = "@target_determinator_macos_x86_64//file", | ||
name = "multitool", | ||
lockfile = "//:multitool.lock.json", | ||
) |
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,27 @@ | ||
{ | ||
"target-determinator": { | ||
"binaries": [ | ||
{ | ||
"kind": "file", | ||
"url": "https://github.com/bazel-contrib/target-determinator/releases/download/v0.25.0/target-determinator.darwin.amd64", | ||
"sha256": "8c7245603dede429b978e214ca327c3f3d686a1bc712c1298fca0396a0f25f23", | ||
"os": "macos", | ||
"cpu": "x86_64" | ||
}, | ||
{ | ||
"kind": "file", | ||
"url": "https://github.com/bazel-contrib/target-determinator/releases/download/v0.25.0/target-determinator.darwin.arm64", | ||
"sha256": "8f975b471c4a51d32781b757e1ece9700221bfd4c0ea507c18fa382360d1111f", | ||
"os": "macos", | ||
"cpu": "arm64" | ||
}, | ||
{ | ||
"kind": "file", | ||
"url": "https://github.com/bazel-contrib/target-determinator/releases/download/v0.25.0/target-determinator.linux.amd64", | ||
"sha256": "c8a09143e9fe6eccc4b27a6be92c5929e5a78034a8d0b4c43dbed4ee539ec903", | ||
"os": "linux", | ||
"cpu": "x86_64" | ||
} | ||
] | ||
} | ||
} |
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,28 @@ | ||
"multitool" | ||
|
||
load("//multitool/private:multitool.bzl", _hub = "hub") | ||
|
||
hub = tag_class( | ||
attrs = { | ||
"lockfile": attr.label(mandatory = True, allow_single_file = True), | ||
}, | ||
) | ||
|
||
def _extension(module_ctx): | ||
lockfiles = [] | ||
for mod in module_ctx.modules: | ||
for h in mod.tags.hub: | ||
lockfiles.append(h.lockfile) | ||
|
||
# TODO: we should be able to support multiple hubs | ||
_hub( | ||
name = "multitool", | ||
lockfiles = lockfiles, | ||
) | ||
|
||
multitool = module_extension( | ||
implementation = _extension, | ||
tag_classes = { | ||
"hub": hub, | ||
}, | ||
) |
3 changes: 0 additions & 3 deletions
3
multitool/private/external_repo_template/MODULE.bazel.template
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
multitool/private/external_repo_template/WORKSPACE.bazel.template
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
multitool/private/external_repo_template/linux/arm64/BUILD.bazel.template
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
multitool/private/external_repo_template/linux/x86_64/BUILD.bazel.template
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
multitool/private/external_repo_template/macos/arm64/BUILD.bazel.template
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
multitool/private/external_repo_template/macos/x86_64/BUILD.bazel.template
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.