diff --git a/.buckconfig b/.buckconfig index 0323a3127b..5c472b0f9e 100644 --- a/.buckconfig +++ b/.buckconfig @@ -1,14 +1,14 @@ [cxx] - default_platform = iphoneos-armv7 - cflags = -fmodules -fobjc-arc -D BUCK -D DEBUG -w -fno-optimize-sibling-calls $(config custom.other_cflags) - cxxflags = -fobjc-arc -std=c++14 -D BUCK -D DEBUG -w -fno-optimize-sibling-calls $(config custom.other_cxxflags) + default_platform = iphonesimulator-x86_64 + cflags = -g -fmodules -fobjc-arc -D BUCK -w $(config custom.other_cflags) + cxxflags = -fobjc-arc -std=c++14 -D DEBUG -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 -dead_strip -Xlinker -no_deduplicate $(config custom.other_cxxflags) + ldflags = -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime $(config custom.other_cxxflags) [swift] version = 5 - compiler_flags = -DBUCK -enable-testing -O -whole-module-optimization -suppress-warnings -Xcc -fno-optimize-sibling-calls $(config custom.other_swift_compiler_flags) + compiler_flags = -DBUCK $(config custom.optimization) $(config custom.config_swift_compiler_flags) $(config custom.other_swift_compiler_flags) use_filelist = true [apple] @@ -19,8 +19,7 @@ iphoneos_target_sdk_version = 8.0 provisioning_profile_read_command = security cms -Di xctool_default_destination_specifier = platform=iOS Simulator,OS=latest - ;provisioning_profile_search_path = ./ - ;xctool_path = tools/xctool/bin/xctool + xctool_path = tools/xctool/bin/xctool [parser] polyglot_parsing_enabled = true @@ -35,4 +34,14 @@ .git, \ [build] - thread_core_ratio = 2.0 + threads = 12 + +[custom] + config = debug + optimization = -Onone + config_swift_compiler_flags = -DDEBUG -enable-testing -g + code_coverage_cflags = -fprofile-instr-generate -fcoverage-mapping + code_coverage_cxxflags = -fprofile-instr-generate -fcoverage-mapping + code_coverage_ldflags = -fprofile-instr-generate + code_coverage_swift_compiler_flags = -profile-generate -profile-coverage-mapping + \ No newline at end of file diff --git a/.gitignore b/.gitignore index 51c2c450ed..2294d1d1bc 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ AppBinary.xcworkspace/* Project.xcodeproj/* Watch/Watch.xcodeproj/* AppBundle.xcworkspace/* +tools/buck diff --git a/App/App.xcodeproj/project.pbxproj b/App/App.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..d63822a561 --- /dev/null +++ b/App/App.xcodeproj/project.pbxproj @@ -0,0 +1,672 @@ + + + + + archiveVersion + 1 + classes + + + objectVersion + 46 + objects + + 1DD70E29001F47FB00000000 + + isa + PBXFileReference + name + BUCK + path + BUCK + sourceTree + SOURCE_ROOT + explicitFileType + text.script.python + + 1DD70E296ABF6A1200000000 + + isa + PBXFileReference + name + Empty.swift + path + SupportFiles/Empty.swift + sourceTree + SOURCE_ROOT + + 1DD70E2906C06BEE00000000 + + isa + PBXFileReference + name + Info.plist + path + Info.plist + sourceTree + ]]> + explicitFileType + text.plist + + B401C979EAB5339800000000 + + isa + PBXGroup + name + Sources + sourceTree + ]]> + children + + 1DD70E296ABF6A1200000000 + 1DD70E2906C06BEE00000000 + + + B401C9790001020100000000 + + isa + PBXGroup + name + App + sourceTree + ]]> + children + + 1DD70E29001F47FB00000000 + B401C979EAB5339800000000 + + + 1DD70E29001F47FB00000001 + + isa + PBXFileReference + name + BUCK + path + BUCK + sourceTree + SOURCE_ROOT + explicitFileType + text.script.python + + 1DD70E295BBE1B9900000000 + + isa + PBXFileReference + name + Temp.swift + path + Sources/Temp.swift + sourceTree + SOURCE_ROOT + + 1DD70E298FA05E8C00000000 + + isa + PBXFileReference + name + TempMain.m + path + Sources/TempMain.m + sourceTree + SOURCE_ROOT + lastKnownFileType + sourcecode.c.objc + + B401C979EAB5339800000001 + + isa + PBXGroup + name + Sources + sourceTree + ]]> + children + + 1DD70E295BBE1B9900000000 + 1DD70E298FA05E8C00000000 + + + B401C979C43AA77A00000000 + + isa + PBXGroup + name + AppLibrary + sourceTree + ]]> + children + + 1DD70E29001F47FB00000001 + B401C979EAB5339800000001 + + + 1DD70E29898E549400000000 + + isa + PBXFileReference + name + App-Debug.xcconfig + path + ../buck-out/gen/App/App-Debug.xcconfig + sourceTree + SOURCE_ROOT + explicitFileType + text.xcconfig + + 1DD70E29446E16FE00000000 + + isa + PBXFileReference + name + App-Profile.xcconfig + path + ../buck-out/gen/App/App-Profile.xcconfig + sourceTree + SOURCE_ROOT + explicitFileType + text.xcconfig + + 1DD70E29B804C26000000000 + + isa + PBXFileReference + name + App-Release.xcconfig + path + ../buck-out/gen/App/App-Release.xcconfig + sourceTree + SOURCE_ROOT + explicitFileType + text.xcconfig + + 1DD70E294E27EDFB00000000 + + isa + PBXFileReference + name + AppLibrary-Debug.xcconfig + path + ../buck-out/gen/App/AppLibrary-Debug.xcconfig + sourceTree + SOURCE_ROOT + explicitFileType + text.xcconfig + + 1DD70E294906F2A500000000 + + isa + PBXFileReference + name + AppLibrary-Profile.xcconfig + path + ../buck-out/gen/App/AppLibrary-Profile.xcconfig + sourceTree + SOURCE_ROOT + explicitFileType + text.xcconfig + + 1DD70E29BC9D9E0700000000 + + isa + PBXFileReference + name + AppLibrary-Release.xcconfig + path + ../buck-out/gen/App/AppLibrary-Release.xcconfig + sourceTree + SOURCE_ROOT + explicitFileType + text.xcconfig + + B401C9792F7F325000000000 + + isa + PBXGroup + name + Buck (Do Not Modify) + sourceTree + ]]> + children + + 1DD70E29898E549400000000 + 1DD70E29446E16FE00000000 + 1DD70E29B804C26000000000 + 1DD70E294E27EDFB00000000 + 1DD70E294906F2A500000000 + 1DD70E29BC9D9E0700000000 + + + B401C979B781F65D00000000 + + isa + PBXGroup + name + Configurations + sourceTree + ]]> + children + + B401C9792F7F325000000000 + + + 1DD70E297ADFB9F200000000 + + isa + PBXFileReference + name + libAppLibrary.a + path + libAppLibrary.a + sourceTree + BUILT_PRODUCTS_DIR + explicitFileType + archive.ar + + 1DD70E29A59C927400000000 + + isa + PBXFileReference + name + libEmoji.a + path + libEmoji.a + sourceTree + BUILT_PRODUCTS_DIR + explicitFileType + archive.ar + + 1DD70E29C4DF1A6D00000000 + + isa + PBXFileReference + name + libMtProtoKit.a + path + libMtProtoKit.a + sourceTree + BUILT_PRODUCTS_DIR + explicitFileType + archive.ar + + B401C97968022A5500000000 + + isa + PBXGroup + name + Frameworks + sourceTree + ]]> + children + + 1DD70E297ADFB9F200000000 + 1DD70E29A59C927400000000 + 1DD70E29C4DF1A6D00000000 + + + 1DD70E2933D47CB400000000 + + isa + PBXFileReference + name + App.app + path + App.app + sourceTree + BUILT_PRODUCTS_DIR + explicitFileType + wrapper.application + + 1DD70E297ADFB9F200000001 + + isa + PBXFileReference + name + libAppLibrary.a + path + libAppLibrary.a + sourceTree + BUILT_PRODUCTS_DIR + explicitFileType + archive.ar + + B401C979C806358400000000 + + isa + PBXGroup + name + Products + sourceTree + ]]> + children + + 1DD70E2933D47CB400000000 + 1DD70E297ADFB9F200000001 + + + B401C979EFB6AC4600000000 + + isa + PBXGroup + name + mainGroup + sourceTree + ]]> + children + + B401C9790001020100000000 + B401C979C43AA77A00000000 + B401C979B781F65D00000000 + B401C97968022A5500000000 + B401C979C806358400000000 + + + E7A30F046ABF6A1200000000 + + isa + PBXBuildFile + fileRef + 1DD70E296ABF6A1200000000 + + 1870857F0000000000000000 + + isa + PBXSourcesBuildPhase + files + + E7A30F046ABF6A1200000000 + + + E7A30F047ADFB9F200000000 + + isa + PBXBuildFile + fileRef + 1DD70E297ADFB9F200000000 + + E7A30F04A59C927400000000 + + isa + PBXBuildFile + fileRef + 1DD70E29A59C927400000000 + + E7A30F04C4DF1A6D00000000 + + isa + PBXBuildFile + fileRef + 1DD70E29C4DF1A6D00000000 + + 4F426D880000000000000000 + + isa + PBXFrameworksBuildPhase + files + + E7A30F047ADFB9F200000000 + E7A30F04A59C927400000000 + E7A30F04C4DF1A6D00000000 + + + 4952437303EDA63300000000 + + isa + XCBuildConfiguration + name + Debug + buildSettings + + + baseConfigurationReference + 1DD70E29898E549400000000 + + 4952437350C7218900000000 + + isa + XCBuildConfiguration + name + Profile + buildSettings + + + baseConfigurationReference + 1DD70E29446E16FE00000000 + + 49524373A439BFE700000000 + + isa + XCBuildConfiguration + name + Release + buildSettings + + + baseConfigurationReference + 1DD70E29B804C26000000000 + + 218C37090000000000000000 + + isa + XCConfigurationList + buildConfigurations + + 4952437303EDA63300000000 + 4952437350C7218900000000 + 49524373A439BFE700000000 + + defaultConfigurationIsVisible + + + E66DC04E0001020100000000 + + isa + PBXNativeTarget + name + App + productName + App + productReference + 1DD70E2933D47CB400000000 + productType + com.apple.product-type.application + dependencies + + + buildPhases + + 1870857F0000000000000000 + 4F426D880000000000000000 + + buildConfigurationList + 218C37090000000000000000 + + E7A30F045BBE1B9900000000 + + isa + PBXBuildFile + fileRef + 1DD70E295BBE1B9900000000 + + E7A30F048FA05E8C00000000 + + isa + PBXBuildFile + fileRef + 1DD70E298FA05E8C00000000 + + 1870857F0000000000000001 + + isa + PBXSourcesBuildPhase + files + + E7A30F045BBE1B9900000000 + E7A30F048FA05E8C00000000 + + + E7A30F04A59C927400000001 + + isa + PBXBuildFile + fileRef + 1DD70E29A59C927400000000 + + FAF5FAC90000000000000000 + + isa + PBXCopyFilesBuildPhase + files + + E7A30F04A59C927400000001 + + name + Fake Swift Dependencies (Copy Files Phase) + runOnlyForDeploymentPostprocessing + 1 + dstSubfolderSpec + 16 + dstPath + + + 4952437303EDA63300000001 + + isa + XCBuildConfiguration + name + Debug + buildSettings + + + baseConfigurationReference + 1DD70E294E27EDFB00000000 + + 4952437350C7218900000001 + + isa + XCBuildConfiguration + name + Profile + buildSettings + + + baseConfigurationReference + 1DD70E294906F2A500000000 + + 49524373A439BFE700000001 + + isa + XCBuildConfiguration + name + Release + buildSettings + + + baseConfigurationReference + 1DD70E29BC9D9E0700000000 + + 218C37090000000000000001 + + isa + XCConfigurationList + buildConfigurations + + 4952437303EDA63300000001 + 4952437350C7218900000001 + 49524373A439BFE700000001 + + defaultConfigurationIsVisible + + + E66DC04EC43AA77A00000000 + + isa + PBXNativeTarget + name + AppLibrary + productName + AppLibrary + productReference + 1DD70E297ADFB9F200000001 + productType + com.apple.product-type.library.static + dependencies + + + buildPhases + + 1870857F0000000000000001 + FAF5FAC90000000000000000 + + buildConfigurationList + 218C37090000000000000001 + + 4952437303EDA63300000002 + + isa + XCBuildConfiguration + name + Debug + buildSettings + + + + 4952437350C7218900000002 + + isa + XCBuildConfiguration + name + Profile + buildSettings + + + + 49524373A439BFE700000002 + + isa + XCBuildConfiguration + name + Release + buildSettings + + + + 218C37090000000000000002 + + isa + XCConfigurationList + buildConfigurations + + 4952437303EDA63300000002 + 4952437350C7218900000002 + 49524373A439BFE700000002 + + defaultConfigurationIsVisible + + + 96C847930001020100000000 + + isa + PBXProject + mainGroup + B401C979EFB6AC4600000000 + targets + + E66DC04E0001020100000000 + E66DC04EC43AA77A00000000 + + buildConfigurationList + 218C37090000000000000002 + compatibilityVersion + Xcode 3.2 + attributes + + LastUpgradeCheck + 9999 + + + + rootObject + 96C847930001020100000000 + + \ No newline at end of file diff --git a/App/App.xcodeproj/xcshareddata/xcschemes/App.xcscheme b/App/App.xcodeproj/xcshareddata/xcschemes/App.xcscheme new file mode 100644 index 0000000000..6ca885fee6 --- /dev/null +++ b/App/App.xcodeproj/xcshareddata/xcschemes/App.xcscheme @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/App/App.xcworkspace/buck-project.meta.json b/App/App.xcworkspace/buck-project.meta.json new file mode 100644 index 0000000000..d321a6041c --- /dev/null +++ b/App/App.xcworkspace/buck-project.meta.json @@ -0,0 +1 @@ +{"required-targets":["//submodules/MtProtoKit:openssl_libs"],"xcconfig-paths":["buck-out/gen/App/App-Debug.xcconfig","buck-out/gen/App/App-Profile.xcconfig","buck-out/gen/App/App-Release.xcconfig","buck-out/gen/App/AppLibrary-Debug.xcconfig","buck-out/gen/App/AppLibrary-Profile.xcconfig","buck-out/gen/App/AppLibrary-Release.xcconfig","buck-out/gen/submodules/Emoji/Emoji-Debug.xcconfig","buck-out/gen/submodules/Emoji/Emoji-Profile.xcconfig","buck-out/gen/submodules/Emoji/Emoji-Release.xcconfig","buck-out/gen/submodules/MtProtoKit/MtProtoKit-Debug.xcconfig","buck-out/gen/submodules/MtProtoKit/MtProtoKit-Profile.xcconfig","buck-out/gen/submodules/MtProtoKit/MtProtoKit-Release.xcconfig","buck-out/gen/submodules/MtProtoKit/openssl-Debug.xcconfig","buck-out/gen/submodules/MtProtoKit/openssl-Profile.xcconfig","buck-out/gen/submodules/MtProtoKit/openssl-Release.xcconfig"],"copy-in-xcode":[]} \ No newline at end of file diff --git a/App/App.xcworkspace/contents.xcworkspacedata b/App/App.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000..9d9843e511 --- /dev/null +++ b/App/App.xcworkspace/contents.xcworkspacedata @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000000..18d981003d --- /dev/null +++ b/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/App/App.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/App/App.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000000..115f338bb5 --- /dev/null +++ b/App/App.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + \ No newline at end of file diff --git a/App/App.xcworkspace/xcshareddata/xcschemes/App.xcscheme b/App/App.xcworkspace/xcshareddata/xcschemes/App.xcscheme new file mode 100644 index 0000000000..ca1f27f58a --- /dev/null +++ b/App/App.xcworkspace/xcshareddata/xcschemes/App.xcscheme @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/App/BUCK b/App/BUCK new file mode 100644 index 0000000000..a1929143a4 --- /dev/null +++ b/App/BUCK @@ -0,0 +1,91 @@ +load("//Config:configs.bzl", "app_binary_configs", "library_configs", "pretty", "info_plist_substitutions", "bundle_identifier", "DEVELOPMENT_LANGUAGE") +load("//Config:buck_rule_macros.bzl", "apple_lib", "framework_binary_dependencies", "framework_bundle_dependencies") + +'''apple_asset_catalog( + name = "ExampleAppAssets", + visibility = ["//App:"], + app_icon = "AppIcon", + dirs = ["Assets.xcassets"], +) + +app_tests = [ + ":UnitTests", + ":UnitTestsWithHostApp", +] + +ui_tests = [ + ":XCUITests", +]''' + +static_library_dependencies = [ +] +framework_dependencies = [ + '//submodules/MtProtoKit:MtProtoKit', + '//submodules/Emoji:Emoji', +] + +# Build Phase scripts need to be added as dependencies. +# These only get executed when building with Xcode, not Buck. +build_phase_scripts = [ +] + +apple_library( + name = "AppLibrary", + visibility = [ + "//App:", + "//App/...", + ], + configs = library_configs(), + swift_version = native.read_config('swift', 'version'), + srcs = [ + "Sources/TempMain.m", + "Sources/Temp.swift" + ], + deps = [ + ] + + static_library_dependencies + + framework_binary_dependencies(framework_dependencies), +) + +apple_binary( + name = "AppBinary", + visibility = [ + "//App:", + "//App/...", + ], + configs = app_binary_configs("App"), + swift_version = native.read_config('swift', 'version'), + srcs = [ + "SupportFiles/Empty.swift", + ], + deps = [ + ":AppLibrary", + ], +) + +xcode_workspace_config( + name = "workspace", + workspace_name = "App", + src_target = ":App", +) + +apple_bundle( + name = "App", + visibility = [ + "//App:", + ], + extension = "app", + binary = ":AppBinary", + product_name = "App", + info_plist = "Info.plist", + info_plist_substitutions = info_plist_substitutions("App"), + deps = [ + ] + + framework_bundle_dependencies(framework_dependencies), +) + +apple_package( + name = "AppPackage", + bundle = ":App", +) + diff --git a/BUCK b/App/BUCK_old similarity index 80% rename from BUCK rename to App/BUCK_old index b1443dbcae..e654b0b13c 100644 --- a/BUCK +++ b/App/BUCK_old @@ -1,4 +1,54 @@ -load('//tools:buck_utils.bzl', 'config_with_updated_linker_flags', 'configs_with_config', 'combined_config') +load('//tools:targets.bzl', 'app_target') + +BUILD_NUMBER = '2000' +info_plist_substitutions = { + 'DEVELOPMENT_LANGUAGE': 'en-us', + 'APP_NAME': 'Telegram', + 'EXECUTABLE_NAME': 'Telegram', + 'PRODUCT_BUNDLE_IDENTIFIER': 'org.telegram.Telegram-iOS', + 'PRODUCT_NAME': 'Telegram', + 'APP_SPECIFIC_URL_SCHEME': 'tgapp', + 'VERSION': '5.11', + 'BUILD_NUMBER': BUILD_NUMBER, +} + +app_target( + name = 'App', + srcs = ['TempMain.m', 'Temp.swift'], + deps = [ + '//submodules/MtProtoKit:MtProtoKit', + #'//submodules/Emoji:Emoji', + #'//submodules/MtProtoKit:MtProtoKitFramework', + #'//submodules/Emoji:EmojiFramework', + ], +) + +apple_bundle( + name = 'AppBundle', + visibility = [ + 'PUBLIC', + ], + extension = 'app', + binary = ':AppBinary', + product_name = 'Telegram', + info_plist = 'Info.plist', + #info_plist_substitutions = info_plist_substitutions, + deps = [ + ] +) + +apple_package( + name = 'AppPackage', + bundle = ':AppBundle', +) + +xcode_workspace_config( + name = "workspace", + workspace_name = "App", + src_target = ":AppBundle", +) + +'''load('//tools:buck_utils.bzl', 'config_with_updated_linker_flags', 'configs_with_config', 'combined_config') load('//tools:buck_defs.bzl', 'SHARED_CONFIGS') # Adding `-all_load` to our binaries works around https://bugs.swift.org/browse/SR-6004. See the @@ -180,3 +230,5 @@ apple_package( name = 'AppPackage', bundle = ':AppBundle', ) +''' + diff --git a/App/Info.plist b/App/Info.plist new file mode 100644 index 0000000000..64ef73c0b6 --- /dev/null +++ b/App/Info.plist @@ -0,0 +1,52 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + App + CFBundleIconFiles + + Icon.png + Icon@2x.png + Icon-72.png + Icon-72@2x.png + Icon-Small-50.png + Icon-Small-50@2x.png + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/App/Sources/Empty.swift b/App/Sources/Empty.swift new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/App/Sources/Empty.swift @@ -0,0 +1 @@ + diff --git a/App/Sources/Temp.swift b/App/Sources/Temp.swift new file mode 100644 index 0000000000..8d02a25460 --- /dev/null +++ b/App/Sources/Temp.swift @@ -0,0 +1,11 @@ +import Foundation +import Emoji + +@objc(AppDelegate) +public final class AppDelegate: NSObject { + override init() { + super.init() + + print("OK".isSingleEmoji) + } +} diff --git a/App/Sources/TempMain.m b/App/Sources/TempMain.m new file mode 100644 index 0000000000..1a5dcd2485 --- /dev/null +++ b/App/Sources/TempMain.m @@ -0,0 +1,6 @@ +//#import + +int main(int argc, const char **argv) { + //MTProto *mtProto = [[MTProto alloc] init]; + return 0; +} diff --git a/App/SupportFiles/Empty.swift b/App/SupportFiles/Empty.swift new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/App/SupportFiles/Empty.swift @@ -0,0 +1 @@ + diff --git a/Config/BUCK b/Config/BUCK new file mode 100644 index 0000000000..babd7d22cd --- /dev/null +++ b/Config/BUCK @@ -0,0 +1,10 @@ +# This file can be depended upon for any apple_test_lib rules. +genrule( + name = "test_info_plist", + visibility = ["PUBLIC"], + srcs = [ + "BuckSupportFiles/TestInfo.plist", + ], + out = 'TestInfo.plist', + cmd = 'cp $SRCDIR/BuckSupportFiles/TestInfo.plist $OUT', +) diff --git a/Config/BuckSupportFiles/TestInfo.plist b/Config/BuckSupportFiles/TestInfo.plist new file mode 100644 index 0000000000..6c40a6cd0c --- /dev/null +++ b/Config/BuckSupportFiles/TestInfo.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/Config/buck_rule_macros.bzl b/Config/buck_rule_macros.bzl new file mode 100644 index 0000000000..9567d6f76d --- /dev/null +++ b/Config/buck_rule_macros.bzl @@ -0,0 +1,232 @@ +load("//Config:configs.bzl", "library_configs", "framework_library_configs", "info_plist_substitutions") + +def apple_third_party_lib(**kwargs): + apple_lib( + warning_as_error = False, + suppress_warnings = True, + **kwargs + ) + +def apple_lib( + name, + visibility = ["PUBLIC"], + srcs = [], + headers = [], + exported_headers = [], + extra_xcode_files = [], + deps = [], + frameworks = [], + swift_version = None, + modular = True, + compiler_flags = None, + swift_compiler_flags = None, + warning_as_error = False, + suppress_warnings = False, + framework = False): + swift_version = swift_version or native.read_config('swift', 'version') + compiler_flags = compiler_flags or [] + swift_compiler_flags = swift_compiler_flags or [] + + if native.read_config("xcode", "beta") == "True": + warning_as_error = False + + if warning_as_error: + compiler_flags.append("-Werror") + swift_compiler_flags.append("-warnings-as-errors") + elif suppress_warnings: + compiler_flags.append("-w") + swift_compiler_flags.append("-suppress-warnings") + + if framework: + if native.read_config("custom", "mode") == "project": + native.apple_library( + name = name, + srcs = srcs, + header_namespace = name, + headers = headers, + exported_headers = exported_headers, + deps = deps, + extra_xcode_files = extra_xcode_files, + frameworks = frameworks, + visibility = visibility, + swift_version = swift_version, + configs = framework_library_configs(name), + modular = modular, + compiler_flags = compiler_flags, + swift_compiler_flags = swift_compiler_flags, + preferred_linkage = "shared", + link_style = "static", + linker_flags = ["-Wl,-install_name,@rpath/lib%s.dylib" % (name)], + ) + '''native.apple_bundle( + name = name + "Framework", + visibility = visibility, + binary = ":" + name + "#shared", + extension = "framework", + info_plist = "Info.plist", + info_plist_substitutions = info_plist_substitutions(name), + )''' + else: + native.apple_library( + name = name, + srcs = srcs, + header_namespace = name, + headers = headers, + exported_headers = exported_headers, + deps = deps, + extra_xcode_files = extra_xcode_files, + frameworks = frameworks, + visibility = visibility, + swift_version = swift_version, + configs = framework_library_configs(name), + modular = modular, + compiler_flags = compiler_flags, + swift_compiler_flags = swift_compiler_flags, + #preferred_linkage = "shared", + #link_style = "static", + #linker_flags = ["-Wl,-install_name,@rpath/%sFramework.framework/%sFramework" % (name, name)], + ) + native.apple_bundle( + name = name + "Framework", + visibility = visibility, + binary = ":" + name + "#shared", + extension = "framework", + info_plist = "Info.plist", + info_plist_substitutions = info_plist_substitutions(name), + ) + else: + native.apple_library( + name = name, + srcs = srcs, + headers = headers, + exported_headers = exported_headers, + deps = deps, + visibility = visibility, + swift_version = swift_version, + configs = library_configs(), + modular = modular, + compiler_flags = compiler_flags, + swift_compiler_flags = swift_compiler_flags, + ) + +def static_library( + name, + visibility = ["PUBLIC"], + has_cpp = False, + srcs = [], + headers = [], + exported_headers = [], + extra_xcode_files = [], + deps = [], + frameworks = [], + info_plist = None, + info_plist_substitutions = {}, + modular = True, + compiler_flags = None, + swift_compiler_flags = None, + warning_as_error = False, + suppress_warnings = True): + lib = apple_cxx_lib if has_cpp else apple_lib + lib( + name = name, + srcs = srcs, + exported_headers = exported_headers, + headers = headers, + modular = modular, + compiler_flags = compiler_flags, + swift_compiler_flags = swift_compiler_flags, + extra_xcode_files = extra_xcode_files, + deps = deps, + frameworks = frameworks, + warning_as_error = warning_as_error, + suppress_warnings = suppress_warnings + ) + +def framework( + name, + visibility = ["PUBLIC"], + has_cpp = False, + srcs = [], + headers = [], + exported_headers = [], + extra_xcode_files = [], + deps = [], + frameworks = [], + info_plist = None, + info_plist_substitutions = {}, + modular = True, + compiler_flags = None, + swift_compiler_flags = None, + warning_as_error = False, + suppress_warnings = True): + lib = apple_cxx_lib if has_cpp else apple_lib + lib( + name = name, + srcs = srcs, + exported_headers = exported_headers, + headers = headers, + modular = modular, + compiler_flags = compiler_flags, + swift_compiler_flags = swift_compiler_flags, + extra_xcode_files = extra_xcode_files, + deps = deps, + frameworks = frameworks, + warning_as_error = warning_as_error, + suppress_warnings = suppress_warnings, + framework = True + ) + + +CXX_SRC_EXT = ["mm", "cpp", "S"] +def apple_cxx_lib( + srcs = [], + additional_exported_linker_flags = [], + **kwargs): + c_srcs, cxx_srcs = [], [] + + cxx_compile_flags = native.read_config("cxx", "cxxflags").split(" ") + cxx_compile_flags.append("-w") + + for file_ in srcs: + if file_.split(".")[-1] in CXX_SRC_EXT: + cxx_srcs.append((file_, cxx_compile_flags)) + else: + c_srcs.append(file_) + apple_lib( + srcs = c_srcs + cxx_srcs, + exported_linker_flags = [ + "-lc++", + "-lz" + ] + additional_exported_linker_flags, + **kwargs + ) + +def apple_cxx_third_party_library( + **kwargs): + apple_cxx_lib( + warning_as_error = False, + suppress_warnings = True, + **kwargs + ) + +def framework_binary_dependencies(names): + result = [] + if native.read_config("custom", "mode") == "project": + for name in names: + result.append(name + "#shared") + else: + for name in names: + result.append(name + "") + return result + +def framework_bundle_dependencies(names): + result = [] + if native.read_config("custom", "mode") == "project": + for name in names: + #result.append(name + "Framework") + pass + else: + for name in names: + #result.append(name + "Framework") + pass + return result diff --git a/Config/configs.bzl b/Config/configs.bzl new file mode 100644 index 0000000000..db751cd97c --- /dev/null +++ b/Config/configs.bzl @@ -0,0 +1,104 @@ +load("//Config:utils.bzl", "config_with_updated_linker_flags", "configs_with_config") + +DEVELOPMENT_LANGUAGE = "en" + +def merge_dict(a, b): + d = {} + d.update(a) + d.update(b) + return d + +def pretty(dict, current = ""): + current = "\n" + indent = 0 + for key, value in dict.items(): + current = current + str(key) + ": " + if type(value) == type({}): + current = current + "\n" + indent = 1 + for key2, value2 in value.items(): + current = current + "\t" * indent + str(key2) + current = current + ": " + str(value2) + "\n" + else: + current = current + "\t" * (indent + 1) + str(value) + "\n" + + return current + +SHARED_CONFIGS = { + "IPHONEOS_DEPLOYMENT_TARGET": "8.0", + "SDKROOT": "iphoneos", + "GCC_OPTIMIZATION_LEVEL": "0", + "SWIFT_WHOLE_MODULE_OPTIMIZATION": "NO", + "ONLY_ACTIVE_ARCH": "YES", + "LD_RUNPATH_SEARCH_PATHS": "@executable_path/Frameworks", +} + +def optimization_config(): + return {"SWIFT_OPTIMIZATION_LEVEL": native.read_config('custom', 'optimization')} + +# Adding `-all_load` to our binaries works around https://bugs.swift.org/browse/SR-6004. See the +# longer comment in `ViewController.swift` for more details. +ALL_LOAD_LINKER_FLAG = "-all_load" + +def bundle_identifier(name): + return "org.Telegram.%s" % name + +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": lib_specific_config, + } + return configs + +def framework_library_configs(name): + 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", + "PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(name), + } + + 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": lib_specific_config, + } + return configs + +def app_binary_configs(name): + binary_specific_config = { + "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES": "YES", + "DEVELOPMENT_LANGUAGE": DEVELOPMENT_LANGUAGE, + "PRODUCT_BUNDLE_IDENTIFIER": bundle_identifier(name), + } + binary_config = merge_dict(SHARED_CONFIGS, binary_specific_config) + binary_config = merge_dict(binary_config, optimization_config()) + binary_config = config_with_updated_linker_flags(binary_config, ALL_LOAD_LINKER_FLAG) + return configs_with_config(binary_config) + +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 diff --git a/Config/utils.bzl b/Config/utils.bzl new file mode 100644 index 0000000000..bb2b6c70f4 --- /dev/null +++ b/Config/utils.bzl @@ -0,0 +1,35 @@ +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 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..b7bb196560 --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ + +.PHONY : install_buck build targets audit project clean + +# Use local version of Buck +BUCK=tools/buck + +log: + echo "Make" + +install_buck: + curl https://jitpack.io/com/github/airbnb/buck/457ebb73fcd8f86be0112dc74948d022b6969dbd/buck-457ebb73fcd8f86be0112dc74948d022b6969dbd.pex --output tools/buck + chmod u+x tools/buck + +build: + $(BUCK) build //App:AppPackage + +build_verbose: + $(BUCK) build //App:AppPackage --verbose 8 + +targets: + $(BUCK) targets //... + +audit: + $(BUCK) audit rules BUCK > Config/Gen/App-BUCK.py + +kill_xcode: + killall Xcode || true + killall Simulator || true + +clean: kill_xcode + sh clean.sh + +project: clean + $(BUCK) project //App:workspace --config custom.mode=project + open App/App.xcworkspace diff --git a/clean.sh b/clean.sh new file mode 100644 index 0000000000..ff128a66ba --- /dev/null +++ b/clean.sh @@ -0,0 +1,4 @@ +rm -rf App/App.xcodeproj App/App.xcworkspace +rm -rf submodules/MtProtoKit/MtProtoKit.xcodeproj +rm -rf submodules/Emoji/Emoji.xcodeproj +rm -rf buck-out \ No newline at end of file diff --git a/log.txt b/log.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/submodules/Emoji/BUCK b/submodules/Emoji/BUCK new file mode 100644 index 0000000000..06e08005ea --- /dev/null +++ b/submodules/Emoji/BUCK @@ -0,0 +1,14 @@ +load("//Config:buck_rule_macros.bzl", "static_library", "framework") + +framework( + name = "Emoji", + srcs = glob([ + "Sources/*.swift", + ]), + deps = [ + ], + frameworks = [ + "$SDKROOT/System/Library/Frameworks/Foundation.framework", + "$SDKROOT/System/Library/Frameworks/CoreText.framework", + ], +) diff --git a/submodules/Emoji/Emoji.d b/submodules/Emoji/Emoji.d new file mode 100644 index 0000000000..4d85181083 --- /dev/null +++ b/submodules/Emoji/Emoji.d @@ -0,0 +1,4 @@ +/Users/peter/build/telegram-temp/telegram-ios/submodules/Emoji/Emoji.o : /Users/peter/build/telegram-temp/telegram-ios/submodules/Emoji/Sources/EmojiUtils.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/peter/build/telegram-temp/telegram-ios/submodules/Emoji/../../buck-out/gen/_p/dSOeJSgEqx-pub/Emoji/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes +/Users/peter/Library/Developer/Xcode/DerivedData/AppBundle-eiyupsfslxdyqrgylgpylqedpick/Build/Intermediates.noindex/Emoji.build/Debug-iphonesimulator/EmojiFramework.build/Objects-normal/x86_64/Emoji.swiftmodule : /Users/peter/build/telegram-temp/telegram-ios/submodules/Emoji/Sources/EmojiUtils.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/peter/build/telegram-temp/telegram-ios/submodules/Emoji/../../buck-out/gen/_p/dSOeJSgEqx-pub/Emoji/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes +/Users/peter/Library/Developer/Xcode/DerivedData/AppBundle-eiyupsfslxdyqrgylgpylqedpick/Build/Intermediates.noindex/Emoji.build/Debug-iphonesimulator/EmojiFramework.build/Objects-normal/x86_64/Emoji.swiftdoc : /Users/peter/build/telegram-temp/telegram-ios/submodules/Emoji/Sources/EmojiUtils.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/peter/build/telegram-temp/telegram-ios/submodules/Emoji/../../buck-out/gen/_p/dSOeJSgEqx-pub/Emoji/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes +/Users/peter/Library/Developer/Xcode/DerivedData/AppBundle-eiyupsfslxdyqrgylgpylqedpick/Build/Intermediates.noindex/Emoji.build/Debug-iphonesimulator/EmojiFramework.build/Objects-normal/x86_64/EmojiFramework-Swift.h : /Users/peter/build/telegram-temp/telegram-ios/submodules/Emoji/Sources/EmojiUtils.swift /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/ObjectiveC.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Darwin.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Foundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreFoundation.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/CoreGraphics.swiftmodule /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Swift.swiftmodule /Users/peter/build/telegram-temp/telegram-ios/submodules/Emoji/../../buck-out/gen/_p/dSOeJSgEqx-pub/Emoji/module.modulemap /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/usr/include/objc/ObjectiveC.apinotes /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/Dispatch.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/usr/include/Darwin.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.apinotes /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.4.sdk/System/Library/Frameworks/Security.framework/Headers/Security.apinotes diff --git a/submodules/Emoji/Emoji.o b/submodules/Emoji/Emoji.o new file mode 100644 index 0000000000..ae870d4386 Binary files /dev/null and b/submodules/Emoji/Emoji.o differ diff --git a/submodules/Emoji/Emoji.xcodeproj/project.pbxproj b/submodules/Emoji/Emoji.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..b9c4156b4b --- /dev/null +++ b/submodules/Emoji/Emoji.xcodeproj/project.pbxproj @@ -0,0 +1,327 @@ + + + + + archiveVersion + 1 + classes + + + objectVersion + 46 + objects + + 1DD70E29CCF717CF00000000 + + isa + PBXFileReference + name + Emoji-Debug.xcconfig + path + ../../buck-out/gen/submodules/Emoji/Emoji-Debug.xcconfig + sourceTree + SOURCE_ROOT + explicitFileType + text.xcconfig + + 1DD70E2950B2F77900000000 + + isa + PBXFileReference + name + Emoji-Profile.xcconfig + path + ../../buck-out/gen/submodules/Emoji/Emoji-Profile.xcconfig + sourceTree + SOURCE_ROOT + explicitFileType + text.xcconfig + + 1DD70E29C449A2DB00000000 + + isa + PBXFileReference + name + Emoji-Release.xcconfig + path + ../../buck-out/gen/submodules/Emoji/Emoji-Release.xcconfig + sourceTree + SOURCE_ROOT + explicitFileType + text.xcconfig + + B401C9792F7F325000000000 + + isa + PBXGroup + name + Buck (Do Not Modify) + sourceTree + ]]> + children + + 1DD70E29CCF717CF00000000 + 1DD70E2950B2F77900000000 + 1DD70E29C449A2DB00000000 + + + B401C979B781F65D00000000 + + isa + PBXGroup + name + Configurations + sourceTree + ]]> + children + + B401C9792F7F325000000000 + + + 1DD70E29001F47FB00000000 + + isa + PBXFileReference + name + BUCK + path + BUCK + sourceTree + SOURCE_ROOT + explicitFileType + text.script.python + + 1DD70E29C4C3D69000000000 + + isa + PBXFileReference + name + EmojiUtils.swift + path + Sources/EmojiUtils.swift + sourceTree + SOURCE_ROOT + + B401C979EAB5339800000000 + + isa + PBXGroup + name + Sources + sourceTree + ]]> + children + + 1DD70E29C4C3D69000000000 + + + B401C97903FF902600000000 + + isa + PBXGroup + name + Emoji + sourceTree + ]]> + children + + 1DD70E29001F47FB00000000 + B401C979EAB5339800000000 + + + 1DD70E29A59C927400000000 + + isa + PBXFileReference + name + libEmoji.a + path + libEmoji.a + sourceTree + BUILT_PRODUCTS_DIR + explicitFileType + archive.ar + + B401C979C806358400000000 + + isa + PBXGroup + name + Products + sourceTree + ]]> + children + + 1DD70E29A59C927400000000 + + + B401C979EFB6AC4600000000 + + isa + PBXGroup + name + mainGroup + sourceTree + ]]> + children + + B401C979B781F65D00000000 + B401C97903FF902600000000 + B401C979C806358400000000 + + + E7A30F04C4C3D69000000000 + + isa + PBXBuildFile + fileRef + 1DD70E29C4C3D69000000000 + + 1870857F0000000000000000 + + isa + PBXSourcesBuildPhase + files + + E7A30F04C4C3D69000000000 + + + 4952437303EDA63300000000 + + isa + XCBuildConfiguration + name + Debug + buildSettings + + + baseConfigurationReference + 1DD70E29CCF717CF00000000 + + 4952437350C7218900000000 + + isa + XCBuildConfiguration + name + Profile + buildSettings + + + baseConfigurationReference + 1DD70E2950B2F77900000000 + + 49524373A439BFE700000000 + + isa + XCBuildConfiguration + name + Release + buildSettings + + + baseConfigurationReference + 1DD70E29C449A2DB00000000 + + 218C37090000000000000000 + + isa + XCConfigurationList + buildConfigurations + + 4952437303EDA63300000000 + 4952437350C7218900000000 + 49524373A439BFE700000000 + + defaultConfigurationIsVisible + + + E66DC04E03FF902600000000 + + isa + PBXNativeTarget + name + Emoji + productName + Emoji + productReference + 1DD70E29A59C927400000000 + productType + com.apple.product-type.library.static + dependencies + + + buildPhases + + 1870857F0000000000000000 + + buildConfigurationList + 218C37090000000000000000 + + 4952437303EDA63300000001 + + isa + XCBuildConfiguration + name + Debug + buildSettings + + + + 4952437350C7218900000001 + + isa + XCBuildConfiguration + name + Profile + buildSettings + + + + 49524373A439BFE700000001 + + isa + XCBuildConfiguration + name + Release + buildSettings + + + + 218C37090000000000000001 + + isa + XCConfigurationList + buildConfigurations + + 4952437303EDA63300000001 + 4952437350C7218900000001 + 49524373A439BFE700000001 + + defaultConfigurationIsVisible + + + 96C8479303FF902600000000 + + isa + PBXProject + mainGroup + B401C979EFB6AC4600000000 + targets + + E66DC04E03FF902600000000 + + buildConfigurationList + 218C37090000000000000001 + compatibilityVersion + Xcode 3.2 + attributes + + LastUpgradeCheck + 9999 + + + + rootObject + 96C8479303FF902600000000 + + \ No newline at end of file diff --git a/submodules/Emoji/Emoji.xcodeproj/xcshareddata/xcschemes/Emoji.xcscheme b/submodules/Emoji/Emoji.xcodeproj/xcshareddata/xcschemes/Emoji.xcscheme new file mode 100644 index 0000000000..c4eb6b0a83 --- /dev/null +++ b/submodules/Emoji/Emoji.xcodeproj/xcshareddata/xcschemes/Emoji.xcscheme @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/submodules/MtProtoKit/BUCK b/submodules/MtProtoKit/BUCK index 2b928eddb2..9d5d6ad159 100644 --- a/submodules/MtProtoKit/BUCK +++ b/submodules/MtProtoKit/BUCK @@ -1,119 +1,111 @@ -load('//tools:buck_utils.bzl', 'config_with_updated_linker_flags', 'combined_config', 'configs_with_config') -load('//tools:buck_defs.bzl', 'SHARED_CONFIGS', 'EXTENSION_LIB_SPECIFIC_CONFIG') +load("//Config:buck_rule_macros.bzl", "static_library", "framework") genrule( - name = 'openssl_libs', + name = "openssl_libs", srcs = [ - 'openssl/iOS/libcrypto.a', + "openssl/iOS/libcrypto.a", ], - bash = 'mkdir -p $OUT; cp $SRCS $OUT/', - out = 'openssl_libs', - visibility = [ - '//submodules/MtProtoKit:...', - ] + bash = "mkdir -p $OUT; cp $SRCS $OUT/", + out = "openssl_libs", + visibility = ["PUBLIC"] ) apple_library( - name = 'openssl', + name = "openssl", visibility = [ - '//submodules/MtProtoKit:MtProtoKit' + "//submodules/MtProtoKit:MtProtoKit" ], - header_namespace = 'openssl', + header_namespace = "openssl", exported_headers = glob([ - 'openssl/**/*.h', + "openssl/**/*.h", ]), exported_linker_flags = [ - '-lcrypto', - '-L$(location :openssl_libs)', + "-lcrypto", + "-L$(location :openssl_libs)", ], ) -apple_library( - name = 'MtProtoKit', +framework( + name = "MtProtoKit", srcs = glob([ - '*.m', - 'MtProtoKit/*.m', - 'thirdparty/AFNetworking/*.m', - 'thirdparty/AsyncSocket/*.m', + "*.m", + "MtProtoKit/*.m", + "thirdparty/AFNetworking/*.m", + "thirdparty/AsyncSocket/*.m", ]), - configs = configs_with_config(combined_config([SHARED_CONFIGS, EXTENSION_LIB_SPECIFIC_CONFIG])), headers = glob([ - '*.h', - 'MtProtoKit/*.h', - 'thirdparty/AFNetworking/*.h', - 'thirdparty/AsyncSocket/*.h', + "*.h", + "MtProtoKit/*.h", + "thirdparty/AFNetworking/*.h", + "thirdparty/AsyncSocket/*.h", ]), - header_namespace = 'MtProtoKit', exported_headers = [ - 'MtProtoKit/MTTime.h', - 'MtProtoKit/MTTimer.h', - 'MtProtoKit/MTLogging.h', - 'MtProtoKit/MTEncryption.h', - 'MtProtoKit/MTInternalId.h', - 'MtProtoKit/MTQueue.h', - 'MtProtoKit/MTOutputStream.h', - 'MtProtoKit/MTInputStream.h', - 'MtProtoKit/MTSerialization.h', - 'MtProtoKit/MTExportedAuthorizationData.h', - 'MtProtoKit/MTRpcError.h', - 'MtProtoKit/MTKeychain.h', - 'MtProtoKit/MTFileBasedKeychain.h', - 'MtProtoKit/MTContext.h', - 'MtProtoKit/MTTransportScheme.h', - 'MtProtoKit/MTDatacenterTransferAuthAction.h', - 'MtProtoKit/MTDatacenterAuthAction.h', - 'MtProtoKit/MTDatacenterAuthMessageService.h', - 'MtProtoKit/MTDatacenterAddress.h', - 'MtProtoKit/MTDatacenterAddressSet.h', - 'MtProtoKit/MTDatacenterAuthInfo.h', - 'MtProtoKit/MTDatacenterSaltInfo.h', - 'MtProtoKit/MTDatacenterAddressListData.h', - 'MtProtoKit/MTProto.h', - 'MtProtoKit/MTSessionInfo.h', - 'MtProtoKit/MTTimeFixContext.h', - 'MtProtoKit/MTPreparedMessage.h', - 'MtProtoKit/MTOutgoingMessage.h', - 'MtProtoKit/MTIncomingMessage.h', - 'MtProtoKit/MTMessageEncryptionKey.h', - 'MtProtoKit/MTMessageService.h', - 'MtProtoKit/MTMessageTransaction.h', - 'MtProtoKit/MTTimeSyncMessageService.h', - 'MtProtoKit/MTRequestMessageService.h', - 'MtProtoKit/MTRequest.h', - 'MtProtoKit/MTRequestContext.h', - 'MtProtoKit/MTRequestErrorContext.h', - 'MtProtoKit/MTDropResponseContext.h', - 'MtProtoKit/MTApiEnvironment.h', - 'MtProtoKit/MTResendMessageService.h', - 'MtProtoKit/MTNetworkAvailability.h', - 'MtProtoKit/MTTransport.h', - 'MtProtoKit/MTTransportTransaction.h', - 'MtProtoKit/MTTcpTransport.h', - 'MtProtoKit/MTHttpRequestOperation.h', - 'MTAtomic.h', - 'MTBag.h', - 'MTDisposable.h', - 'MTSubscriber.h', - 'MTSignal.h', - 'MTNetworkUsageCalculationInfo.h', - 'MTNetworkUsageManager.h', - 'MTBackupAddressSignals.h', - 'thirdparty/AFNetworking/AFURLConnectionOperation.h', - 'thirdparty/AFNetworking/AFHTTPRequestOperation.h', - 'MTProxyConnectivity.h', - 'MTGzip.h', - 'MTDatacenterVerificationData.h', - 'MTPKCS.h', + "MtProtoKit/MTTime.h", + "MtProtoKit/MTTimer.h", + "MtProtoKit/MTLogging.h", + "MtProtoKit/MTEncryption.h", + "MtProtoKit/MTInternalId.h", + "MtProtoKit/MTQueue.h", + "MtProtoKit/MTOutputStream.h", + "MtProtoKit/MTInputStream.h", + "MtProtoKit/MTSerialization.h", + "MtProtoKit/MTExportedAuthorizationData.h", + "MtProtoKit/MTRpcError.h", + "MtProtoKit/MTKeychain.h", + "MtProtoKit/MTFileBasedKeychain.h", + "MtProtoKit/MTContext.h", + "MtProtoKit/MTTransportScheme.h", + "MtProtoKit/MTDatacenterTransferAuthAction.h", + "MtProtoKit/MTDatacenterAuthAction.h", + "MtProtoKit/MTDatacenterAuthMessageService.h", + "MtProtoKit/MTDatacenterAddress.h", + "MtProtoKit/MTDatacenterAddressSet.h", + "MtProtoKit/MTDatacenterAuthInfo.h", + "MtProtoKit/MTDatacenterSaltInfo.h", + "MtProtoKit/MTDatacenterAddressListData.h", + "MtProtoKit/MTProto.h", + "MtProtoKit/MTSessionInfo.h", + "MtProtoKit/MTTimeFixContext.h", + "MtProtoKit/MTPreparedMessage.h", + "MtProtoKit/MTOutgoingMessage.h", + "MtProtoKit/MTIncomingMessage.h", + "MtProtoKit/MTMessageEncryptionKey.h", + "MtProtoKit/MTMessageService.h", + "MtProtoKit/MTMessageTransaction.h", + "MtProtoKit/MTTimeSyncMessageService.h", + "MtProtoKit/MTRequestMessageService.h", + "MtProtoKit/MTRequest.h", + "MtProtoKit/MTRequestContext.h", + "MtProtoKit/MTRequestErrorContext.h", + "MtProtoKit/MTDropResponseContext.h", + "MtProtoKit/MTApiEnvironment.h", + "MtProtoKit/MTResendMessageService.h", + "MtProtoKit/MTNetworkAvailability.h", + "MtProtoKit/MTTransport.h", + "MtProtoKit/MTTransportTransaction.h", + "MtProtoKit/MTTcpTransport.h", + "MtProtoKit/MTHttpRequestOperation.h", + "MTAtomic.h", + "MTBag.h", + "MTDisposable.h", + "MTSubscriber.h", + "MTSignal.h", + "MTNetworkUsageCalculationInfo.h", + "MTNetworkUsageManager.h", + "MTBackupAddressSignals.h", + "thirdparty/AFNetworking/AFURLConnectionOperation.h", + "thirdparty/AFNetworking/AFHTTPRequestOperation.h", + "MTProxyConnectivity.h", + "MTGzip.h", + "MTDatacenterVerificationData.h", + "MTPKCS.h", ], - modular = True, - compiler_flags = ['-w'], - preprocessor_flags = ['-fobjc-arc'], - visibility = ['PUBLIC'], + visibility = ["PUBLIC"], deps = [ - ':openssl', + ":openssl", ], frameworks = [ - '$SDKROOT/System/Library/Frameworks/Foundation.framework', - '$SDKROOT/System/Library/Frameworks/Security.framework', + "$SDKROOT/System/Library/Frameworks/Foundation.framework", + "$SDKROOT/System/Library/Frameworks/Security.framework", ], ) diff --git a/submodules/MtProtoKit/Info.plist b/submodules/MtProtoKit/Info.plist new file mode 100644 index 0000000000..d3de8eefb6 --- /dev/null +++ b/submodules/MtProtoKit/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/submodules/MtProtoKit/MTDiscoverConnectionSignals.m b/submodules/MtProtoKit/MTDiscoverConnectionSignals.m index a426fdb822..dd4b304e12 100644 --- a/submodules/MtProtoKit/MTDiscoverConnectionSignals.m +++ b/submodules/MtProtoKit/MTDiscoverConnectionSignals.m @@ -1,39 +1,18 @@ #import "MTDiscoverConnectionSignals.h" #import "MTTcpConnection.h" - -#if defined(MtProtoKitDynamicFramework) -# import -# import -# import -# import -#elif defined(MtProtoKitMacFramework) -# import -# import -# import -# import -#else -# import -# import -# import -# import -#endif +#import "MTTransportScheme.h" +#import "MTTcpTransport.h" +#import "MTQueue.h" #import "MTDatacenterAddress.h" -#if defined(MtProtoKitDynamicFramework) -# import -# import -# import -#elif defined(MtProtoKitMacFramework) -# import -# import -# import -#else -# import -# import -# import -#endif +#import "MTDisposable.h" +#import "MTSignal.h" +#import "MTAtomic.h" +#import "MTContext.h" +#import "MTApiEnvironment.h" +#import "MTLogging.h" #import #import diff --git a/submodules/MtProtoKit/MTProtoKit/MTTcpConnection.m b/submodules/MtProtoKit/MTProtoKit/MTTcpConnection.m index 677be9ee00..51342ef6b0 100644 --- a/submodules/MtProtoKit/MTProtoKit/MTTcpConnection.m +++ b/submodules/MtProtoKit/MTProtoKit/MTTcpConnection.m @@ -20,17 +20,8 @@ #import "MTAes.h" #import "MTEncryption.h" - -#if defined(MtProtoKitDynamicFramework) -# import -# import -#elif defined(MtProtoKitMacFramework) -# import -# import -#else -# import -# import -#endif +#import "MTSignal.h" +#import "MTDNS.h" @interface MTTcpConnectionData : NSObject diff --git a/submodules/MtProtoKit/MTProxyConnectivity.m b/submodules/MtProtoKit/MTProxyConnectivity.m index 72bb7358b5..4db36644b7 100644 --- a/submodules/MtProtoKit/MTProxyConnectivity.m +++ b/submodules/MtProtoKit/MTProxyConnectivity.m @@ -1,34 +1,13 @@ #import "MTProxyConnectivity.h" -#if defined(MtProtoKitDynamicFramework) -# import -# import -# import -# import -# import -# import -# import -# import -#elif defined(MtProtoKitMacFramework) -# import -# import -# import -# import -# import -# import -# import -# import -#else -# import -# import -# import -# import -# import -# import -# import -# import -#endif - +#import "MTSignal.h" +#import "MTQueue.h" +#import "MTContext.h" +#import "MTApiEnvironment.h" +#import "MTDatacenterAddressSet.h" +#import "MTDatacenterAddress.h" +#import "MTTcpConnection.h" +#import "MTTransportScheme.h" #import "MTDiscoverConnectionSignals.h" @implementation MTProxyConnectivityStatus diff --git a/submodules/MtProtoKit/MTSignal.m b/submodules/MtProtoKit/MTSignal.m index 40b909bd91..3f273bf34b 100644 --- a/submodules/MtProtoKit/MTSignal.m +++ b/submodules/MtProtoKit/MTSignal.m @@ -1,14 +1,10 @@ #import "MTSignal.h" -#if defined(MtProtoKitDynamicFramework) -# import -#elif defined(MtProtoKitMacFramework) -# import -#else -# import -#endif - #import +#import "MTTimer.h" +#import "MTQueue.h" +#import "MTAtomic.h" +#import "MTBag.h" @interface MTSubscriberDisposable : NSObject { diff --git a/submodules/MtProtoKit/MtProtoKit_Xcode.xcodeproj/project.pbxproj b/submodules/MtProtoKit/MtProtoKit_Xcode.xcodeproj/project.pbxproj index 60b6cfeae6..c9e52125fe 100644 --- a/submodules/MtProtoKit/MtProtoKit_Xcode.xcodeproj/project.pbxproj +++ b/submodules/MtProtoKit/MtProtoKit_Xcode.xcodeproj/project.pbxproj @@ -463,8 +463,8 @@ D0CD98CD1D74BA9700F41187 /* MTTcpConnectionBehaviour.m in Sources */ = {isa = PBXBuildFile; fileRef = D063A39818B1650400C65116 /* MTTcpConnectionBehaviour.m */; }; D0CD98DE1D74BAEA00F41187 /* AFHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84EC18AFF259007F1076 /* AFHTTPRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; D0CD98DF1D74BAEA00F41187 /* AFURLConnectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84F518AFF259007F1076 /* AFURLConnectionOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; - D0CD98E21D74BAEB00F41187 /* AFHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84EC18AFF259007F1076 /* AFHTTPRequestOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; - D0CD98E31D74BAEB00F41187 /* AFURLConnectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84F518AFF259007F1076 /* AFURLConnectionOperation.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; + D0CD98E21D74BAEB00F41187 /* AFHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84EC18AFF259007F1076 /* AFHTTPRequestOperation.m */; }; + D0CD98E31D74BAEB00F41187 /* AFURLConnectionOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84F518AFF259007F1076 /* AFURLConnectionOperation.m */; }; D0CD98E41D74BAF400F41187 /* GCDAsyncSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84F818AFF259007F1076 /* GCDAsyncSocket.m */; }; D0CD98E51D74BAF400F41187 /* GCDAsyncSocket.m in Sources */ = {isa = PBXBuildFile; fileRef = D05A84F818AFF259007F1076 /* GCDAsyncSocket.m */; }; D0CD98E81D75C0BB00F41187 /* MTMessageService.h in Headers */ = {isa = PBXBuildFile; fileRef = D063A35018B1631900C65116 /* MTMessageService.h */; settings = {ATTRIBUTES = (Public, ); }; }; diff --git a/submodules/MtProtoKit/thirdparty/AFNetworking/AFURLConnectionOperation.m b/submodules/MtProtoKit/thirdparty/AFNetworking/AFURLConnectionOperation.m index 59d5fa4058..c7a03d6126 100644 --- a/submodules/MtProtoKit/thirdparty/AFNetworking/AFURLConnectionOperation.m +++ b/submodules/MtProtoKit/thirdparty/AFNetworking/AFURLConnectionOperation.m @@ -187,8 +187,6 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat if (_outputStream) { [_outputStream close]; } - - [super dealloc]; } diff --git a/tools/buck_defs.bzl b/tools/buck_defs.bzl deleted file mode 100644 index d6db55ef19..0000000000 --- a/tools/buck_defs.bzl +++ /dev/null @@ -1,18 +0,0 @@ -SHARED_CONFIGS = { - 'IPHONEOS_DEPLOYMENT_TARGET': '8.0', # common target version - 'SDKROOT': 'iphoneos', # platform - 'GCC_OPTIMIZATION_LEVEL': '0', # clang optimization - 'SWIFT_OPTIMIZATION_LEVEL': '-Onone', # swiftc optimization - 'SWIFT_WHOLE_MODULE_OPTIMIZATION': 'NO', # for build performance - 'ONLY_ACTIVE_ARCH': 'YES', - 'LD_RUNPATH_SEARCH_PATHS': '@executable_path/Frameworks', # To allow source files in binary -} - -LIB_SPECIFIC_CONFIG = { - 'SKIP_INSTALL': 'YES', -} - -EXTENSION_LIB_SPECIFIC_CONFIG = { - 'SKIP_INSTALL': 'YES', - 'APPLICATION_EXTENSION_API_ONLY': 'YES', -} diff --git a/tools/defs.bzl b/tools/defs.bzl new file mode 100644 index 0000000000..ad459ba6dc --- /dev/null +++ b/tools/defs.bzl @@ -0,0 +1,13 @@ +XCODE_BINARY_CONFIG = { + 'IPHONEOS_DEPLOYMENT_TARGET': '8.0', + 'SDKROOT': 'iphoneos', + 'GCC_OPTIMIZATION_LEVEL': '0', + 'SWIFT_OPTIMIZATION_LEVEL': '-Onone', + 'SWIFT_WHOLE_MODULE_OPTIMIZATION': 'NO', + 'ONLY_ACTIVE_ARCH': 'YES', + 'LD_RUNPATH_SEARCH_PATHS': '@executable_path/Frameworks', +} + +XCODE_STATIC_LIBRARY_CONFIG = { + 'SKIP_INSTALL': 'YES', +} diff --git a/tools/targets.bzl b/tools/targets.bzl new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tools/buck_utils.bzl b/tools/utils.bzl similarity index 75% rename from tools/buck_utils.bzl rename to tools/utils.bzl index ca933c023e..f443f03983 100644 --- a/tools/buck_utils.bzl +++ b/tools/utils.bzl @@ -1,10 +1,5 @@ OTHER_LINKER_FLAGS_KEY = 'OTHER_LDFLAGS' -# Either appends or assigns `other_linker_flags` to `config` under `config_key`. -# Params: -# - config: A dictionary of config names and their values -# - additional_linker_flags: A string-representable value of additional linker flags -# - config_key: The key to which to append or assign the additional linker flags def config_with_updated_linker_flags(config, other_linker_flags, config_key=OTHER_LINKER_FLAGS_KEY): new_config = { } config_key_found = False @@ -21,8 +16,8 @@ def config_with_updated_linker_flags(config, other_linker_flags, config_key=OTHE return new_config -# Creates a dictionary where the top level keys are the supported build configurations and the value of each key is `config`. -def configs_with_config(config): + +def xcode_configs(config): return { "Debug": config, "Profile": config, @@ -42,19 +37,11 @@ def merge_maps(dicts): result.update(d) return result + def basename(p): - """Returns the basename (i.e., the file portion) of a path. - Note that if `p` ends with a slash, this function returns an empty string. - This matches the behavior of Python's `os.path.basename`, but differs from - the Unix `basename` command (which would return the path segment preceding - the final slash). - Args: - p: The path whose basename should be returned. - Returns: - The basename of the path, which includes the extension. - """ return p.rpartition("/")[-1] + def glob_map(glob_results): result = dict() for path in glob_results: @@ -64,6 +51,7 @@ def glob_map(glob_results): result[file_name] = path return result + def glob_sub_map(prefix, glob_specs): result = dict() for path in native.glob(glob_specs): @@ -75,6 +63,7 @@ def glob_sub_map(prefix, glob_specs): result[file_key] = path return result + def gen_header_targets(header_paths, prefix, flavor, source_rule, source_path): result = dict() for header_path in header_paths: @@ -87,6 +76,7 @@ def gen_header_targets(header_paths, prefix, flavor, source_rule, source_path): result[header_path] = ':' + name + flavor return result + def lib_basename(name): result = name if result.startswith('lib'): @@ -95,12 +85,14 @@ def lib_basename(name): result = result[:-2] return result + def combined_config(dicts): result = dict() for d in dicts: result.update(d) return result + valid_build_variants = ['project', 'release'] def get_build_variant():