FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
protobuf-javascript/protobuf_javascript_release.bzl at main · protocolbuffers/protobuf-javascript · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
protocolbuffers
/
protobuf-javascript
Public
Notifications
You must be signed in to change notification settings
Fork
91
Star
470
Code
Issues
64
Pull requests
6
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
protobuf-javascript
/
protobuf_javascript_release.bzl
Copy path
More file actions
More file actions
Latest commit
History
History
History
58 lines (49 loc) · 1.75 KB
Breadcrumbs
protobuf-javascript
/
protobuf_javascript_release.bzl
Copy path
File metadata and controls
58 lines (49 loc) · 1.75 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
"""Generates package naming variables for use with rules_pkg."""
load
(
"@bazel_tools//tools/cpp:toolchain_utils.bzl"
,
"find_cpp_toolchain"
)
load
(
"@rules_pkg//pkg:providers.bzl"
,
"PackageVariablesInfo"
)
_PROTOBUF_JAVASCRIPT_VERSION
=
"4.0.2"
def
_package_naming_impl
(
ctx
):
values
=
{}
values
[
"version"
]
=
_PROTOBUF_JAVASCRIPT_VERSION
if
ctx
.
attr
.
platform
!=
""
:
values
[
"platform"
]
=
ctx
.
attr
.
platform
return
PackageVariablesInfo
(
values
=
values
)
# infer from the current cpp toolchain.
toolchain
=
find_cpp_toolchain
(
ctx
)
cpu
=
toolchain
.
cpu
system_name
=
toolchain
.
target_gnu_system_name
# rename cpus to match what we want artifacts to be
if
cpu
==
"systemz"
:
cpu
=
"s390_64"
elif
cpu
==
"aarch64"
:
cpu
=
"aarch_64"
elif
cpu
==
"ppc64"
:
cpu
=
"ppcle_64"
elif
cpu
==
"i686"
:
cpu
=
"x86_32"
elif
cpu
==
"x86_64"
:
cpu
=
"x86_64"
# use the system name to determine the os and then create platform names
if
"apple"
in
system_name
:
values
[
"platform"
]
=
"osx-"
+
cpu
elif
"linux"
in
system_name
:
values
[
"platform"
]
=
"linux-"
+
cpu
elif
"mingw"
in
system_name
:
if
cpu
==
"x86_64"
:
values
[
"platform"
]
=
"win64"
else
:
values
[
"platform"
]
=
"win32"
else
:
values
[
"platform"
]
=
"unknown"
return
PackageVariablesInfo
(
values
=
values
)
package_naming
=
rule
(
implementation
=
_package_naming_impl
,
attrs
=
{
# Necessary data dependency for find_cpp_toolchain.
"_cc_toolchain"
:
attr
.
label
(
default
=
Label
(
"@bazel_tools//tools/cpp:current_cc_toolchain"
),
),
"platform"
:
attr
.
string
(),
},
toolchains
=
[
"@bazel_tools//tools/cpp:toolchain_type"
],
)
Back
|
FazBrowse Home
|
New Git URL