mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
— use upstream rules_swift and tulsi
— update tulsi, apple_support, rules_apple, rules_swift — bump bazel version to 5.0.0 — bump Xcode version to 13.2.1 — automatically download bazel binaries
This commit is contained in:
32
build-system/Make/BazelLocation.py
Normal file
32
build-system/Make/BazelLocation.py
Normal file
@@ -0,0 +1,32 @@
|
||||
import os
|
||||
import stat
|
||||
import sys
|
||||
|
||||
from BuildEnvironment import is_apple_silicon, resolve_executable, call_executable, BuildEnvironmentVersions
|
||||
|
||||
def locate_bazel(base_path):
|
||||
versions = BuildEnvironmentVersions(base_path=os.getcwd())
|
||||
if is_apple_silicon():
|
||||
arch = 'darwin-arm64'
|
||||
else:
|
||||
arch = 'x86_64'
|
||||
bazel_name = 'bazel-{version}-{arch}'.format(version=versions.bazel_version, arch=arch)
|
||||
bazel_path = '{}/build-input/{}'.format(base_path, bazel_name)
|
||||
|
||||
if not os.path.isfile(bazel_path):
|
||||
call_executable([
|
||||
'curl',
|
||||
'-L',
|
||||
'https://github.com/bazelbuild/bazel/releases/download/{version}/{name}'.format(
|
||||
version=versions.bazel_version,
|
||||
name=bazel_name
|
||||
),
|
||||
'--output',
|
||||
bazel_path
|
||||
])
|
||||
|
||||
if not os.access(bazel_path, os.X_OK):
|
||||
st = os.stat(bazel_path)
|
||||
os.chmod(bazel_path, st.st_mode | stat.S_IEXEC)
|
||||
|
||||
return bazel_path
|
||||
Reference in New Issue
Block a user