mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-15 13:35:19 +00:00
Increase build hermiticity
This commit is contained in:
parent
2cf2f3fc96
commit
b487654240
9
.bazelrc
9
.bazelrc
@ -1,16 +1,17 @@
|
||||
build --experimental_guard_against_concurrent_changes
|
||||
build --action_env=ZERO_AR_DATE=1
|
||||
|
||||
build --strategy=Genrule=local
|
||||
build --apple_platform_type=ios
|
||||
|
||||
build --cxxopt='-std=c++14'
|
||||
build --per_file_copt="third-party/webrtc/.*\.cpp$","@-std=c++14"
|
||||
build --per_file_copt="third-party/webrtc/.*\.cc$","@-std=c++14"
|
||||
build --per_file_copt="third-party/webrtc/.*\.mm$","@-std=c++14"
|
||||
build --spawn_strategy=local
|
||||
build --strategy=SwiftCompile=local
|
||||
|
||||
build --features=debug_prefix_map_pwd_is_dot
|
||||
build --features=swift.cacheable_swiftmodules
|
||||
build --features=swift.debug_prefix_map
|
||||
build --features=swift.enable_vfsoverlays
|
||||
|
||||
build --strategy=Genrule=standalone
|
||||
build --spawn_strategy=standalone
|
||||
build --strategy=SwiftCompile=standalone
|
35
.buckconfig
35
.buckconfig
@ -1,35 +0,0 @@
|
||||
[cxx]
|
||||
default_platform = iphonesimulator-x86_64
|
||||
cflags = -g -fmodules -fobjc-arc -D BUCK -DTARGET_OS_IOS=1 -g -w $(config custom.other_cflags)
|
||||
cxxflags = -fobjc-arc -std=c++14 -D BUCK -DTARGET_OS_IOS=1 -g $(config custom.other_cxxflags)
|
||||
combined_preprocess_and_compile = true
|
||||
pch_enabled = false
|
||||
ldflags = -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime $(config custom.other_cxxflags)
|
||||
|
||||
[swift]
|
||||
version = 5
|
||||
compiler_flags = -g -DBUCK $(config custom.optimization) $(config custom.config_swift_compiler_flags) $(config custom.other_swift_compiler_flags)
|
||||
use_filelist = true
|
||||
|
||||
[apple]
|
||||
use_swift_delegate = false
|
||||
use_header_maps_in_xcode = false
|
||||
generate_missing_umbrella_headers = true
|
||||
iphonesimulator_target_sdk_version = 9.0
|
||||
iphoneos_target_sdk_version = 9.0
|
||||
watchos_target_sdk_version = 5.0
|
||||
provisioning_profile_read_command = security cms -Di
|
||||
xctool_default_destination_specifier = platform=iOS Simulator,OS=latest
|
||||
xctool_path = tools/xctool/bin/xctool
|
||||
|
||||
[parser]
|
||||
polyglot_parsing_enabled = true
|
||||
default_build_file_syntax = SKYLARK
|
||||
|
||||
[project]
|
||||
ide_force_kill = always
|
||||
project_schemes = true
|
||||
ide = xcode
|
||||
allow_symlinks = forbid
|
||||
ignore = tools, \
|
||||
.git, \
|
14
.gitattributes
vendored
14
.gitattributes
vendored
@ -1,14 +0,0 @@
|
||||
# Linguist overrides for vendored code
|
||||
submodules/AsyncDisplayKit/* linguist-vendored
|
||||
submodules/ffmpeg/* linguist-vendored
|
||||
submodules/HockeySDK-iOS/* linguist-vendored
|
||||
submodules/libphonenumber/* linguist-vendored
|
||||
submodules/libtgvoip/* linguist-vendored
|
||||
submodules/lottie-ios/* linguist-vendored
|
||||
submodules/Opus/* linguist-vendored
|
||||
submodules/OpusBinding/* linguist-vendored
|
||||
submodules/rlottie/rlottie/* linguist-vendored
|
||||
submodules/sqlcipher/* linguist-vendored
|
||||
submodules/Stripe/* linguist-vendored
|
||||
submodules/ton/tonlib-src/* linguist-vendored
|
||||
submodules/webp/include/* linguist-vendored
|
@ -1 +0,0 @@
|
||||
General fixes and stability improvements
|
@ -1,20 +0,0 @@
|
||||
|
||||
def appConfig():
|
||||
apiId = native.read_config("custom", "apiId")
|
||||
apiHash = native.read_config("custom", "apiHash")
|
||||
appCenterId = native.read_config("custom", "appCenterId")
|
||||
isInternalBuild = native.read_config("custom", "isInternalBuild")
|
||||
isAppStoreBuild = native.read_config("custom", "isAppStoreBuild")
|
||||
appStoreId = native.read_config("custom", "appStoreId")
|
||||
appSpecificUrlScheme = native.read_config("custom", "appSpecificUrlScheme")
|
||||
buildNumber = native.read_config("custom", "buildNumber")
|
||||
return {
|
||||
"apiId": apiId,
|
||||
"apiHash": apiHash,
|
||||
"appCenterId": appCenterId,
|
||||
"isInternalBuild": isInternalBuild,
|
||||
"isAppStoreBuild": isAppStoreBuild,
|
||||
"appStoreId": appStoreId,
|
||||
"appSpecificUrlScheme": appSpecificUrlScheme,
|
||||
"buildNumber": buildNumber,
|
||||
}
|
@ -1,318 +0,0 @@
|
||||
load("//Config:utils.bzl",
|
||||
"config_with_updated_linker_flags",
|
||||
"configs_with_config",
|
||||
"merge_dict",
|
||||
"DEVELOPMENT_LANGUAGE",
|
||||
"SHARED_CONFIGS",
|
||||
"ALL_LOAD_LINKER_FLAG",
|
||||
"read_config_nonempty",
|
||||
"optimization_config",
|
||||
"add_provisioning_profile_specifier",
|
||||
"add_codesign_identity",
|
||||
"get_build_number",
|
||||
"get_short_version",
|
||||
"bundle_identifier",
|
||||
"get_development_team",
|
||||
"get_provisioning_profile",
|
||||
"get_codesign_entitlements",
|
||||
)
|
||||
|
||||
load("//Config:app_configuration.bzl",
|
||||
"appConfig",
|
||||
)
|
||||
|
||||
def app_binary_configs():
|
||||
config = {
|
||||
"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES": "YES",
|
||||
"DEVELOPMENT_LANGUAGE": DEVELOPMENT_LANGUAGE,
|
||||
"PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(suffix=""),
|
||||
"CODE_SIGN_ENTITLEMENTS": get_codesign_entitlements("app"),
|
||||
"DEVELOPMENT_TEAM": get_development_team(),
|
||||
"ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon",
|
||||
"BUILD_NUMBER": get_build_number(),
|
||||
"PRODUCT_BUNDLE_SHORT_VERSION": get_short_version(),
|
||||
"APP_NAME": "Telegram",
|
||||
"PRODUCT_NAME": "Telegram",
|
||||
"TARGETED_DEVICE_FAMILY": "1,2",
|
||||
}
|
||||
config = merge_dict(SHARED_CONFIGS, config)
|
||||
config = merge_dict(config, optimization_config())
|
||||
config = config_with_updated_linker_flags(config, ALL_LOAD_LINKER_FLAG)
|
||||
configs = configs_with_config(config)
|
||||
configs = add_provisioning_profile_specifier(configs, "app")
|
||||
configs = add_codesign_identity(configs)
|
||||
return configs
|
||||
|
||||
def share_extension_configs():
|
||||
config = {
|
||||
"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES": "NO",
|
||||
"DEVELOPMENT_LANGUAGE": DEVELOPMENT_LANGUAGE,
|
||||
"PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(suffix=".Share"),
|
||||
"CODE_SIGN_ENTITLEMENTS": get_codesign_entitlements("share"),
|
||||
"DEVELOPMENT_TEAM": get_development_team(),
|
||||
"BUILD_NUMBER": get_build_number(),
|
||||
"PRODUCT_BUNDLE_SHORT_VERSION": get_short_version(),
|
||||
"APP_NAME": "Telegram",
|
||||
"PRODUCT_NAME": "ShareExtension",
|
||||
}
|
||||
config = merge_dict(SHARED_CONFIGS, config)
|
||||
config = merge_dict(config, optimization_config())
|
||||
config = config_with_updated_linker_flags(config, ALL_LOAD_LINKER_FLAG)
|
||||
configs = configs_with_config(config)
|
||||
configs = add_provisioning_profile_specifier(configs, "share")
|
||||
configs = add_codesign_identity(configs)
|
||||
return configs
|
||||
|
||||
def widget_extension_configs():
|
||||
config = {
|
||||
"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES": "NO",
|
||||
"DEVELOPMENT_LANGUAGE": DEVELOPMENT_LANGUAGE,
|
||||
"PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(suffix=".Widget"),
|
||||
"CODE_SIGN_ENTITLEMENTS": get_codesign_entitlements("widget"),
|
||||
"DEVELOPMENT_TEAM": get_development_team(),
|
||||
"BUILD_NUMBER": get_build_number(),
|
||||
"PRODUCT_BUNDLE_SHORT_VERSION": get_short_version(),
|
||||
"APP_NAME": "Telegram",
|
||||
"PRODUCT_NAME": "WidgetExtension",
|
||||
}
|
||||
config = merge_dict(SHARED_CONFIGS, config)
|
||||
config = merge_dict(config, optimization_config())
|
||||
config = config_with_updated_linker_flags(config, ALL_LOAD_LINKER_FLAG)
|
||||
configs = configs_with_config(config)
|
||||
configs = add_provisioning_profile_specifier(configs, "widget")
|
||||
configs = add_codesign_identity(configs)
|
||||
return configs
|
||||
|
||||
def notification_content_extension_configs():
|
||||
config = {
|
||||
"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES": "NO",
|
||||
"DEVELOPMENT_LANGUAGE": DEVELOPMENT_LANGUAGE,
|
||||
"PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(suffix=".NotificationContent"),
|
||||
"CODE_SIGN_ENTITLEMENTS": get_codesign_entitlements("notification_content"),
|
||||
"DEVELOPMENT_TEAM": get_development_team(),
|
||||
"BUILD_NUMBER": get_build_number(),
|
||||
"PRODUCT_BUNDLE_SHORT_VERSION": get_short_version(),
|
||||
"APP_NAME": "Telegram",
|
||||
"PRODUCT_NAME": "NotificationContentExtension",
|
||||
}
|
||||
config = merge_dict(SHARED_CONFIGS, config)
|
||||
config = merge_dict(config, optimization_config())
|
||||
config = config_with_updated_linker_flags(config, ALL_LOAD_LINKER_FLAG)
|
||||
configs = configs_with_config(config)
|
||||
configs = add_provisioning_profile_specifier(configs, "notification_content")
|
||||
configs = add_codesign_identity(configs)
|
||||
return configs
|
||||
|
||||
def notification_service_extension_configs():
|
||||
config = {
|
||||
"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES": "NO",
|
||||
"DEVELOPMENT_LANGUAGE": DEVELOPMENT_LANGUAGE,
|
||||
"PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(suffix=".NotificationService"),
|
||||
"CODE_SIGN_ENTITLEMENTS": get_codesign_entitlements("notification_service"),
|
||||
"DEVELOPMENT_TEAM": get_development_team(),
|
||||
"BUILD_NUMBER": get_build_number(),
|
||||
"PRODUCT_BUNDLE_SHORT_VERSION": get_short_version(),
|
||||
"APP_NAME": "Telegram",
|
||||
"PRODUCT_NAME": "NotificationServiceExtension",
|
||||
}
|
||||
config = merge_dict(SHARED_CONFIGS, config)
|
||||
config = merge_dict(config, optimization_config())
|
||||
config = config_with_updated_linker_flags(config, ALL_LOAD_LINKER_FLAG)
|
||||
configs = configs_with_config(config)
|
||||
configs = add_provisioning_profile_specifier(configs, "notification_service")
|
||||
configs = add_codesign_identity(configs)
|
||||
return configs
|
||||
|
||||
def intents_extension_configs():
|
||||
config = {
|
||||
"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES": "NO",
|
||||
"DEVELOPMENT_LANGUAGE": DEVELOPMENT_LANGUAGE,
|
||||
"PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(suffix=".SiriIntents"),
|
||||
"CODE_SIGN_ENTITLEMENTS": get_codesign_entitlements("intents"),
|
||||
"DEVELOPMENT_TEAM": get_development_team(),
|
||||
"BUILD_NUMBER": get_build_number(),
|
||||
"PRODUCT_BUNDLE_SHORT_VERSION": get_short_version(),
|
||||
"APP_NAME": "Telegram",
|
||||
"PRODUCT_NAME": "IntentsExtension",
|
||||
}
|
||||
config = merge_dict(SHARED_CONFIGS, config)
|
||||
config = merge_dict(config, optimization_config())
|
||||
config = config_with_updated_linker_flags(config, ALL_LOAD_LINKER_FLAG)
|
||||
configs = configs_with_config(config)
|
||||
configs = add_provisioning_profile_specifier(configs, "intents")
|
||||
configs = add_codesign_identity(configs)
|
||||
return configs
|
||||
|
||||
def watch_extension_binary_configs():
|
||||
config = {
|
||||
"SDKROOT": "watchos",
|
||||
"WATCHOS_DEPLOYMENT_TARGET": "5.0",
|
||||
"TARGETED_DEVICE_FAMILY": "4",
|
||||
"PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(suffix=".watchkitapp.watchkitextension"),
|
||||
"DEVELOPMENT_TEAM": get_development_team(),
|
||||
"LD_RUNPATH_SEARCH_PATHS": "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks",
|
||||
"WK_COMPANION_APP_BUNDLE_IDENTIFIER": bundle_identifier(suffix=""),
|
||||
"WK_APP_BUNDLE_IDENTIFIER": bundle_identifier(suffix=".watchkitapp"),
|
||||
"APP_NAME": "Telegram",
|
||||
"APP_BUNDLE_ID": bundle_identifier(suffix=""),
|
||||
"BUILD_NUMBER": get_build_number(),
|
||||
"PRODUCT_BUNDLE_SHORT_VERSION": get_short_version(),
|
||||
"ENABLE_BITCODE": "YES",
|
||||
}
|
||||
config = config_with_updated_linker_flags(config, ALL_LOAD_LINKER_FLAG)
|
||||
configs = configs_with_config(config)
|
||||
configs = add_provisioning_profile_specifier(configs, "watch_extension")
|
||||
configs = add_codesign_identity(configs)
|
||||
return configs
|
||||
|
||||
def watch_binary_configs():
|
||||
config = {
|
||||
"SDKROOT": "watchos",
|
||||
"WATCHOS_DEPLOYMENT_TARGET": "5.0",
|
||||
"TARGETED_DEVICE_FAMILY": "4",
|
||||
"PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(suffix=".watchkitapp"),
|
||||
"DEVELOPMENT_TEAM": get_development_team(),
|
||||
"LD_RUNPATH_SEARCH_PATHS": "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks",
|
||||
"WK_COMPANION_APP_BUNDLE_IDENTIFIER": bundle_identifier(suffix=""),
|
||||
"WK_APP_BUNDLE_IDENTIFIER": bundle_identifier(suffix=".watchkitapp"),
|
||||
"APP_NAME": "Telegram",
|
||||
"APP_BUNDLE_ID": bundle_identifier(suffix=""),
|
||||
"ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon",
|
||||
"BUILD_NUMBER": get_build_number(),
|
||||
"PRODUCT_BUNDLE_SHORT_VERSION": get_short_version(),
|
||||
"ENABLE_BITCODE": "YES",
|
||||
}
|
||||
config = config_with_updated_linker_flags(config, ALL_LOAD_LINKER_FLAG)
|
||||
configs = configs_with_config(config)
|
||||
configs = add_provisioning_profile_specifier(configs, "watch_app")
|
||||
configs = add_codesign_identity(configs)
|
||||
return configs
|
||||
|
||||
def info_plist_substitutions(name):
|
||||
substitutions = {
|
||||
"DEVELOPMENT_LANGUAGE": DEVELOPMENT_LANGUAGE,
|
||||
"EXECUTABLE_NAME": name,
|
||||
"PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(name),
|
||||
"PRODUCT_NAME": name,
|
||||
"CURRENT_PROJECT_VERSION": "1",
|
||||
}
|
||||
return substitutions
|
||||
|
||||
def app_info_plist_substitutions():
|
||||
substitutions = {
|
||||
"DEVELOPMENT_LANGUAGE": DEVELOPMENT_LANGUAGE,
|
||||
"EXECUTABLE_NAME": "Telegram",
|
||||
"PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(suffix=""),
|
||||
"PRODUCT_NAME": "Telegram",
|
||||
"APP_NAME": "Telegram",
|
||||
"CURRENT_PROJECT_VERSION": "1",
|
||||
"APP_SPECIFIC_URL_SCHEME": appConfig()["appSpecificUrlScheme"],
|
||||
"BUILD_NUMBER": get_build_number(),
|
||||
"PRODUCT_BUNDLE_SHORT_VERSION": get_short_version(),
|
||||
"ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon",
|
||||
"TARGETED_DEVICE_FAMILY": "1,2",
|
||||
}
|
||||
return substitutions
|
||||
|
||||
def share_extension_info_plist_substitutions():
|
||||
substitutions = {
|
||||
"DEVELOPMENT_LANGUAGE": DEVELOPMENT_LANGUAGE,
|
||||
"EXECUTABLE_NAME": "ShareExtension",
|
||||
"PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(suffix=".Share"),
|
||||
"PRODUCT_NAME": "Share",
|
||||
"APP_NAME": "Telegram",
|
||||
"CURRENT_PROJECT_VERSION": "1",
|
||||
"APP_SPECIFIC_URL_SCHEME": appConfig()["appSpecificUrlScheme"],
|
||||
"BUILD_NUMBER": get_build_number(),
|
||||
"PRODUCT_BUNDLE_SHORT_VERSION": get_short_version(),
|
||||
}
|
||||
return substitutions
|
||||
|
||||
def widget_extension_info_plist_substitutions():
|
||||
substitutions = {
|
||||
"DEVELOPMENT_LANGUAGE": DEVELOPMENT_LANGUAGE,
|
||||
"EXECUTABLE_NAME": "WidgetExtension",
|
||||
"PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(suffix=".Widget"),
|
||||
"PRODUCT_NAME": "Widget",
|
||||
"APP_NAME": "Telegram",
|
||||
"CURRENT_PROJECT_VERSION": "1",
|
||||
"APP_SPECIFIC_URL_SCHEME": appConfig()["appSpecificUrlScheme"],
|
||||
"BUILD_NUMBER": get_build_number(),
|
||||
"PRODUCT_BUNDLE_SHORT_VERSION": get_short_version(),
|
||||
"MinimumOSVersion": "9.0",
|
||||
}
|
||||
return substitutions
|
||||
|
||||
def notification_content_extension_info_plist_substitutions():
|
||||
substitutions = {
|
||||
"DEVELOPMENT_LANGUAGE": DEVELOPMENT_LANGUAGE,
|
||||
"EXECUTABLE_NAME": "NotificationContentExtension",
|
||||
"PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(suffix=".NotificationContent"),
|
||||
"PRODUCT_NAME": "Telegram",
|
||||
"APP_NAME": "Telegram",
|
||||
"CURRENT_PROJECT_VERSION": "1",
|
||||
"BUILD_NUMBER": get_build_number(),
|
||||
"PRODUCT_BUNDLE_SHORT_VERSION": get_short_version(),
|
||||
"MinimumOSVersion": "10.0",
|
||||
}
|
||||
return substitutions
|
||||
|
||||
def notification_service_extension_info_plist_substitutions():
|
||||
substitutions = {
|
||||
"DEVELOPMENT_LANGUAGE": DEVELOPMENT_LANGUAGE,
|
||||
"EXECUTABLE_NAME": "NotificationServiceExtension",
|
||||
"PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(suffix=".NotificationService"),
|
||||
"PRODUCT_NAME": "Telegram",
|
||||
"APP_NAME": "Telegram",
|
||||
"CURRENT_PROJECT_VERSION": "1",
|
||||
"BUILD_NUMBER": get_build_number(),
|
||||
"PRODUCT_BUNDLE_SHORT_VERSION": get_short_version(),
|
||||
"MinimumOSVersion": "10.0",
|
||||
}
|
||||
return substitutions
|
||||
|
||||
def intents_extension_info_plist_substitutions():
|
||||
substitutions = {
|
||||
"DEVELOPMENT_LANGUAGE": DEVELOPMENT_LANGUAGE,
|
||||
"EXECUTABLE_NAME": "IntentsExtension",
|
||||
"PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(suffix=".SiriIntents"),
|
||||
"PRODUCT_NAME": "Telegram",
|
||||
"APP_NAME": "Telegram",
|
||||
"CURRENT_PROJECT_VERSION": "1",
|
||||
"APP_SPECIFIC_URL_SCHEME": appConfig()["appSpecificUrlScheme"],
|
||||
"BUILD_NUMBER": get_build_number(),
|
||||
"PRODUCT_BUNDLE_SHORT_VERSION": get_short_version(),
|
||||
"PRODUCT_MODULE_NAME": "SiriIntents",
|
||||
"MinimumOSVersion": "10.0",
|
||||
}
|
||||
return substitutions
|
||||
|
||||
def watch_extension_info_plist_substitutions():
|
||||
substitutions = {
|
||||
"DEVELOPMENT_LANGUAGE": DEVELOPMENT_LANGUAGE,
|
||||
"EXECUTABLE_NAME": "WatchAppExtension",
|
||||
"PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(suffix=".watchkitapp.watchkitextension"),
|
||||
"APP_NAME": "Telegram",
|
||||
"APP_BUNDLE_ID": bundle_identifier(suffix=""),
|
||||
"PRODUCT_NAME": "Telegram",
|
||||
"CURRENT_PROJECT_VERSION": "1",
|
||||
"BUILD_NUMBER": get_build_number(),
|
||||
"PRODUCT_BUNDLE_SHORT_VERSION": get_short_version(),
|
||||
"MinimumOSVersion": "5.0",
|
||||
}
|
||||
return substitutions
|
||||
|
||||
def watch_info_plist_substitutions():
|
||||
substitutions = {
|
||||
"DEVELOPMENT_LANGUAGE": DEVELOPMENT_LANGUAGE,
|
||||
"EXECUTABLE_NAME": "WatchApp",
|
||||
"PRODUCT_BUNDLE_IDENTIFIER":bundle_identifier(suffix=".watchkitapp"),
|
||||
"APP_NAME": "Telegram",
|
||||
"APP_BUNDLE_ID": bundle_identifier(suffix=""),
|
||||
"PRODUCT_NAME": "Telegram",
|
||||
"CURRENT_PROJECT_VERSION": "1",
|
||||
"BUILD_NUMBER": get_build_number(),
|
||||
"PRODUCT_BUNDLE_SHORT_VERSION": get_short_version(),
|
||||
"MinimumOSVersion": "5.0",
|
||||
}
|
||||
return substitutions
|
@ -1,31 +0,0 @@
|
||||
|
||||
def _impl(ctx):
|
||||
output_dir = ctx.attr.name + "_ModuleHeaders"
|
||||
dir = ctx.actions.declare_directory(output_dir)
|
||||
files = []
|
||||
files_command = ""
|
||||
for file in ctx.files.headers:
|
||||
outFile = ctx.actions.declare_file(output_dir + "/" + ctx.attr.module_name + "/" + file.basename)
|
||||
files.append(outFile)
|
||||
files_command = files_command + " && cp " + file.path + " " + outFile.path
|
||||
ctx.actions.run_shell(
|
||||
outputs = [dir] + files,
|
||||
inputs = ctx.files.headers,
|
||||
command = "mkdir -p " + dir.path + " " + files_command
|
||||
)
|
||||
return [
|
||||
apple_common.new_objc_provider(
|
||||
include_system = depset([dir.path]),
|
||||
header = depset(files),
|
||||
),
|
||||
]
|
||||
|
||||
objc_module = rule(
|
||||
implementation = _impl,
|
||||
attrs = {
|
||||
"module_name": attr.string(mandatory = True),
|
||||
"headers": attr.label_list(
|
||||
allow_files = [".h"],
|
||||
),
|
||||
},
|
||||
)
|
202
Config/utils.bzl
202
Config/utils.bzl
@ -1,202 +0,0 @@
|
||||
OTHER_LINKER_FLAGS_KEY = 'OTHER_LDFLAGS'
|
||||
|
||||
def configs_with_config(config):
|
||||
return {
|
||||
"Debug": config,
|
||||
"Profile": config,
|
||||
"Release": config,
|
||||
}
|
||||
|
||||
def configs_with_updated_linker_flags(configs, other_linker_flags):
|
||||
if other_linker_flags == None:
|
||||
return configs
|
||||
else:
|
||||
updated_configs = { }
|
||||
for build_configuration in configs:
|
||||
updated_configs[build_configuration] = config_with_updated_linker_flags(
|
||||
configs[build_configuration],
|
||||
other_linker_flags)
|
||||
return updated_configs
|
||||
|
||||
def config_with_updated_linker_flags(config, other_linker_flags, config_key=OTHER_LINKER_FLAGS_KEY):
|
||||
new_config = { }
|
||||
config_key_found = False
|
||||
for key in config:
|
||||
if key == config_key:
|
||||
new_config[key] = config[key] + (" %s" % other_linker_flags)
|
||||
config_key_found = True
|
||||
else:
|
||||
new_config[key] = config[key]
|
||||
|
||||
if config_key_found == False:
|
||||
# If `config` does not currently contain `config_key`, add it. Inherit for good measure.
|
||||
new_config[config_key] = '$(inherited) ' + other_linker_flags
|
||||
|
||||
return new_config
|
||||
|
||||
def merge_dict(a, b):
|
||||
d = {}
|
||||
d.update(a)
|
||||
d.update(b)
|
||||
return d
|
||||
|
||||
DEVELOPMENT_LANGUAGE = "en"
|
||||
|
||||
SHARED_CONFIGS = {
|
||||
"IPHONEOS_DEPLOYMENT_TARGET": "9.0",
|
||||
"SDKROOT": "iphoneos",
|
||||
"GCC_OPTIMIZATION_LEVEL": "0",
|
||||
"SWIFT_WHOLE_MODULE_OPTIMIZATION": "NO",
|
||||
"ONLY_ACTIVE_ARCH": "YES",
|
||||
"LD_RUNPATH_SEARCH_PATHS": "@executable_path/Frameworks",
|
||||
"ENABLE_BITCODE": "NO",
|
||||
}
|
||||
|
||||
# Adding `-all_load` to our binaries works around https://bugs.swift.org/browse/SR-6004.
|
||||
ALL_LOAD_LINKER_FLAG = "-all_load"
|
||||
|
||||
def optimization_config():
|
||||
return {
|
||||
"SWIFT_OPTIMIZATION_LEVEL": native.read_config("custom", "optimization"),
|
||||
}
|
||||
|
||||
def read_config_nonempty(name):
|
||||
value = native.read_config("custom", name)
|
||||
if value == None:
|
||||
fail("Configuration parameter custom.%s should be defined" % name)
|
||||
elif len(value) == 0:
|
||||
fail("Configuration parameter custom.%s should not be empty" % name)
|
||||
else:
|
||||
return value
|
||||
|
||||
def get_codesign_identity(environment):
|
||||
if environment == "development":
|
||||
return read_config_nonempty("developmentCodeSignIdentity")
|
||||
elif environment == "distribution":
|
||||
return read_config_nonempty("distributionCodeSignIdentity")
|
||||
else:
|
||||
fail("Unknown environment " + environment)
|
||||
|
||||
def get_development_team():
|
||||
return read_config_nonempty("developmentTeam")
|
||||
|
||||
def add_item_to_subdict(superdict, key, subkey, item):
|
||||
subdict = dict(superdict[key])
|
||||
subdict[subkey] = item
|
||||
superdict[key] = subdict
|
||||
|
||||
valid_configurations = ["Debug", "Profile", "Release"]
|
||||
|
||||
def add_provisioning_profile_specifier(configs, type):
|
||||
for configuration in configs:
|
||||
if configuration not in valid_configurations:
|
||||
fail("Unknown configuration " + configuration)
|
||||
|
||||
configs = dict(configs)
|
||||
for configuration in valid_configurations:
|
||||
if configuration == "Debug":
|
||||
add_item_to_subdict(configs, configuration, "PROVISIONING_PROFILE_SPECIFIER", get_provisioning_profile(environment="development", type=type))
|
||||
elif configuration == "Profile":
|
||||
add_item_to_subdict(configs, configuration, "PROVISIONING_PROFILE_SPECIFIER", get_provisioning_profile(environment="development", type=type))
|
||||
elif configuration == "Release":
|
||||
add_item_to_subdict(configs, configuration, "PROVISIONING_PROFILE_SPECIFIER", get_provisioning_profile(environment="distribution", type=type))
|
||||
return configs
|
||||
|
||||
def add_codesign_identity(configs):
|
||||
for configuration in configs:
|
||||
if configuration not in valid_configurations:
|
||||
fail("Unknown configuration " + configuration)
|
||||
|
||||
configs = dict(configs)
|
||||
for configuration in valid_configurations:
|
||||
if configuration == "Debug":
|
||||
add_item_to_subdict(configs, configuration, "CODE_SIGN_IDENTITY", get_codesign_identity(environment="development"))
|
||||
elif configuration == "Profile":
|
||||
add_item_to_subdict(configs, configuration, "CODE_SIGN_IDENTITY", get_codesign_identity(environment="development"))
|
||||
elif configuration == "Release":
|
||||
add_item_to_subdict(configs, configuration, "CODE_SIGN_IDENTITY", get_codesign_identity(environment="distribution"))
|
||||
return configs
|
||||
|
||||
def get_build_number():
|
||||
return read_config_nonempty("buildNumber")
|
||||
|
||||
def get_short_version():
|
||||
return read_config_nonempty("appVersion")
|
||||
|
||||
def bundle_identifier(suffix):
|
||||
return read_config_nonempty("baseApplicationBundleId") + suffix
|
||||
|
||||
def library_configs():
|
||||
lib_specific_config = {
|
||||
"SWIFT_WHOLE_MODULE_OPTIMIZATION": "NO",
|
||||
|
||||
# Setting SKIP_INSTALL to NO for static library configs would create
|
||||
# create a generic xcode archive which can not be uploaded the app store
|
||||
# https://developer.apple.com/library/archive/technotes/tn2215/_index.html
|
||||
"SKIP_INSTALL": "YES",
|
||||
}
|
||||
library_config = merge_dict(SHARED_CONFIGS, lib_specific_config)
|
||||
library_config = merge_dict(library_config, optimization_config())
|
||||
configs = {
|
||||
"Debug": library_config,
|
||||
"Profile": library_config,
|
||||
"Release": library_config,
|
||||
}
|
||||
return configs
|
||||
|
||||
def dynamic_library_configs():
|
||||
lib_specific_config = {
|
||||
"SWIFT_WHOLE_MODULE_OPTIMIZATION": "NO",
|
||||
|
||||
# Setting SKIP_INSTALL to NO for static library configs would create
|
||||
# create a generic xcode archive which can not be uploaded the app store
|
||||
# https://developer.apple.com/library/archive/technotes/tn2215/_index.html
|
||||
"SKIP_INSTALL": "YES",
|
||||
"MACH_O_TYPE": "mh_dylib",
|
||||
"CODE_SIGNING_ALLOWED": "NO",
|
||||
}
|
||||
|
||||
library_config = merge_dict(SHARED_CONFIGS, lib_specific_config)
|
||||
library_config = merge_dict(library_config, optimization_config())
|
||||
configs = {
|
||||
"Debug": library_config,
|
||||
"Profile": library_config,
|
||||
"Release": library_config,
|
||||
}
|
||||
return configs
|
||||
|
||||
def get_provisioning_profile(environment, type):
|
||||
if type == "app":
|
||||
return read_config_nonempty(environment + "ProvisioningProfileApp")
|
||||
elif type == "share":
|
||||
return read_config_nonempty(environment + "ProvisioningProfileExtensionShare")
|
||||
elif type == "widget":
|
||||
return read_config_nonempty(environment + "ProvisioningProfileExtensionWidget")
|
||||
elif type == "notification_service":
|
||||
return read_config_nonempty(environment + "ProvisioningProfileExtensionNotificationService")
|
||||
elif type == "notification_content":
|
||||
return read_config_nonempty(environment + "ProvisioningProfileExtensionNotificationContent")
|
||||
elif type == "intents":
|
||||
return read_config_nonempty(environment + "ProvisioningProfileExtensionIntents")
|
||||
elif type == "watch_app":
|
||||
return read_config_nonempty(environment + "ProvisioningProfileWatchApp")
|
||||
elif type == "watch_extension":
|
||||
return read_config_nonempty(environment + "ProvisioningProfileWatchExtension")
|
||||
else:
|
||||
fail("Unknown provisioning profile type " + type)
|
||||
|
||||
def get_codesign_entitlements(type):
|
||||
if type == "app":
|
||||
return read_config_nonempty("entitlementsApp")
|
||||
elif type == "share":
|
||||
return read_config_nonempty("entitlementsExtensionShare")
|
||||
elif type == "widget":
|
||||
return read_config_nonempty("entitlementsExtensionWidget")
|
||||
elif type == "notification_service":
|
||||
return read_config_nonempty("entitlementsExtensionNotificationService")
|
||||
elif type == "notification_content":
|
||||
return read_config_nonempty("entitlementsExtensionNotificationContent")
|
||||
elif type == "intents":
|
||||
return read_config_nonempty("entitlementsExtensionIntents")
|
||||
else:
|
||||
fail("unknown provisioning profile type")
|
@ -1,59 +0,0 @@
|
||||
load("//Config:utils.bzl",
|
||||
"config_with_updated_linker_flags",
|
||||
"configs_with_config",
|
||||
"merge_dict",
|
||||
"DEVELOPMENT_LANGUAGE",
|
||||
"SHARED_CONFIGS",
|
||||
"ALL_LOAD_LINKER_FLAG",
|
||||
"optimization_config",
|
||||
"add_provisioning_profile_specifier",
|
||||
"add_codesign_identity",
|
||||
"get_build_number",
|
||||
"get_short_version",
|
||||
"bundle_identifier",
|
||||
"get_development_team",
|
||||
"get_provisioning_profile",
|
||||
"get_codesign_entitlements",
|
||||
)
|
||||
|
||||
load("//Config:app_configuration.bzl",
|
||||
"appConfig"
|
||||
)
|
||||
|
||||
def app_binary_configs():
|
||||
config = {
|
||||
"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES": "YES",
|
||||
"DEVELOPMENT_LANGUAGE": DEVELOPMENT_LANGUAGE,
|
||||
"EXECUTABLE_NAME": "Wallet",
|
||||
"PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(suffix=""),
|
||||
"CODE_SIGN_ENTITLEMENTS": get_codesign_entitlements("app"),
|
||||
"DEVELOPMENT_TEAM": get_development_team(),
|
||||
"ASSETCATALOG_COMPILER_APPICON_NAME": "AppIconWallet",
|
||||
"BUILD_NUMBER": get_build_number(),
|
||||
"PRODUCT_BUNDLE_SHORT_VERSION": get_short_version(),
|
||||
"APP_NAME": "TON Wallet",
|
||||
"PRODUCT_NAME": "TON Wallet",
|
||||
"TARGETED_DEVICE_FAMILY": "1,2",
|
||||
}
|
||||
config = merge_dict(SHARED_CONFIGS, config)
|
||||
config = merge_dict(config, optimization_config())
|
||||
config = config_with_updated_linker_flags(config, ALL_LOAD_LINKER_FLAG)
|
||||
configs = configs_with_config(config)
|
||||
configs = add_provisioning_profile_specifier(configs, "app")
|
||||
configs = add_codesign_identity(configs)
|
||||
return configs
|
||||
|
||||
def app_info_plist_substitutions():
|
||||
substitutions = {
|
||||
"DEVELOPMENT_LANGUAGE": DEVELOPMENT_LANGUAGE,
|
||||
"EXECUTABLE_NAME": "Wallet",
|
||||
"PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(suffix=""),
|
||||
"PRODUCT_NAME": "TON Wallet",
|
||||
"APP_NAME": "TON Wallet",
|
||||
"CURRENT_PROJECT_VERSION": "1",
|
||||
"BUILD_NUMBER": get_build_number(),
|
||||
"PRODUCT_BUNDLE_SHORT_VERSION": get_short_version(),
|
||||
"ASSETCATALOG_COMPILER_APPICON_NAME": "AppIconWallet",
|
||||
"TARGETED_DEVICE_FAMILY": "1,2",
|
||||
}
|
||||
return substitutions
|
38
Makefile
38
Makefile
@ -1,4 +1,4 @@
|
||||
.PHONY : kill_xcode clean bazel_app_debug_arm64 bazel_app_debug_sim_arm64 bazel_app_arm64 bazel_app_armv7 bazel_app bazel_project bazel_project_noextensions
|
||||
.PHONY : kill_xcode clean bazel_app_debug_arm64 bazel_app_debug_sim_arm64 bazel_app_arm64 bazel_app_armv7 bazel_app check_sandbox_debug_build bazel_project bazel_project_noextensions
|
||||
|
||||
APP_VERSION="7.3"
|
||||
CORE_COUNT=$(shell sysctl -n hw.logicalcpu)
|
||||
@ -14,16 +14,30 @@ else ifneq ($(BAZEL_CACHE_DIR),)
|
||||
--disk_cache="${BAZEL_CACHE_DIR}"
|
||||
endif
|
||||
|
||||
ifneq ($(BAZEL_KEEP_GOING),)
|
||||
export BAZEL_KEEP_GOING_FLAGS=\
|
||||
-k
|
||||
else ifneq ($(BAZEL_CACHE_DIR),)
|
||||
export BAZEL_KEEP_GOING_FLAGS=
|
||||
endif
|
||||
|
||||
BAZEL_COMMON_FLAGS=\
|
||||
--announce_rc \
|
||||
--features=swift.use_global_module_cache \
|
||||
--features=swift.split_derived_files_generation \
|
||||
--features=swift.skip_function_bodies_for_derived_files \
|
||||
--jobs=${CORE_COUNT}
|
||||
--jobs=${CORE_COUNT} \
|
||||
${BAZEL_KEEP_GOING_FLAGS} \
|
||||
|
||||
BAZEL_DEBUG_FLAGS=\
|
||||
--features=swift.enable_batch_mode \
|
||||
--swiftcopt=-j${CORE_COUNT_MINUS_ONE} \
|
||||
--experimental_guard_against_concurrent_changes \
|
||||
|
||||
BAZEL_SANDBOX_FLAGS=\
|
||||
--strategy=Genrule=sandboxed \
|
||||
--spawn_strategy=sandboxed \
|
||||
--strategy=SwiftCompile=sandboxed \
|
||||
|
||||
# --num-threads 0 forces swiftc to generate one object file per module; it:
|
||||
# 1. resolves issues with the linker caused by swift-objc mixing.
|
||||
@ -40,10 +54,12 @@ kill_xcode:
|
||||
killall Xcode || true
|
||||
|
||||
clean:
|
||||
"${BAZEL}" clean
|
||||
"${BAZEL}" clean --expunge
|
||||
|
||||
bazel_app_debug_arm64:
|
||||
APP_VERSION="${APP_VERSION}" \
|
||||
BAZEL_CACHE_DIR="${BAZEL_CACHE_DIR}" \
|
||||
BAZEL_HTTP_CACHE_URL="${BAZEL_HTTP_CACHE_URL}" \
|
||||
TELEGRAM_DISABLE_EXTENSIONS="0" \
|
||||
build-system/prepare-build.sh Telegram distribution
|
||||
"${BAZEL}" build Telegram/Telegram ${BAZEL_CACHE_FLAGS} ${BAZEL_COMMON_FLAGS} ${BAZEL_DEBUG_FLAGS} \
|
||||
@ -54,6 +70,8 @@ bazel_app_debug_arm64:
|
||||
|
||||
bazel_app_debug_sim_arm64:
|
||||
APP_VERSION="${APP_VERSION}" \
|
||||
BAZEL_CACHE_DIR="${BAZEL_CACHE_DIR}" \
|
||||
BAZEL_HTTP_CACHE_URL="${BAZEL_HTTP_CACHE_URL}" \
|
||||
TELEGRAM_DISABLE_EXTENSIONS="0" \
|
||||
build-system/prepare-build.sh Telegram distribution
|
||||
"${BAZEL}" build Telegram/Telegram ${BAZEL_CACHE_FLAGS} ${BAZEL_COMMON_FLAGS} ${BAZEL_DEBUG_FLAGS} \
|
||||
@ -104,6 +122,20 @@ bazel_app:
|
||||
--output_groups=+dsyms \
|
||||
--verbose_failures
|
||||
|
||||
check_sandbox_debug_build:
|
||||
APP_VERSION="${APP_VERSION}" \
|
||||
BAZEL_CACHE_DIR="${BAZEL_CACHE_DIR}" \
|
||||
BAZEL_HTTP_CACHE_URL="${BAZEL_HTTP_CACHE_URL}" \
|
||||
TELEGRAM_DISABLE_EXTENSIONS="0" \
|
||||
build-system/prepare-build.sh Telegram distribution
|
||||
"${BAZEL}" build Telegram/Telegram ${BAZEL_CACHE_FLAGS} ${BAZEL_COMMON_FLAGS} ${BAZEL_DEBUG_FLAGS} ${BAZEL_SANDBOX_FLAGS} \
|
||||
-c opt \
|
||||
--ios_multi_cpus=arm64 \
|
||||
--watchos_cpus=armv7k,arm64_32 \
|
||||
--apple_generate_dsym \
|
||||
--output_groups=+dsyms \
|
||||
--verbose_failures
|
||||
|
||||
bazel_project: kill_xcode
|
||||
APP_VERSION="${APP_VERSION}" \
|
||||
BAZEL_CACHE_DIR="${BAZEL_CACHE_DIR}" \
|
||||
|
@ -5,6 +5,7 @@ objc_library(
|
||||
module_name = "DeviceProximity",
|
||||
srcs = glob([
|
||||
"Sources/*.m",
|
||||
"Sources/*.h",
|
||||
]),
|
||||
hdrs = glob([
|
||||
"PublicHeaders/**/*.h",
|
||||
|
@ -28,14 +28,20 @@ objc_library(
|
||||
"Sources/**/*.m",
|
||||
"Sources/**/*.mm",
|
||||
"Sources/**/*.h",
|
||||
"libtgvoip/*.h",
|
||||
"libtgvoip/*.hpp",
|
||||
"libtgvoip/*.m",
|
||||
"libtgvoip/*.mm",
|
||||
"libtgvoip/*.cpp",
|
||||
"libtgvoip/audio/*.h",
|
||||
"libtgvoip/audio/*.cpp",
|
||||
"libtgvoip/video/*.h",
|
||||
"libtgvoip/video/*.cpp",
|
||||
"libtgvoip/os/darwin/*.h",
|
||||
"libtgvoip/os/darwin/*.m",
|
||||
"libtgvoip/os/darwin/*.mm",
|
||||
"libtgvoip/os/darwin/*.cpp",
|
||||
"libtgvoip/os/posix/*.h",
|
||||
"libtgvoip/os/posix/*.cpp",
|
||||
], exclude = ["libtgvoip/os/darwin/*OSX*"]),
|
||||
hdrs = glob([
|
||||
|
2
third-party/mozjpeg/BUILD
vendored
2
third-party/mozjpeg/BUILD
vendored
@ -84,7 +84,7 @@ objc_library(
|
||||
name = "mozjpeg",
|
||||
module_name = "mozjpeg",
|
||||
enable_modules = True,
|
||||
hdrs = [":Public/mozjpeg/" + x for x in headers],
|
||||
hdrs = [":Public/mozjpeg/" + x for x in headers] + [":Public/mozjpeg/jconfig.h"],
|
||||
includes = [
|
||||
"Public",
|
||||
"Public/mozjpeg",
|
||||
|
1930
third-party/webrtc/BUILD
vendored
1930
third-party/webrtc/BUILD
vendored
File diff suppressed because it is too large
Load Diff
27
third-party/webrtc/build-webrtc-bazel.sh
vendored
27
third-party/webrtc/build-webrtc-bazel.sh
vendored
@ -1,27 +0,0 @@
|
||||
#/bin/sh
|
||||
|
||||
set -x
|
||||
set -e
|
||||
|
||||
BUILD_DIR="$(pwd)/$1"
|
||||
ARCH="$2"
|
||||
|
||||
echo "BUILD_DIR=$BUILD_DIR"
|
||||
echo "ARCH=$ARCH"
|
||||
|
||||
export PATH="$PATH:$BUILD_DIR/depot_tools"
|
||||
|
||||
rm -rf "$BUILD_DIR/src/openssl"
|
||||
cp -R "$BUILD_DIR/openssl" "$BUILD_DIR/src/"
|
||||
|
||||
pushd "$BUILD_DIR/src"
|
||||
|
||||
OUT_DIR="ios"
|
||||
if [ "$ARCH" == "x64" ]; then
|
||||
OUT_DIR="ios_sim"
|
||||
fi
|
||||
|
||||
buildtools/mac/gn gen out/$OUT_DIR --args="use_xcode_clang=true "" target_cpu=\"$ARCH\""' target_os="ios" is_debug=false is_component_build=false rtc_include_tests=false use_rtti=true rtc_use_x11=false use_custom_libcxx=false use_custom_libcxx_for_host=false rtc_build_ssl=false rtc_build_examples=false rtc_build_tools=false ios_deployment_target="9.0" ios_enable_code_signing=false is_unsafe_developer_build=false rtc_enable_protobuf=false rtc_include_builtin_video_codecs=true rtc_build_libvpx=true rtc_libvpx_build_vp9=true rtc_use_gtk=false rtc_use_metal_rendering=true'
|
||||
ninja -C out/$OUT_DIR framework_objc_static
|
||||
|
||||
popd
|
Loading…
x
Reference in New Issue
Block a user