From a5ad0b185c5da655c55417331cc83113307bbeeb Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Sat, 22 Jan 2022 17:54:22 +0000 Subject: [PATCH] use Haskell library (#220) --- apps/ios/.gitignore | 2 + apps/ios/Shared/ContentView.swift | 120 +++++++++++++----- .../Shared/SimpleX (iOS)-Bridging-Header.h | 15 +++ .../Shared/SimpleX (macOS)-Bridging-Header.h | 15 +++ apps/ios/Shared/SimpleXApp.swift | 19 ++- apps/ios/Shared/dummy.m | 8 ++ apps/ios/SimpleX--macOS--Info.plist | 5 + apps/ios/SimpleX.xcodeproj/project.pbxproj | 119 +++++++++++++++-- 8 files changed, 260 insertions(+), 43 deletions(-) create mode 100644 apps/ios/Shared/SimpleX (iOS)-Bridging-Header.h create mode 100644 apps/ios/Shared/SimpleX (macOS)-Bridging-Header.h create mode 100644 apps/ios/Shared/dummy.m create mode 100644 apps/ios/SimpleX--macOS--Info.plist diff --git a/apps/ios/.gitignore b/apps/ios/.gitignore index 195fd5ee74..5137305d86 100644 --- a/apps/ios/.gitignore +++ b/apps/ios/.gitignore @@ -63,3 +63,5 @@ fastlane/test_output # https://github.com/johnno1962/injectionforxcode iOSInjectionProject/ + +Libraries/ diff --git a/apps/ios/Shared/ContentView.swift b/apps/ios/Shared/ContentView.swift index c560668723..bf89e2c171 100644 --- a/apps/ios/Shared/ContentView.swift +++ b/apps/ios/Shared/ContentView.swift @@ -5,46 +5,108 @@ // Created by Evgeny Poberezkin on 17/01/2022. // +//import SwiftUI + +//struct ContentView: View { +// @State var messages: [String] = ["Start session:"] +// @State var text: String = "" +// +// func sendMessage() { +// } +// +// var body: some View { +// VStack { +// ScrollView { +// LazyVStack { +// ForEach(messages, id: \.self) { msg in +// MessageView(message: msg, sent: false) +// } +// } +// .padding(10) +// } +// .frame(minWidth: 0, +// maxWidth: .infinity, +// minHeight: 0, +// maxHeight: .infinity, +// alignment: .topLeading) +// HStack { +// TextField("Message...", text: $text) +// .textFieldStyle(RoundedBorderTextFieldStyle()) +// .frame(minHeight: CGFloat(30)) +// Button(action: sendMessage) { +// Text("Send") +// }.disabled(text.isEmpty) +// } +// .frame(minHeight: CGFloat(30)) +// .padding() +// } +// } +//} + import SwiftUI struct ContentView: View { - @State var messages: [String] = ["Start session:"] - @State var text: String = "" + + var controller: controller - func sendMessage() { + init(controller: controller) { + self.controller = controller + } + + + @State private var logbuffer = [String]() + @State private var chatcmd: String = "" + @State private var chatlog: String = "" + @FocusState private var focused: Bool + + func addLine(line: String) { + print(line) + logbuffer.append(line) + if(logbuffer.count > 50) { _ = logbuffer.dropFirst() } + chatlog = logbuffer.joined(separator: "\n") } var body: some View { - VStack { - ScrollView { - LazyVStack { - ForEach(messages, id: \.self) { msg in - MessageView(message: msg, sent: false) - } + + DispatchQueue.global().async { + while(true) { + let msg = String.init(cString: chat_recv_msg(controller)) + + DispatchQueue.main.async { + addLine(line: msg) } - .padding(10) } - .frame(minWidth: 0, - maxWidth: .infinity, - minHeight: 0, - maxHeight: .infinity, - alignment: .topLeading) - HStack { - TextField("Message...", text: $text) - .textFieldStyle(RoundedBorderTextFieldStyle()) - .frame(minHeight: CGFloat(30)) - Button(action: sendMessage) { - Text("Send") - }.disabled(text.isEmpty) + } + + return VStack { + ScrollView { + VStack(alignment: .leading) { + HStack { Spacer() } + Text(chatlog) + .lineLimit(nil) + .font(.system(.body, design: .monospaced)) + } + .frame(maxWidth: .infinity) } - .frame(minHeight: CGFloat(30)) - .padding() + + TextField("Chat command", text: $chatcmd) + .focused($focused) + .onSubmit { + print(chatcmd) + var cCmd = chatcmd.cString(using: .utf8)! + print(String.init(cString: chat_send_cmd(controller, &cCmd))) + } + .textInputAutocapitalization(.never) + .disableAutocorrection(true) + .padding() } } + } -struct ContentView_Previews: PreviewProvider { - static var previews: some View { - ContentView(text: "Hello!") - } -} + +//struct ContentView_Previews: PreviewProvider { +// static var previews: some View { +// ContentView(text: "Hello!") +// } +//} diff --git a/apps/ios/Shared/SimpleX (iOS)-Bridging-Header.h b/apps/ios/Shared/SimpleX (iOS)-Bridging-Header.h new file mode 100644 index 0000000000..4b5b9d876b --- /dev/null +++ b/apps/ios/Shared/SimpleX (iOS)-Bridging-Header.h @@ -0,0 +1,15 @@ +// +// Use this file to import your target's public headers that you would like to expose to Swift. +// + +extern void hs_init(int argc, char ** argv[]); + +typedef void* chat_store; +typedef void* controller; + +extern chat_store chat_init_store(char * path); +extern char *chat_get_user(chat_store store); +extern char *chat_create_user(chat_store store, char *data); +extern controller chat_start(chat_store store); +extern char *chat_send_cmd(controller ctl, char *cmd); +extern char *chat_recv_msg(controller ctl); diff --git a/apps/ios/Shared/SimpleX (macOS)-Bridging-Header.h b/apps/ios/Shared/SimpleX (macOS)-Bridging-Header.h new file mode 100644 index 0000000000..4b5b9d876b --- /dev/null +++ b/apps/ios/Shared/SimpleX (macOS)-Bridging-Header.h @@ -0,0 +1,15 @@ +// +// Use this file to import your target's public headers that you would like to expose to Swift. +// + +extern void hs_init(int argc, char ** argv[]); + +typedef void* chat_store; +typedef void* controller; + +extern chat_store chat_init_store(char * path); +extern char *chat_get_user(chat_store store); +extern char *chat_create_user(chat_store store, char *data); +extern controller chat_start(chat_store store); +extern char *chat_send_cmd(controller ctl, char *cmd); +extern char *chat_recv_msg(controller ctl); diff --git a/apps/ios/Shared/SimpleXApp.swift b/apps/ios/Shared/SimpleXApp.swift index 3598b4284a..68fd67c2d8 100644 --- a/apps/ios/Shared/SimpleXApp.swift +++ b/apps/ios/Shared/SimpleXApp.swift @@ -9,9 +9,26 @@ import SwiftUI @main struct SimpleXApp: App { + private let controller: controller + init() { + hs_init(0, nil) + + let dataDir = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!.path + "/mobile_v1" + var cstr = dataDir.cString(using: .utf8)! + let store = chat_init_store(&cstr) + let user = String.init(cString: chat_get_user(store)) + print(user) + if user == "{}" { + var data = "{ \"displayName\": \"test\", \"fullName\": \"ios test\" }".cString(using: .utf8)! + chat_create_user(store, &data) + } + controller = chat_start(store) + var cmd = "/help".cString(using: .utf8)! + print(String.init(cString: chat_send_cmd(controller, &cmd))) + } var body: some Scene { WindowGroup { - ContentView() + ContentView(controller: controller) } } } diff --git a/apps/ios/Shared/dummy.m b/apps/ios/Shared/dummy.m new file mode 100644 index 0000000000..73cb36a91d --- /dev/null +++ b/apps/ios/Shared/dummy.m @@ -0,0 +1,8 @@ +// +// dummy.m +// SimpleX +// +// Created by Evgeny Poberezkin on 22/01/2022. +// + +#import diff --git a/apps/ios/SimpleX--macOS--Info.plist b/apps/ios/SimpleX--macOS--Info.plist new file mode 100644 index 0000000000..0c67376eba --- /dev/null +++ b/apps/ios/SimpleX--macOS--Info.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/apps/ios/SimpleX.xcodeproj/project.pbxproj b/apps/ios/SimpleX.xcodeproj/project.pbxproj index 5a6c43804b..ea1f5ebb11 100644 --- a/apps/ios/SimpleX.xcodeproj/project.pbxproj +++ b/apps/ios/SimpleX.xcodeproj/project.pbxproj @@ -7,6 +7,20 @@ objects = { /* Begin PBXBuildFile section */ + 5C764E61279C70E0000C6508 /* libgmp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C764E5D279C70DE000C6508 /* libgmp.a */; }; + 5C764E62279C70E0000C6508 /* libgmp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C764E5D279C70DE000C6508 /* libgmp.a */; }; + 5C764E63279C70E0000C6508 /* libgmpxx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C764E5E279C70DE000C6508 /* libgmpxx.a */; }; + 5C764E64279C70E0000C6508 /* libgmpxx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C764E5E279C70DE000C6508 /* libgmpxx.a */; }; + 5C764E65279C70E0000C6508 /* libffi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C764E5F279C70DE000C6508 /* libffi.a */; }; + 5C764E66279C70E0000C6508 /* libffi.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C764E5F279C70DE000C6508 /* libffi.a */; }; + 5C764E67279C70E0000C6508 /* libHSsimplex-chat-1.0.1-756RvUPisyT7gsYObFpxWS-ghc8.10.7.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C764E60279C70E0000C6508 /* libHSsimplex-chat-1.0.1-756RvUPisyT7gsYObFpxWS-ghc8.10.7.a */; }; + 5C764E68279C70E0000C6508 /* libHSsimplex-chat-1.0.1-756RvUPisyT7gsYObFpxWS-ghc8.10.7.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C764E60279C70E0000C6508 /* libHSsimplex-chat-1.0.1-756RvUPisyT7gsYObFpxWS-ghc8.10.7.a */; }; + 5C764E80279C7276000C6508 /* dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C764E7F279C7276000C6508 /* dummy.m */; }; + 5C764E81279C7276000C6508 /* dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 5C764E7F279C7276000C6508 /* dummy.m */; }; + 5C764E82279C748B000C6508 /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C764E7B279C71D4000C6508 /* libiconv.tbd */; }; + 5C764E83279C748B000C6508 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C764E7C279C71DB000C6508 /* libz.tbd */; }; + 5C764E84279C748C000C6508 /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C764E7B279C71D4000C6508 /* libiconv.tbd */; }; + 5C764E85279C748C000C6508 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C764E7C279C71DB000C6508 /* libz.tbd */; }; 5CA059DC279559F40002BEB4 /* Tests_iOS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CA059DB279559F40002BEB4 /* Tests_iOS.swift */; }; 5CA059DE279559F40002BEB4 /* Tests_iOSLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CA059DD279559F40002BEB4 /* Tests_iOSLaunchTests.swift */; }; 5CA059E8279559F40002BEB4 /* Tests_macOS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CA059E7279559F40002BEB4 /* Tests_macOS.swift */; }; @@ -41,12 +55,20 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 5C764E5D279C70DE000C6508 /* libgmp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libgmp.a; sourceTree = ""; }; + 5C764E5E279C70DE000C6508 /* libgmpxx.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libgmpxx.a; sourceTree = ""; }; + 5C764E5F279C70DE000C6508 /* libffi.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libffi.a; sourceTree = ""; }; + 5C764E60279C70E0000C6508 /* libHSsimplex-chat-1.0.1-756RvUPisyT7gsYObFpxWS-ghc8.10.7.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libHSsimplex-chat-1.0.1-756RvUPisyT7gsYObFpxWS-ghc8.10.7.a"; sourceTree = ""; }; + 5C764E7B279C71D4000C6508 /* libiconv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.tbd; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.2.sdk/usr/lib/libiconv.tbd; sourceTree = DEVELOPER_DIR; }; + 5C764E7C279C71DB000C6508 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.2.sdk/usr/lib/libz.tbd; sourceTree = DEVELOPER_DIR; }; + 5C764E7D279C7275000C6508 /* SimpleX (iOS)-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SimpleX (iOS)-Bridging-Header.h"; sourceTree = ""; }; + 5C764E7E279C7275000C6508 /* SimpleX (macOS)-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SimpleX (macOS)-Bridging-Header.h"; sourceTree = ""; }; + 5C764E7F279C7276000C6508 /* dummy.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = dummy.m; sourceTree = ""; }; 5CA059C3279559F40002BEB4 /* SimpleXApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimpleXApp.swift; sourceTree = ""; }; 5CA059C4279559F40002BEB4 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 5CA059C5279559F40002BEB4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 5CA059CA279559F40002BEB4 /* SimpleX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimpleX.app; sourceTree = BUILT_PRODUCTS_DIR; }; 5CA059D0279559F40002BEB4 /* SimpleX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimpleX.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 5CA059D2279559F40002BEB4 /* macOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = macOS.entitlements; sourceTree = ""; }; 5CA059D7279559F40002BEB4 /* Tests iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Tests iOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 5CA059DB279559F40002BEB4 /* Tests_iOS.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests_iOS.swift; sourceTree = ""; }; 5CA059DD279559F40002BEB4 /* Tests_iOSLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests_iOSLaunchTests.swift; sourceTree = ""; }; @@ -62,6 +84,12 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 5C764E67279C70E0000C6508 /* libHSsimplex-chat-1.0.1-756RvUPisyT7gsYObFpxWS-ghc8.10.7.a in Frameworks */, + 5C764E83279C748B000C6508 /* libz.tbd in Frameworks */, + 5C764E63279C70E0000C6508 /* libgmpxx.a in Frameworks */, + 5C764E65279C70E0000C6508 /* libffi.a in Frameworks */, + 5C764E61279C70E0000C6508 /* libgmp.a in Frameworks */, + 5C764E82279C748B000C6508 /* libiconv.tbd in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -69,6 +97,12 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 5C764E68279C70E0000C6508 /* libHSsimplex-chat-1.0.1-756RvUPisyT7gsYObFpxWS-ghc8.10.7.a in Frameworks */, + 5C764E85279C748C000C6508 /* libz.tbd in Frameworks */, + 5C764E64279C70E0000C6508 /* libgmpxx.a in Frameworks */, + 5C764E66279C70E0000C6508 /* libffi.a in Frameworks */, + 5C764E62279C70E0000C6508 /* libgmp.a in Frameworks */, + 5C764E84279C748C000C6508 /* libiconv.tbd in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -89,14 +123,36 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 5C764E5C279C70B7000C6508 /* Libraries */ = { + isa = PBXGroup; + children = ( + 5C764E5F279C70DE000C6508 /* libffi.a */, + 5C764E5D279C70DE000C6508 /* libgmp.a */, + 5C764E5E279C70DE000C6508 /* libgmpxx.a */, + 5C764E60279C70E0000C6508 /* libHSsimplex-chat-1.0.1-756RvUPisyT7gsYObFpxWS-ghc8.10.7.a */, + ); + path = Libraries; + sourceTree = ""; + }; + 5C764E7A279C71D4000C6508 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 5C764E7C279C71DB000C6508 /* libz.tbd */, + 5C764E7B279C71D4000C6508 /* libiconv.tbd */, + ); + name = Frameworks; + sourceTree = ""; + }; 5CA059BD279559F40002BEB4 = { isa = PBXGroup; children = ( + 5C764E5C279C70B7000C6508 /* Libraries */, 5CA059C2279559F40002BEB4 /* Shared */, 5CA059D1279559F40002BEB4 /* macOS */, 5CA059DA279559F40002BEB4 /* Tests iOS */, 5CA059E6279559F40002BEB4 /* Tests macOS */, 5CA059CB279559F40002BEB4 /* Products */, + 5C764E7A279C71D4000C6508 /* Frameworks */, ); sourceTree = ""; }; @@ -104,10 +160,13 @@ isa = PBXGroup; children = ( 5CA059C3279559F40002BEB4 /* SimpleXApp.swift */, + 5C764E7F279C7276000C6508 /* dummy.m */, 5CA059C4279559F40002BEB4 /* ContentView.swift */, 5CA05A4B27974EB60002BEB4 /* ProfileView.swift */, 5CA05A4E279752D00002BEB4 /* MessageView.swift */, 5CA059C5279559F40002BEB4 /* Assets.xcassets */, + 5C764E7D279C7275000C6508 /* SimpleX (iOS)-Bridging-Header.h */, + 5C764E7E279C7275000C6508 /* SimpleX (macOS)-Bridging-Header.h */, ); path = Shared; sourceTree = ""; @@ -126,7 +185,6 @@ 5CA059D1279559F40002BEB4 /* macOS */ = { isa = PBXGroup; children = ( - 5CA059D2279559F40002BEB4 /* macOS.entitlements */, ); path = macOS; sourceTree = ""; @@ -231,12 +289,15 @@ BuildIndependentTargetsInParallel = 1; LastSwiftUpdateCheck = 1320; LastUpgradeCheck = 1320; + ORGANIZATIONNAME = "SimpleX Chat"; TargetAttributes = { 5CA059C9279559F40002BEB4 = { CreatedOnToolsVersion = 13.2.1; + LastSwiftMigration = 1320; }; 5CA059CF279559F40002BEB4 = { CreatedOnToolsVersion = 13.2.1; + LastSwiftMigration = 1320; }; 5CA059D6279559F40002BEB4 = { CreatedOnToolsVersion = 13.2.1; @@ -307,6 +368,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 5C764E80279C7276000C6508 /* dummy.m in Sources */, 5CA05A4F279752D00002BEB4 /* MessageView.swift in Sources */, 5CA059ED279559F40002BEB4 /* ContentView.swift in Sources */, 5CA05A4C27974EB60002BEB4 /* ProfileView.swift in Sources */, @@ -318,6 +380,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 5C764E81279C7276000C6508 /* dummy.m in Sources */, 5CA05A50279752D00002BEB4 /* MessageView.swift in Sources */, 5CA059EE279559F40002BEB4 /* ContentView.swift in Sources */, 5CA05A4D27974EB60002BEB4 /* ProfileView.swift in Sources */, @@ -475,9 +538,11 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 9767FTRA3G; + DEVELOPMENT_TEAM = 5NN7GUYB6T; + ENABLE_BITCODE = NO; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; @@ -485,16 +550,22 @@ INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 15.2; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Libraries", + ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = chat.simplex.SimpleX; + PRODUCT_BUNDLE_IDENTIFIER = chat.simplex.app; PRODUCT_NAME = SimpleX; SDKROOT = iphoneos; SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OBJC_BRIDGING_HEADER = "Shared/SimpleX (iOS)-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -505,9 +576,11 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ENABLE_MODULES = YES; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 9767FTRA3G; + DEVELOPMENT_TEAM = 5NN7GUYB6T; + ENABLE_BITCODE = NO; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; @@ -515,16 +588,21 @@ INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - IPHONEOS_DEPLOYMENT_TARGET = 15.2; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Libraries", + ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = chat.simplex.SimpleX; + PRODUCT_BUNDLE_IDENTIFIER = chat.simplex.app; PRODUCT_NAME = SimpleX; SDKROOT = iphoneos; SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OBJC_BRIDGING_HEADER = "Shared/SimpleX (iOS)-Bridging-Header.h"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; @@ -536,25 +614,33 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CODE_SIGN_ENTITLEMENTS = macOS/macOS.entitlements; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = "SimpleX (macOS)Debug.entitlements"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 9767FTRA3G; + DEVELOPMENT_TEAM = 5NN7GUYB6T; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "SimpleX--macOS--Info.plist"; INFOPLIST_KEY_NSHumanReadableCopyright = ""; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Libraries", + ); MACOSX_DEPLOYMENT_TARGET = 12.1; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = chat.simplex.SimpleX; + PRODUCT_BUNDLE_IDENTIFIER = chat.simplex.app; PRODUCT_NAME = SimpleX; SDKROOT = macosx; SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OBJC_BRIDGING_HEADER = "Shared/SimpleX (macOS)-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; }; name = Debug; @@ -564,25 +650,32 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = macOS/macOS.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = 9767FTRA3G; + DEVELOPMENT_TEAM = 5NN7GUYB6T; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "SimpleX--macOS--Info.plist"; INFOPLIST_KEY_NSHumanReadableCopyright = ""; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Libraries", + ); MACOSX_DEPLOYMENT_TARGET = 12.1; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = chat.simplex.SimpleX; + PRODUCT_BUNDLE_IDENTIFIER = chat.simplex.app; PRODUCT_NAME = SimpleX; SDKROOT = macosx; SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OBJC_BRIDGING_HEADER = "Shared/SimpleX (macOS)-Bridging-Header.h"; SWIFT_VERSION = 5.0; }; name = Release;