This commit is contained in:
Ali 2019-11-01 16:18:47 +04:00
parent 7a01746ef7
commit ca75be91fe
12 changed files with 293 additions and 5 deletions

11
.gitignore vendored
View File

@ -47,3 +47,14 @@ submodules/MtProtoKit/TON/macOS/lib/fift/Lisp.fif
submodules/MtProtoKit/TON/macOS/lib/fift/Lists.fif
submodules/MtProtoKit/TON/macOS/lib/fift/Stack.fif
submodules/MtProtoKit/TON/macOS/lib/fift/TonUtil.fif
bazel-bin
bazel-bin/*
bazel-genfiles
bazel-genfiles/*
bazel-out
bazel-out/*
bazel-telegram-ios
bazel-telegram-ios/*
bazel-testlogs
bazel-testlogs/*
*/*.swp

9
.gitmodules vendored
View File

@ -2,3 +2,12 @@
[submodule "submodules/rlottie/rlottie"]
path = submodules/rlottie/rlottie
url = https://github.com/laktyushin/rlottie.git
[submodule "build-system/bazel-rules/rules_apple"]
path = build-system/bazel-rules/rules_apple
url = https://github.com/bazelbuild/rules_apple.git
[submodule "build-system/bazel-rules/rules_swift"]
path = build-system/bazel-rules/rules_swift
url = https://github.com/bazelbuild/rules_swift.git
[submodule "build-system/bazel-rules/apple_support"]
path = build-system/bazel-rules/apple_support
url = https://github.com/bazelbuild/apple_support.git

48
WORKSPACE Normal file
View File

@ -0,0 +1,48 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "com_google_protobuf",
urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.8.0.zip"],
sha256 = "1e622ce4b84b88b6d2cdf1db38d1a634fe2392d74f0b7b74ff98f3a51838ee53",
strip_prefix = "protobuf-3.8.0",
type = "zip",
)
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
protobuf_deps()
local_repository(
name = "build_bazel_rules_apple",
path = "build-system/bazel-rules/rules_apple",
)
local_repository(
name = "build_bazel_rules_swift",
path = "build-system/bazel-rules/rules_swift",
)
local_repository(
name = "build_bazel_apple_support",
path = "build-system/bazel-rules/apple_support",
)
load(
"@build_bazel_rules_apple//apple:repositories.bzl",
"apple_rules_dependencies",
)
apple_rules_dependencies()
load(
"@build_bazel_rules_swift//swift:repositories.bzl",
"swift_rules_dependencies",
)
swift_rules_dependencies()
load(
"@build_bazel_apple_support//lib:repositories.bzl",
"apple_support_dependencies",
)
apple_support_dependencies()

56
Wallet/BUILD Normal file
View File

@ -0,0 +1,56 @@
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application")
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
version_info_plist_source = """
echo \
'<?xml version="1.0" encoding="UTF-8"?>' \
'<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">' \
'<plist version="1.0">' \
'<dict>' \
' <key>CFBundleShortVersionString</key>' \
' <string>%s</string>' \
' <key>CFBundleVersion</key>' \
' <string>%s</string>' \
'</dict>' \
'</plist>' \
> "$@"
""" % ("1.0", "30")
genrule(
name = "VersionInfoPlist",
outs = ["VersionInfo.plist"],
cmd = version_info_plist_source,
)
objc_library(
name = "Main",
srcs = [
"Sources/main.m"
],
)
swift_library(
name = "Lib",
srcs = glob([
"SupportFiles/**/*.swift",
]),
deps = [
"//submodules/GZip:GZip",
"//submodules/AsyncDisplayKit:AsyncDisplayKit",
],
)
ios_application(
name = "Wallet",
bundle_id = "org.telegram-iOS.Wallet",
families = ["iphone", "ipad"],
minimum_os_version = "9.0",
infoplists = [
":Info.plist",
":VersionInfoPlist",
],
deps = [
":Main",
":Lib",
],
)

View File

@ -7,7 +7,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${APP_NAME}</string>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIcons</key>
@ -38,12 +38,8 @@
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(PRODUCT_BUNDLE_SHORT_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${BUILD_NUMBER}</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>

View File

@ -1 +1,25 @@
import Foundation
import UIKit
import GZip
@objc(Application)
final class Application: UIApplication {
}
@objc(AppDelegate)
final class AppDelegate: NSObject, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = UIViewController()
self.window?.rootViewController?.view.backgroundColor = .green
self.window?.makeKeyAndVisible()
if #available(iOS 13.0, *) {
self.window?.rootViewController?.overrideUserInterfaceStyle = .dark
}
return true
}
}

View File

@ -0,0 +1,61 @@
{
"additionalFilePaths" : [
"Wallet/BUILD"
],
"buildTargets" : [
"//Wallet:Lib",
"//Wallet:Main",
"//Wallet:Wallet",
],
"optionSet" : {
"BazelBuildOptionsDebug" : {
"p" : "$(inherited)"
},
"BazelBuildOptionsRelease" : {
"p" : "$(inherited)"
},
"BazelBuildStartupOptionsDebug" : {
"p" : "$(inherited)"
},
"BazelBuildStartupOptionsRelease" : {
"p" : "$(inherited)"
},
"BuildActionPostActionScript" : {
"p" : "$(inherited)"
},
"BuildActionPreActionScript" : {
"p" : "$(inherited)"
},
"CommandlineArguments" : {
"p" : "$(inherited)"
},
"EnvironmentVariables" : {
"p" : "$(inherited)"
},
"LaunchActionPostActionScript" : {
"p" : "$(inherited)"
},
"LaunchActionPreActionScript" : {
"p" : "$(inherited)"
},
"ProjectGenerationBazelStartupOptions" : {
"p" : "$(inherited)"
},
"ProjectPrioritizesSwift" : {
"p" : "YES"
},
"TestActionPostActionScript" : {
"p" : "$(inherited)"
},
"TestActionPreActionScript" : {
"p" : "$(inherited)"
}
},
"projectName" : "Wallet",
"sourceFilters" : [
"Wallet",
"Wallet/Sources",
"Wallet/SupportFiles",
"submodules/...",
]
}

View File

@ -0,0 +1,10 @@
{
"optionSet" : {
"BazelPath" : {
"p" : "/usr/local/bin/bazel"
},
"WorkspaceRootPath" : {
"p" : "/Users/peter/build/telegram-temp/telegram-ios"
}
}
}

View File

@ -0,0 +1,14 @@
{
"configDefaults" : {
"optionSet" : {
"ProjectPrioritizesSwift" : {
"p" : "YES"
}
}
},
"packages" : [
"Wallet"
],
"projectName" : "Wallet",
"workspaceRoot" : "../.."
}

40
submodules/AsyncDisplayKit/BUILD vendored Normal file
View File

@ -0,0 +1,40 @@
ASYNCDISPLAYKIT_EXPORTED_HEADERS = glob([
"Source/*.h",
"Source/Details/**/*.h",
"Source/Layout/*.h",
"Source/Base/*.h",
"Source/Debug/AsyncDisplayKit+Debug.h",
"Source/TextKit/ASTextNodeTypes.h",
"Source/TextKit/ASTextKitComponents.h"
])
ASYNCDISPLAYKIT_PRIVATE_HEADERS = glob([
"Source/**/*.h"
],
exclude = ASYNCDISPLAYKIT_EXPORTED_HEADERS,
)
objc_library(
name = "AsyncDisplayKit",
enable_modules = True,
module_name = "AsyncDisplayKit",
srcs = glob([
"Source/**/*.m",
"Source/**/*.mm",
"Source/Base/*.m",
]) + ASYNCDISPLAYKIT_PRIVATE_HEADERS,
hdrs = ASYNCDISPLAYKIT_EXPORTED_HEADERS,
defines = [
"MINIMAL_ASDK",
],
sdk_frameworks = [
"QuartzCore",
"CoreMedia",
"CoreText",
"CoreGraphics",
],
visibility = [
"//visibility:public",
],
)

View File

@ -7,6 +7,7 @@
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
//
#import <AsyncDisplayKit/Base/ASAvailability.h>
#import <AsyncDisplayKit/ASAvailability.h>
#import <AsyncDisplayKit/ASHashing.h>
#import <AsyncDisplayKit/ASTraitCollection.h>

18
submodules/GZip/BUILD Normal file
View File

@ -0,0 +1,18 @@
objc_library(
name = "GZip",
enable_modules = True,
module_name = "GZip",
srcs = glob([
"Sources/**/*.m",
]),
hdrs = glob([
"Sources/**/*.h",
]),
sdk_dylibs = [
"libz",
],
visibility = [
"//visibility:public",
],
)