1- load ("@io_bazel_rules_go//go:def.bzl" , "go_binary" , "go_library" , "go_test" )
2- load ("@bazel_gazelle//:def.bzl" , "gazelle" )
31load ("@aspect_rules_js//npm:defs.bzl" , "npm_package" , "stamped_package_json" )
2+ load ("@gazelle//:def.bzl" , "gazelle" )
3+ load ("@rules_go//go:def.bzl" , "go_binary" , "go_library" , "go_test" )
44
5+ # gazelle:ignore
56# gazelle:prefix github.com/bazelbuild/bazelisk
67gazelle (name = "gazelle" )
78
@@ -72,33 +73,43 @@ go_binary(
7273 visibility = ["//visibility:public" ],
7374)
7475
75- go_binary (
76- name = "bazelisk-darwin-amd64" ,
77- out = "bazelisk-darwin_amd64" ,
78- embed = [":bazelisk_lib" ],
79- gc_linkopts = [
80- "-s" ,
81- "-w" ,
82- ],
83- goarch = "amd64" ,
84- goos = "darwin" ,
85- pure = "on" ,
86- visibility = ["//visibility:public" ],
87- )
76+ [
77+ go_binary (
78+ name = "bazelisk-%s-%s" % (os , arch ),
79+ out = "bazelisk-%s_%s" % (os , arch ),
80+ embed = [":bazelisk_lib" ],
81+ gc_linkopts = [
82+ "-s" ,
83+ "-w" ,
84+ ],
85+ goarch = arch ,
86+ goos = os ,
87+ pure = "on" ,
88+ visibility = ["//visibility:public" ],
89+ )
90+ for os , arch in [
91+ ("darwin" , "amd64" ),
92+ ("darwin" , "arm64" ),
93+ ("linux" , "amd64" ),
94+ ("linux" , "arm64" )
95+ ]
96+ ]
8897
89- go_binary (
90- name = "bazelisk-darwin-arm64" ,
91- out = "bazelisk-darwin_arm64" ,
92- embed = [":bazelisk_lib" ],
93- gc_linkopts = [
94- "-s" ,
95- "-w" ,
96- ],
97- goarch = "arm64" ,
98- goos = "darwin" ,
99- pure = "on" ,
100- visibility = ["//visibility:public" ],
101- )
98+ [
99+ go_binary (
100+ name = "bazelisk-%s-%s" % (os , arch ),
101+ out = "bazelisk-%s_%s.exe" % (os , arch ),
102+ embed = [":bazelisk_lib" ],
103+ goarch = arch ,
104+ goos = os ,
105+ pure = "on" ,
106+ visibility = ["//visibility:public" ],
107+ )
108+ for os , arch in [
109+ ("windows" , "amd64" ),
110+ ("windows" , "arm64" )
111+ ]
112+ ]
102113
103114genrule (
104115 name = "bazelisk-darwin-universal" ,
@@ -114,44 +125,6 @@ genrule(
114125 ],
115126)
116127
117- go_binary (
118- name = "bazelisk-linux-amd64" ,
119- out = "bazelisk-linux_amd64" ,
120- embed = [":bazelisk_lib" ],
121- gc_linkopts = [
122- "-s" ,
123- "-w" ,
124- ],
125- goarch = "amd64" ,
126- goos = "linux" ,
127- pure = "on" ,
128- visibility = ["//visibility:public" ],
129- )
130-
131- go_binary (
132- name = "bazelisk-linux-arm64" ,
133- out = "bazelisk-linux_arm64" ,
134- embed = [":bazelisk_lib" ],
135- gc_linkopts = [
136- "-s" ,
137- "-w" ,
138- ],
139- goarch = "arm64" ,
140- goos = "linux" ,
141- pure = "on" ,
142- visibility = ["//visibility:public" ],
143- )
144-
145- go_binary (
146- name = "bazelisk-windows-amd64" ,
147- out = "bazelisk-windows_amd64.exe" ,
148- embed = [":bazelisk_lib" ],
149- goarch = "amd64" ,
150- goos = "windows" ,
151- pure = "on" ,
152- visibility = ["//visibility:public" ],
153- )
154-
155128stamped_package_json (
156129 name = "package" ,
157130 # This key is defined by /stamp.sh
@@ -170,6 +143,7 @@ npm_package(
170143 ":bazelisk-linux-amd64" ,
171144 ":bazelisk-linux-arm64" ,
172145 ":bazelisk-windows-amd64" ,
146+ ":bazelisk-windows-arm64" ,
173147 ":package" ,
174148 ],
175149 package = "@bazel/bazelisk" ,
0 commit comments