-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathMODULE.bazel
More file actions
80 lines (68 loc) · 2.6 KB
/
MODULE.bazel
File metadata and controls
80 lines (68 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
module(name = "cloud_archive")
# Register the cloud_archive extension with default (empty) tool config.
# Consumers can override tools via cloud_archive.configure() in their own
# MODULE.bazel — see extensions.bzl for details.
cloud_archive = use_extension("//:extensions.bzl", "cloud_archive")
use_repo(cloud_archive, "cloud_archive_tools")
# --- Local test targets (no cloud backend required) ---
local_file = use_repo_rule("//:cloud_archive.bzl", "local_file")
local_file(
name = "test_local_file",
sha256 = "7c5fdb91d42da23cf7f42c786b20b770f64643bfd62ad7f52d3ab4c4fd189eff",
src = "//testdata:test_file.txt",
)
local_archive = use_repo_rule("//:cloud_archive.bzl", "local_archive")
local_archive(
name = "test_local_archive_gz",
build_file = "//:BUILD.archive",
sha256 = "e7fefef96c1a5fb3da63966b5dd18ef25ecfb68f5958eaf2c7d339cf7bc9c181",
src = "//testdata:test_archive.tar.gz",
)
local_archive(
name = "test_local_archive_zstd",
build_file = "//:BUILD.archive",
sha256 = "07237e58db9b30e375d49c41d584600b6c104610c11d2f55f84d4ea92ae62773",
src = "//testdata:test_archive.tar.zst",
strip_prefix = "dir1",
)
local_archive(
name = "test_local_archive_zstd_strip2",
build_file = "//:BUILD.archive",
sha256 = "07237e58db9b30e375d49c41d584600b6c104610c11d2f55f84d4ea92ae62773",
src = "//testdata:test_archive.tar.zst",
strip_prefix = "dir1/dir2",
)
local_archive(
name = "test_local_archive_patch",
build_file = "//:BUILD.archive",
patch_args = ["-p1"],
patches = ["//testdata:test.patch"],
sha256 = "07237e58db9b30e375d49c41d584600b6c104610c11d2f55f84d4ea92ae62773",
src = "//testdata:test_archive.tar.zst",
strip_prefix = "dir1",
)
local_archive(
name = "test_local_archive_patch_cmds",
build_file = "//:BUILD.archive",
patch_cmds = ["echo 'patched by cmd' > dir2/dir3/text3.txt"],
sha256 = "07237e58db9b30e375d49c41d584600b6c104610c11d2f55f84d4ea92ae62773",
src = "//testdata:test_archive.tar.zst",
strip_prefix = "dir1",
)
# Test: add_prefix with strip_prefix
local_archive(
name = "test_local_archive_add_prefix",
build_file = "//:BUILD.archive",
sha256 = "07237e58db9b30e375d49c41d584600b6c104610c11d2f55f84d4ea92ae62773",
src = "//testdata:test_archive.tar.zst",
strip_prefix = "dir1",
add_prefix = "myprefix",
)
# Test: type attribute with extensionless file
local_archive(
name = "test_local_archive_type",
build_file = "//:BUILD.archive",
sha256 = "e7fefef96c1a5fb3da63966b5dd18ef25ecfb68f5958eaf2c7d339cf7bc9c181",
src = "//testdata:test_archive_no_ext",
type = "tar.gz",
)