Bundle macOS app with iOS

This commit is contained in:
Davide De Rosa 2021-02-02 09:56:13 +01:00
parent b732b65d58
commit dd3cac40c6
4 changed files with 16 additions and 17 deletions

View File

@ -2,5 +2,5 @@ PLATFORM="mac"
MATCH_PLATFORM="macos" MATCH_PLATFORM="macos"
DELIVER_PLATFORM="osx" DELIVER_PLATFORM="osx"
GYM_SCHEME="Passepartout-macOS" GYM_SCHEME="Passepartout-macOS"
BUNDLE_CONTEXT="macos" BUNDLE_CONTEXT="ios"
APP_ROOT="Passepartout/App/macOS" APP_ROOT="Passepartout/App/macOS"

View File

@ -28,11 +28,14 @@
CFG_TEAM_ID = DTDYD63ZX9 CFG_TEAM_ID = DTDYD63ZX9
CFG_APP_IOS_ID = com.algoritmico.ios.Passepartout CFG_APP_IOS_ID = com.algoritmico.ios.Passepartout
CFG_APP_MACOS_ID = com.algoritmico.macos.Passepartout //CFG_APP_MACOS_ID = com.algoritmico.macos.Passepartout
CFG_APP_LAUNCHER_ID = com.algoritmico.macos.Passepartout.Launcher //CFG_APP_LAUNCHER_ID = com.algoritmico.macos.Passepartout.Launcher
CFG_APP_MACOS_ID = com.algoritmico.ios.Passepartout
CFG_APP_LAUNCHER_ID = com.algoritmico.ios.Passepartout.Launcher
CFG_GROUP_ID = com.algoritmico.Passepartout CFG_GROUP_ID = com.algoritmico.Passepartout
CFG_APPSTORE_IOS_ID = 1433648537 CFG_APPSTORE_IOS_ID = 1433648537
CFG_APPSTORE_MACOS_ID = 1433645014 //CFG_APPSTORE_MACOS_ID = 1433645014
CFG_APPSTORE_MACOS_ID = 1433648537
CFG_COPYRIGHT = Copyright © 2021 Davide De Rosa. All rights reserved. CFG_COPYRIGHT = Copyright © 2021 Davide De Rosa. All rights reserved.
#include? "Secret.xcconfig" #include? "Secret.xcconfig"

View File

@ -2363,7 +2363,7 @@
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "$(CFG_APP_MACOS_ID)"; PRODUCT_BUNDLE_IDENTIFIER = "$(CFG_APP_MACOS_ID)";
PRODUCT_NAME = Passepartout; PRODUCT_NAME = Passepartout;
PROVISIONING_PROFILE_SPECIFIER = "match Development com.algoritmico.macos.Passepartout macos"; PROVISIONING_PROFILE_SPECIFIER = "match Development com.algoritmico.ios.Passepartout macos";
SDKROOT = macosx; SDKROOT = macosx;
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
}; };
@ -2390,7 +2390,7 @@
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "$(CFG_APP_MACOS_ID)"; PRODUCT_BUNDLE_IDENTIFIER = "$(CFG_APP_MACOS_ID)";
PRODUCT_NAME = Passepartout; PRODUCT_NAME = Passepartout;
PROVISIONING_PROFILE_SPECIFIER = "match Development com.algoritmico.macos.Passepartout macos"; PROVISIONING_PROFILE_SPECIFIER = "match Development com.algoritmico.ios.Passepartout macos";
SDKROOT = macosx; SDKROOT = macosx;
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
}; };
@ -2416,7 +2416,7 @@
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "$(CFG_APP_MACOS_ID).Tunnel"; PRODUCT_BUNDLE_IDENTIFIER = "$(CFG_APP_MACOS_ID).Tunnel";
PRODUCT_NAME = PassepartoutTunnel; PRODUCT_NAME = PassepartoutTunnel;
PROVISIONING_PROFILE_SPECIFIER = "match Development com.algoritmico.macos.Passepartout.Tunnel macos"; PROVISIONING_PROFILE_SPECIFIER = "match Development com.algoritmico.ios.Passepartout.Tunnel macos";
SDKROOT = macosx; SDKROOT = macosx;
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
@ -2442,7 +2442,7 @@
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "$(CFG_APP_MACOS_ID).Tunnel"; PRODUCT_BUNDLE_IDENTIFIER = "$(CFG_APP_MACOS_ID).Tunnel";
PRODUCT_NAME = PassepartoutTunnel; PRODUCT_NAME = PassepartoutTunnel;
PROVISIONING_PROFILE_SPECIFIER = "match Development com.algoritmico.macos.Passepartout.Tunnel macos"; PROVISIONING_PROFILE_SPECIFIER = "match Development com.algoritmico.ios.Passepartout.Tunnel macos";
SDKROOT = macosx; SDKROOT = macosx;
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
@ -2471,7 +2471,7 @@
); );
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.algoritmico.macos.PassepartoutCore; PRODUCT_BUNDLE_IDENTIFIER = com.algoritmico.ios.PassepartoutCore;
PRODUCT_NAME = PassepartoutCore; PRODUCT_NAME = PassepartoutCore;
SDKROOT = macosx; SDKROOT = macosx;
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
@ -2502,7 +2502,7 @@
"@loader_path/Frameworks", "@loader_path/Frameworks",
); );
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.algoritmico.macos.PassepartoutCore; PRODUCT_BUNDLE_IDENTIFIER = com.algoritmico.ios.PassepartoutCore;
PRODUCT_NAME = PassepartoutCore; PRODUCT_NAME = PassepartoutCore;
SDKROOT = macosx; SDKROOT = macosx;
SKIP_INSTALL = YES; SKIP_INSTALL = YES;
@ -2699,7 +2699,6 @@
); );
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.algoritmico.ios.Passepartout.Tests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
@ -2719,7 +2718,6 @@
"@loader_path/Frameworks", "@loader_path/Frameworks",
); );
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.algoritmico.ios.Passepartout.Tests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
@ -2741,7 +2739,6 @@
); );
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.algoritmico.macos.Passepartout.Tests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx; SDKROOT = macosx;
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
@ -2762,7 +2759,6 @@
"@loader_path/../Frameworks", "@loader_path/../Frameworks",
); );
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.algoritmico.macos.Passepartout.Tests;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx; SDKROOT = macosx;
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
@ -2788,7 +2784,7 @@
); );
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.algoritmico.macos.Passepartout.Launcher; PRODUCT_BUNDLE_IDENTIFIER = "$(CFG_APP_LAUNCHER_ID)";
PRODUCT_NAME = PassepartoutLauncher; PRODUCT_NAME = PassepartoutLauncher;
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = macosx; SDKROOT = macosx;
@ -2815,7 +2811,7 @@
"@executable_path/../Frameworks", "@executable_path/../Frameworks",
); );
MTL_FAST_MATH = YES; MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.algoritmico.macos.Passepartout.Launcher; PRODUCT_BUNDLE_IDENTIFIER = "$(CFG_APP_LAUNCHER_ID)";
PRODUCT_NAME = PassepartoutLauncher; PRODUCT_NAME = PassepartoutLauncher;
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = macosx; SDKROOT = macosx;

View File

@ -38,7 +38,7 @@ class AppDelegate: NSObject {
extension AppDelegate: NSApplicationDelegate { extension AppDelegate: NSApplicationDelegate {
func applicationDidFinishLaunching(_ aNotification: Notification) { func applicationDidFinishLaunching(_ aNotification: Notification) {
let mainAppIdentifier = "com.algoritmico.macos.Passepartout" // XXX: hardcoded let mainAppIdentifier = "com.algoritmico.ios.Passepartout" // XXX: hardcoded
let runningApps = NSWorkspace.shared.runningApplications let runningApps = NSWorkspace.shared.runningApplications
let isRunning = !runningApps.filter { $0.bundleIdentifier == mainAppIdentifier }.isEmpty let isRunning = !runningApps.filter { $0.bundleIdentifier == mainAppIdentifier }.isEmpty