Move resources to root

This commit is contained in:
Ali 2020-03-01 13:56:50 +04:00
parent e5610cbcd4
commit 494322bc07
9 changed files with 151 additions and 29 deletions

View File

@ -51,6 +51,7 @@ ifneq ($(BAZEL_CACHE_DIR),)
endif endif
BAZEL_COMMON_FLAGS=\ BAZEL_COMMON_FLAGS=\
--announce_rc \
--features=swift.use_global_module_cache \ --features=swift.use_global_module_cache \
BAZEL_DEBUG_FLAGS=\ BAZEL_DEBUG_FLAGS=\
@ -445,3 +446,9 @@ bazel_project: kill_xcode
APP_VERSION="${APP_VERSION}" \ APP_VERSION="${APP_VERSION}" \
BAZEL_CACHE_DIR="${BAZEL_CACHE_DIR}" \ BAZEL_CACHE_DIR="${BAZEL_CACHE_DIR}" \
build-system/generate-xcode-project.sh build-system/generate-xcode-project.sh
bazel_soft_project:
APP_VERSION="${APP_VERSION}" \
BAZEL_CACHE_DIR="${BAZEL_CACHE_DIR}" \
build-system/generate-xcode-project.sh

View File

@ -1,5 +1,6 @@
load("@build_bazel_rules_apple//apple:ios.bzl", load("@build_bazel_rules_apple//apple:ios.bzl",
"ios_application", "ios_application",
"ios_extension",
"ios_framework", "ios_framework",
) )
@ -28,6 +29,49 @@ load(
"telegram_aps_environment", "telegram_aps_environment",
) )
config_setting(
name = "debug",
values = {
"compilation_mode": "dbg",
},
)
genrule(
name = "empty",
outs = ["empty.swift"],
cmd = "touch $(OUTS)",
)
swift_library(
name = "_LocalDebugOptions",
srcs = [":empty"],
copts = [
"-Xfrontend",
"-serialize-debugging-options",
],
deps = [
"//submodules/AsyncDisplayKit:AsyncDisplayKit",
"//submodules/AppBundle:AppBundle",
"//submodules/ObjCRuntimeUtils:ObjCRuntimeUtils",
"//submodules/UIKitRuntimeUtils:UIKitRuntimeUtils",
"//submodules/Crc32:Crc32",
"//submodules/MurMurHash32:MurMurHash32",
"//submodules/StringTransliteration:StringTransliteration",
"//submodules/sqlcipher:sqlcipher",
"//submodules/NumberPluralizationForm:NumberPluralizationForm",
"//submodules/EncryptionProvider:EncryptionProvider",
"//submodules/MtProtoKit:MtProtoKit",
],
module_name = "_LocalDebugOptions",
tags = ["no-remote"],
visibility = ["//visibility:public"],
)
debug_deps = select({
":debug": [":_LocalDebugOptions"],
"//conditions:default": [],
})
filegroup( filegroup(
name = "AppResources", name = "AppResources",
srcs = glob([ srcs = glob([
@ -114,6 +158,14 @@ swift_library(
":AppResources", ":AppResources",
":AppIntentVocabularyResources", ":AppIntentVocabularyResources",
":InfoPlistStringResources", ":InfoPlistStringResources",
"//submodules/LegacyComponents:LegacyComponentsResources",
"//submodules/OverlayStatusController:OverlayStatusControllerResources",
"//submodules/PasswordSetupUI:PasswordSetupUIResources",
"//submodules/PasswordSetupUI:PasswordSetupUIAssets",
"//submodules/TelegramUI:TelegramUIResources",
"//submodules/TelegramUI:TelegramUIAssets",
"//submodules/WalletUI:WalletUIResources",
"//submodules/WalletUI:WalletUIAssets",
], ],
deps = [ deps = [
"//submodules/TelegramUI:TelegramUI", "//submodules/TelegramUI:TelegramUI",
@ -283,7 +335,7 @@ objc_library(
) )
plist_fragment( plist_fragment(
name = "WatchVersionInfoPlist", name = "VersionInfoPlist",
extension = "plist", extension = "plist",
template = template =
""" """
@ -298,7 +350,7 @@ plist_fragment(
) )
plist_fragment( plist_fragment(
name = "WatchAppNameInfoPlist", name = "AppNameInfoPlist",
extension = "plist", extension = "plist",
template = template =
""" """
@ -347,8 +399,8 @@ watchos_extension(
bundle_name = "TelegramWatchExtension", bundle_name = "TelegramWatchExtension",
infoplists = [ infoplists = [
"Watch/Extension/Info.plist", "Watch/Extension/Info.plist",
":WatchVersionInfoPlist", ":VersionInfoPlist",
":WatchAppNameInfoPlist", ":AppNameInfoPlist",
":WatchExtensionNSExtensionInfoPlist", ":WatchExtensionNSExtensionInfoPlist",
], ],
minimum_os_version = "5.0", minimum_os_version = "5.0",
@ -374,8 +426,8 @@ watchos_application(
extension = ":TelegramWatchExtension", extension = ":TelegramWatchExtension",
infoplists = [ infoplists = [
"Watch/App/Info.plist", "Watch/App/Info.plist",
":WatchVersionInfoPlist", ":VersionInfoPlist",
":WatchAppNameInfoPlist", ":AppNameInfoPlist",
":WatchAppCompanionInfoPlist", ":WatchAppCompanionInfoPlist",
], ],
minimum_os_version = "5.0", minimum_os_version = "5.0",
@ -391,6 +443,79 @@ watchos_application(
], ],
) )
swift_library(
name = "ShareExtensionLib",
module_name = "ShareExtensionLib",
srcs = glob([
"Share/**/*.swift",
]),
deps = [
"//submodules/TelegramUI:TelegramUI"
],
)
plist_fragment(
name = "TelegramUIInfoPlist",
extension = "plist",
template =
"""
<key>CFBundleIdentifier</key>
<string>{telegram_bundle_id}.TelegramUI</string>
<key>CFBundleVersion</key>
<string>{telegram_build_number}</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleName</key>
<string>TelegramUI</string>
<key>CFBundleShortVersionString</key>
<string>{telegram_version}</string>
""".format(
telegram_bundle_id = telegram_bundle_id,
telegram_version = telegram_version,
telegram_build_number = telegram_build_number,
)
)
ios_framework(
name = "TelegramUIFramework",
bundle_id = "{telegram_bundle_id}.TelegramUI".format(
telegram_bundle_id = telegram_bundle_id,
),
families = [
"iphone",
"ipad",
],
infoplists = [
":TelegramUIInfoPlist.plist",
],
minimum_os_version = "9.0",
deps = [
"//submodules/TelegramUI:TelegramUI",
] + debug_deps,
)
ios_extension(
name = "ShareExtension",
bundle_id = "{telegram_bundle_id}.Share".format(
telegram_bundle_id = telegram_bundle_id,
),
families = [
"iphone",
"ipad",
],
infoplists = [
"Share/Info.plist",
":VersionInfoPlist",
":AppNameInfoPlist",
],
minimum_os_version = "9.0",
provisioning_profile = "//build-input/data/provisioning-profiles:Share.mobileprovision",
deps = [":ShareExtensionLib"],
frameworks = [
":TelegramUIFramework"
],
)
ios_application( ios_application(
name = "Telegram", name = "Telegram",
bundle_id = "{telegram_bundle_id}".format( bundle_id = "{telegram_bundle_id}".format(
@ -408,11 +533,14 @@ ios_application(
":DefaultAppIcon", ":DefaultAppIcon",
], ],
frameworks = [ frameworks = [
#":AsyncDisplayKitFramework", ":TelegramUIFramework",
], ],
strings = [ strings = [
":AppStringResources", ":AppStringResources",
], ],
extensions = [
":ShareExtension",
],
watch_application = ":TelegramWatchApp", watch_application = ":TelegramWatchApp",
deps = [ deps = [
":Main", ":Main",

View File

@ -4,8 +4,6 @@
<dict> <dict>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>en</string> <string>en</string>
<key>CFBundleDisplayName</key>
<string>${APP_NAME}</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string> <string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
@ -16,10 +14,6 @@
<string>$(PRODUCT_NAME)</string> <string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>XPC!</string> <string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>$(PRODUCT_BUNDLE_SHORT_VERSION)</string>
<key>CFBundleVersion</key>
<string>${BUILD_NUMBER}</string>
<key>NSExtension</key> <key>NSExtension</key>
<dict> <dict>
<key>NSExtensionAttributes</key> <key>NSExtensionAttributes</key>

@ -1 +1 @@
Subproject commit ec21bcc566e09d5ff2777cdf34090958090fd4c4 Subproject commit bbe187c4b1f55c0974a0da345e5e313eaed37c05

View File

@ -4,6 +4,7 @@ filegroup(
srcs = glob([ srcs = glob([
"LegacyComponentsResources.bundle/**/*", "LegacyComponentsResources.bundle/**/*",
], exclude = ["Resources/LegacyComponentsResources.bundle/**/.*"]), ], exclude = ["Resources/LegacyComponentsResources.bundle/**/.*"]),
visibility = ["//visibility:public"],
) )
objc_library( objc_library(

View File

@ -5,14 +5,12 @@ filegroup(
srcs = glob([ srcs = glob([
"Resources/**/*", "Resources/**/*",
], exclude = ["Resources/**/.*"]), ], exclude = ["Resources/**/.*"]),
visibility = ["//visibility:public"],
) )
swift_library( swift_library(
name = "OverlayStatusController", name = "OverlayStatusController",
module_name = "OverlayStatusController", module_name = "OverlayStatusController",
data = [
":OverlayStatusControllerResources",
],
srcs = glob([ srcs = glob([
"Sources/**/*.swift", "Sources/**/*.swift",
]), ]),

View File

@ -5,11 +5,13 @@ filegroup(
srcs = glob([ srcs = glob([
"Resources/**/*", "Resources/**/*",
], exclude = ["Resources/**/.*"]), ], exclude = ["Resources/**/.*"]),
visibility = ["//visibility:public"],
) )
filegroup( filegroup(
name = "PasswordSetupUIAssets", name = "PasswordSetupUIAssets",
srcs = glob(["PasswordSetupUIImages.xcassets/**"]), srcs = glob(["PasswordSetupUIImages.xcassets/**"]),
visibility = ["//visibility:public"],
) )
swift_library( swift_library(
@ -18,10 +20,6 @@ swift_library(
srcs = glob([ srcs = glob([
"Sources/**/*.swift", "Sources/**/*.swift",
]), ]),
data = [
":PasswordSetupUIResources",
":PasswordSetupUIAssets",
],
deps = [ deps = [
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit", "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
"//submodules/AsyncDisplayKit:AsyncDisplayKit", "//submodules/AsyncDisplayKit:AsyncDisplayKit",

View File

@ -6,11 +6,13 @@ filegroup(
"Sounds/**/*", "Sounds/**/*",
"Resources/**/*", "Resources/**/*",
], exclude = ["Sounds/**/.*", "Resources/**/.*"]), ], exclude = ["Sounds/**/.*", "Resources/**/.*"]),
visibility = ["//visibility:public"],
) )
filegroup( filegroup(
name = "TelegramUIAssets", name = "TelegramUIAssets",
srcs = glob(["Images.xcassets/**"]), srcs = glob(["Images.xcassets/**"]),
visibility = ["//visibility:public"],
) )
swift_library( swift_library(
@ -19,10 +21,6 @@ swift_library(
srcs = glob([ srcs = glob([
"Sources/**/*.swift", "Sources/**/*.swift",
]), ]),
data = [
":TelegramUIResources",
":TelegramUIAssets",
],
deps = [ deps = [
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit", "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
"//submodules/SSignalKit/SSignalKit:SSignalKit", "//submodules/SSignalKit/SSignalKit:SSignalKit",

View File

@ -5,11 +5,13 @@ filegroup(
srcs = glob([ srcs = glob([
"Resources/**/*", "Resources/**/*",
], exclude = ["Resources/**/.*"]), ], exclude = ["Resources/**/.*"]),
visibility = ["//visibility:public"],
) )
filegroup( filegroup(
name = "WalletUIAssets", name = "WalletUIAssets",
srcs = glob(["WalletImages.xcassets/**"]), srcs = glob(["WalletImages.xcassets/**"]),
visibility = ["//visibility:public"],
) )
swift_library( swift_library(
@ -18,10 +20,6 @@ swift_library(
srcs = glob([ srcs = glob([
"Sources/**/*.swift", "Sources/**/*.swift",
]), ]),
data = [
":WalletUIResources",
":WalletUIAssets",
],
deps = [ deps = [
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit", "//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
"//submodules/AsyncDisplayKit:AsyncDisplayKit", "//submodules/AsyncDisplayKit:AsyncDisplayKit",