-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.bazel
78 lines (69 loc) · 1.73 KB
/
BUILD.bazel
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
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
load("@bazel_skylib//rules:write_file.bzl", "write_file")
load("@bzlws//rules:bzlws_copy.bzl", "bzlws_copy")
load("@rules_blender//:index.bzl", "blender_render")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
package(default_visibility = ["//visibility:public"])
_VARIATIONS = [
"color",
"all-color",
"white",
"black",
"folder",
]
_SIZES = [
44,
128,
150,
256,
]
[blender_render(
name = "ecsact-{}".format(variation),
blend_file = "logo.blend",
render_format = "PNG",
view_layers = [variation],
) for variation in _VARIATIONS]
[blender_render(
name = "ecsact-{}{}".format(variation, size),
blend_file = "logo.blend",
python_script_args = [
"--res_x",
str(size),
"--res_y",
str(size),
],
python_scripts = ["override_resolution.py"],
render_format = "PNG",
view_layers = [variation],
) for variation in _VARIATIONS for size in _SIZES]
filegroup(
name = "ecsact_logo",
srcs =
[":ecsact-{}".format(variation) for variation in _VARIATIONS] +
[":ecsact-{}{}".format(variation, size) for variation in _VARIATIONS for size in _SIZES],
)
write_file(
name = "public_build_file",
out = "BUILD",
content = [
"package(default_visibility = [\"//visibility:public\"])",
"exports_files(glob([\"*\"]))",
],
)
pkg_tar(
name = "ecsact_logo_archive",
out = "ecsact_logo.tar.gz",
extension = ".tar.gz",
srcs = [
"logo.svg",
"MODULE.bazel",
":ecsact_logo",
":public_build_file",
],
)
bzlws_copy(
name = "copy_dist_archive",
srcs = [":ecsact_logo_archive"],
out = "dist/{FILENAME}",
force = True,
)