mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-05 19:28:46 +02:00
Update build system
This commit is contained in:
parent
a2f71562f6
commit
49ae84062b
1448 changed files with 835035 additions and 140 deletions
|
|
@ -40,7 +40,6 @@ class BazelCommandLine:
|
|||
self.additional_args = None
|
||||
self.build_number = None
|
||||
self.configuration_args = None
|
||||
self.configuration_path = None
|
||||
self.split_submodules = False
|
||||
self.custom_target = None
|
||||
self.continue_on_error = False
|
||||
|
|
@ -68,7 +67,7 @@ class BazelCommandLine:
|
|||
'--verbose_failures',
|
||||
|
||||
# Asynchronously upload cache artifacts
|
||||
'--experimental_remote_cache_async',
|
||||
'--remote_cache_async',
|
||||
]
|
||||
|
||||
self.common_build_args = [
|
||||
|
|
@ -89,12 +88,6 @@ class BazelCommandLine:
|
|||
# invoking a smaller number of frontend processes and passing them batches of
|
||||
# source files.
|
||||
'--features=swift.enable_batch_mode',
|
||||
|
||||
# https://docs.bazel.build/versions/master/command-line-reference.html
|
||||
# Set the number of parallel jobs per module to saturate the available CPU resources.
|
||||
#'--swiftcopt=-j{}'.format(os.cpu_count() - 1),
|
||||
'--@build_bazel_rules_swift//swift:copt="-j{}"'.format(os.cpu_count() - 1),
|
||||
'--@build_bazel_rules_swift//swift:copt="-whole-module-optimization"',
|
||||
]
|
||||
|
||||
self.common_release_args = [
|
||||
|
|
@ -147,9 +140,6 @@ class BazelCommandLine:
|
|||
def set_split_swiftmodules(self, value):
|
||||
self.split_submodules = value
|
||||
|
||||
def set_configuration_path(self, path):
|
||||
self.configuration_path = path
|
||||
|
||||
def set_disable_provisioning_profiles(self):
|
||||
self.disable_provisioning_profiles = True
|
||||
|
||||
|
|
@ -203,8 +193,6 @@ class BazelCommandLine:
|
|||
|
||||
# Require DSYM files as build output.
|
||||
'--output_groups=+dsyms',
|
||||
|
||||
#'--@build_bazel_rules_swift//swift:copt="-num-threads 0"',
|
||||
] + self.common_release_args
|
||||
else:
|
||||
raise Exception('Unknown configuration {}'.format(configuration))
|
||||
|
|
@ -296,13 +284,6 @@ class BazelCommandLine:
|
|||
if self.disable_provisioning_profiles:
|
||||
combined_arguments += ['--//Telegram:disableProvisioningProfiles']
|
||||
|
||||
if self.configuration_path is None:
|
||||
raise Exception('configuration_path is not defined')
|
||||
|
||||
combined_arguments += [
|
||||
'--override_repository=build_configuration={}'.format(self.configuration_path)
|
||||
]
|
||||
|
||||
combined_arguments += self.common_args
|
||||
combined_arguments += self.common_build_args
|
||||
combined_arguments += self.get_define_arguments()
|
||||
|
|
@ -336,13 +317,6 @@ class BazelCommandLine:
|
|||
|
||||
combined_arguments += ['Tests/AllTests']
|
||||
|
||||
if self.configuration_path is None:
|
||||
raise Exception('configuration_path is not defined')
|
||||
|
||||
combined_arguments += [
|
||||
'--override_repository=build_configuration={}'.format(self.configuration_path)
|
||||
]
|
||||
|
||||
combined_arguments += self.common_args
|
||||
combined_arguments += self.common_build_args
|
||||
combined_arguments += self.get_define_arguments()
|
||||
|
|
@ -371,13 +345,6 @@ class BazelCommandLine:
|
|||
combined_arguments += self.get_startup_bazel_arguments()
|
||||
combined_arguments += ['aquery']
|
||||
|
||||
if self.configuration_path is None:
|
||||
raise Exception('configuration_path is not defined')
|
||||
|
||||
combined_arguments += [
|
||||
'--override_repository=build_configuration={}'.format(self.configuration_path)
|
||||
]
|
||||
|
||||
combined_arguments += [
|
||||
'-c', 'dbg',
|
||||
'--ios_multi_cpus=sim_arm64',
|
||||
|
|
@ -425,13 +392,6 @@ class BazelCommandLine:
|
|||
if self.disable_provisioning_profiles:
|
||||
combined_arguments += ['--//Telegram:disableProvisioningProfiles']
|
||||
|
||||
if self.configuration_path is None:
|
||||
raise Exception('configuration_path is not defined')
|
||||
|
||||
combined_arguments += [
|
||||
'--override_repository=build_configuration={}'.format(self.configuration_path)
|
||||
]
|
||||
|
||||
combined_arguments += self.common_args
|
||||
combined_arguments += self.common_build_args
|
||||
combined_arguments += self.get_define_arguments()
|
||||
|
|
@ -562,9 +522,6 @@ def resolve_configuration(base_path, bazel_command_line: BazelCommandLine, argum
|
|||
file.write(' "{}",\n'.format(file_name))
|
||||
file.write('])\n')
|
||||
|
||||
if bazel_command_line is not None:
|
||||
bazel_command_line.set_configuration_path(configuration_repository_path)
|
||||
|
||||
|
||||
def generate_project(bazel, arguments):
|
||||
bazel_command_line = BazelCommandLine(
|
||||
|
|
@ -617,7 +574,6 @@ def generate_project(bazel, arguments):
|
|||
disable_provisioning_profiles=disable_provisioning_profiles,
|
||||
include_release=project_include_release,
|
||||
generate_dsym=generate_dsym,
|
||||
configuration_path=bazel_command_line.configuration_path,
|
||||
bazel_app_arguments=bazel_command_line.get_project_generation_arguments(),
|
||||
target_name=target_name
|
||||
)
|
||||
|
|
@ -1006,14 +962,10 @@ if __name__ == '__main__':
|
|||
buildParser.add_argument(
|
||||
'--configuration',
|
||||
choices=[
|
||||
'debug_universal',
|
||||
'debug_arm64',
|
||||
'debug_armv7',
|
||||
'debug_sim_arm64',
|
||||
'release_sim_arm64',
|
||||
'release_arm64',
|
||||
'release_armv7',
|
||||
'release_universal'
|
||||
],
|
||||
required=True,
|
||||
help='Build configuration'
|
||||
|
|
@ -1254,14 +1206,10 @@ if __name__ == '__main__':
|
|||
spm_parser.add_argument(
|
||||
'--configuration',
|
||||
choices=[
|
||||
'debug_universal',
|
||||
'debug_arm64',
|
||||
'debug_armv7',
|
||||
'debug_sim_arm64',
|
||||
'release_sim_arm64',
|
||||
'release_arm64',
|
||||
'release_armv7',
|
||||
'release_universal'
|
||||
],
|
||||
required=True,
|
||||
help='Build configuration'
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ def remove_directory(path):
|
|||
if os.path.isdir(path):
|
||||
shutil.rmtree(path)
|
||||
|
||||
def generate_xcodeproj(build_environment: BuildEnvironment, disable_extensions, disable_provisioning_profiles, include_release, generate_dsym, configuration_path, bazel_app_arguments, target_name):
|
||||
def generate_xcodeproj(build_environment: BuildEnvironment, disable_extensions, disable_provisioning_profiles, include_release, generate_dsym, bazel_app_arguments, target_name):
|
||||
if '/' in target_name:
|
||||
app_target_spec = target_name.split('/')[0] + '/' + target_name.split('/')[1] + ':' + target_name.split('/')[1]
|
||||
app_target = target_name
|
||||
|
|
@ -22,7 +22,6 @@ def generate_xcodeproj(build_environment: BuildEnvironment, disable_extensions,
|
|||
bazel_generate_arguments = [build_environment.bazel_path]
|
||||
|
||||
bazel_generate_arguments += ['run', '//{}_xcodeproj'.format(app_target_spec)]
|
||||
bazel_generate_arguments += ['--override_repository=build_configuration={}'.format(configuration_path)]
|
||||
|
||||
if target_name == 'Telegram':
|
||||
if disable_extensions:
|
||||
|
|
@ -32,7 +31,6 @@ def generate_xcodeproj(build_environment: BuildEnvironment, disable_extensions,
|
|||
project_bazel_arguments = []
|
||||
for argument in bazel_app_arguments:
|
||||
project_bazel_arguments.append(argument)
|
||||
project_bazel_arguments += ['--override_repository=build_configuration={}'.format(configuration_path)]
|
||||
|
||||
if target_name == 'Telegram':
|
||||
if disable_extensions:
|
||||
|
|
@ -54,5 +52,5 @@ def generate_xcodeproj(build_environment: BuildEnvironment, disable_extensions,
|
|||
return xcodeproj_path
|
||||
|
||||
|
||||
def generate(build_environment: BuildEnvironment, disable_extensions, disable_provisioning_profiles, include_release, generate_dsym, configuration_path, bazel_app_arguments, target_name) -> str:
|
||||
return generate_xcodeproj(build_environment, disable_extensions, disable_provisioning_profiles, include_release, generate_dsym, configuration_path, bazel_app_arguments, target_name)
|
||||
def generate(build_environment: BuildEnvironment, disable_extensions, disable_provisioning_profiles, include_release, generate_dsym, bazel_app_arguments, target_name) -> str:
|
||||
return generate_xcodeproj(build_environment, disable_extensions, disable_provisioning_profiles, include_release, generate_dsym, bazel_app_arguments, target_name)
|
||||
|
|
|
|||
1
build-system/bazel-rules/sourcekit-bazel-bsp
Submodule
1
build-system/bazel-rules/sourcekit-bazel-bsp
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit fb37d850e8715df81761feeea25f2158514fa2be
|
||||
|
|
@ -52,9 +52,9 @@ class EncryptionV2
|
|||
iv = keyIv[32..43]
|
||||
auth_data = keyIv[44..-1]
|
||||
|
||||
puts "key: #{key.inspect}"
|
||||
puts "iv: #{iv.inspect}"
|
||||
puts "auth_data: #{auth_data.inspect}"
|
||||
#puts "key: #{key.inspect}"
|
||||
#puts "iv: #{iv.inspect}"
|
||||
#puts "auth_data: #{auth_data.inspect}"
|
||||
|
||||
cipher.key = key
|
||||
cipher.iv = iv
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue