-
Notifications
You must be signed in to change notification settings - Fork 17
/
BUILD.bazel
89 lines (77 loc) · 1.98 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
79
80
81
82
83
84
85
86
87
88
89
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("@bazel_gazelle//:def.bzl", "gazelle")
load("@rules_pkg//:pkg.bzl", "pkg_zip")
load("@rules_license//rules:license.bzl", "license")
package(
default_applicable_licenses = ["//:license"],
default_visibility = ["//visibility:public"],
)
licenses(["notice"])
license(
name = "license",
license_kinds = [
"@rules_license//licenses/spdx:Apache-2.0",
],
license_text = "LICENSE",
)
# gazelle:prefix github.com/GoogleCloudPlatform/proto-gen-md-diagrams
# gazelle:exclude test/protos/**
gazelle(name = "gazelle")
go_library(
name = "main_lib",
srcs = ["main.go"],
importpath = "github.com/GoogleCloudPlatform/proto-gen-md-diagrams",
visibility = ["//visibility:private"],
deps = ["//pkg/proto"],
)
go_binary(
name = "main",
basename = "proto-gen-md-diagrams",
embed = [":main_lib"],
visibility = ["//visibility:public"],
)
archive_base_name = "proto-gen-md-diagrams"
pkg_zip(
name = "main_zip",
srcs = [
"LICENSE",
"NOTICE",
"README.md",
":main",
],
out = "binary.zip",
package_file_name = select({
"on_linux": "{}-linux-x86_64".format(archive_base_name),
"on_osx_x64": "{}-osx-x86_64".format(archive_base_name),
"on_windows": "{}-win-x86_64".format(archive_base_name),
"on_osx_arm64": "{}-osx-arm64".format(archive_base_name),
}),
)
config_setting(
name = "on_linux",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
)
config_setting(
name = "on_windows",
constraint_values = [
"@platforms//os:windows",
"@platforms//cpu:x86_64",
],
)
config_setting(
name = "on_osx_x64",
constraint_values = [
"@platforms//os:osx",
"@platforms//cpu:x86_64",
],
)
config_setting(
name = "on_osx_arm64",
constraint_values = [
"@platforms//os:osx",
"@platforms//cpu:arm64",
],
)