From 48556bd051e0c4c49b56802d0835d2185bfe1e8d Mon Sep 17 00:00:00 2001 From: Fahim Farook Date: Tue, 24 Jan 2023 21:59:20 +0530 Subject: [PATCH] xcconfig Support (#342) * xcconfig Support * Added supporting an xcconfig file so that multiple users can build/work with the project without needing to change signing info * Added a template xcconfig file to be shared in repo (your xcconfig file is never committed to Git repo) * Updated README * Ignore xcconfig File * Add the users xcconfig file to .gitignore * Update README.md * Update README.md as per review suggestions * Add release config Co-authored-by: Thomas Ricouard --- .gitignore | 1 + IceCubesApp-release.xcconfig | 2 ++ IceCubesApp.xcconfig.template | 2 ++ IceCubesApp.xcodeproj/project.pbxproj | 30 +++++++++++-------- IceCubesApp/IceCubesApp.entitlements | 4 +-- .../IceCubesNotifications.entitlements | 4 +-- .../IceCubesShareExtension.entitlements | 4 +-- README.md | 12 ++++++++ 8 files changed, 41 insertions(+), 18 deletions(-) create mode 100644 IceCubesApp-release.xcconfig create mode 100644 IceCubesApp.xcconfig.template diff --git a/.gitignore b/.gitignore index 4f201677..2b3283aa 100644 --- a/.gitignore +++ b/.gitignore @@ -89,3 +89,4 @@ fastlane/test_output iOSInjectionProject/ .DS_Store +IceCubesApp.xcconfig \ No newline at end of file diff --git a/IceCubesApp-release.xcconfig b/IceCubesApp-release.xcconfig new file mode 100644 index 00000000..a18ee0b2 --- /dev/null +++ b/IceCubesApp-release.xcconfig @@ -0,0 +1,2 @@ +DEVELOPMENT_TEAM = Z6P74P6T99 +BUNDLE_ID_PREFIX = com.thomasricouard diff --git a/IceCubesApp.xcconfig.template b/IceCubesApp.xcconfig.template new file mode 100644 index 00000000..6c76aad3 --- /dev/null +++ b/IceCubesApp.xcconfig.template @@ -0,0 +1,2 @@ +DEVELOPMENT_TEAM = YOUR_TEAM_ID +BUNDLE_ID_PREFIX = com.example diff --git a/IceCubesApp.xcodeproj/project.pbxproj b/IceCubesApp.xcodeproj/project.pbxproj index 68b817a4..7f5f2d09 100644 --- a/IceCubesApp.xcodeproj/project.pbxproj +++ b/IceCubesApp.xcodeproj/project.pbxproj @@ -152,6 +152,7 @@ 9F7335F82968576500AFF0BA /* DisplaySettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisplaySettingsView.swift; sourceTree = ""; }; 9F7D9391297FA50400EE6B7A /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = ja; path = ja.lproj/Localizable.stringsdict; sourceTree = ""; }; 9F7D9392297FA50400EE6B7A /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = ja.lproj/Localizable.strings; sourceTree = ""; }; + 9F7D939529800B0300EE6B7A /* IceCubesApp-release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "IceCubesApp-release.xcconfig"; sourceTree = ""; }; 9FAD85822971BF7200496AB1 /* Secret.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Secret.plist; sourceTree = ""; }; 9FAD858829743F7400496AB1 /* IceCubesShareExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = IceCubesShareExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; 9FAD858A29743F7400496AB1 /* ShareViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareViewController.swift; sourceTree = ""; }; @@ -169,6 +170,7 @@ 9FE151A5293C90F900E9683D /* IconSelectorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconSelectorView.swift; sourceTree = ""; }; 9FE3DB55296FEF5800628CB0 /* AppAccount */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = AppAccount; path = Packages/AppAccount; sourceTree = ""; }; C465A53D297C5E0C00864FB7 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = ""; }; + DD31E2E5297FB68B00A4BE29 /* IceCubesApp.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = IceCubesApp.xcconfig; sourceTree = ""; }; E9B576C429743F4C00BCE646 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; E9B576CC2974AAAF00BCE646 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; }; F355EEDA297A8BD500E362C0 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = ""; }; @@ -306,6 +308,8 @@ 9FBFE630292A715500C250E9 = { isa = PBXGroup; children = ( + DD31E2E5297FB68B00A4BE29 /* IceCubesApp.xcconfig */, + 9F7D939529800B0300EE6B7A /* IceCubesApp-release.xcconfig */, 9FBFE63B292A715500C250E9 /* IceCubesApp */, 9F2A5417296AB631009B2D7C /* IceCubesNotifications */, 9FAD858929743F7400496AB1 /* IceCubesShareExtension */, @@ -659,7 +663,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 730; - DEVELOPMENT_TEAM = Z6P74P6T99; + DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)"; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = IceCubesNotifications/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = IceCubesNotifications; @@ -671,7 +675,7 @@ "@executable_path/../../Frameworks", ); MARKETING_VERSION = 1.0.10; - PRODUCT_BUNDLE_IDENTIFIER = com.thomasricouard.IceCubesApp.IceCubesNotifications; + PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID_PREFIX).IceCubesApp.IceCubesNotifications"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; SKIP_INSTALL = YES; @@ -689,7 +693,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 730; - DEVELOPMENT_TEAM = Z6P74P6T99; + DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)"; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = IceCubesNotifications/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = IceCubesNotifications; @@ -701,7 +705,7 @@ "@executable_path/../../Frameworks", ); MARKETING_VERSION = 1.0.10; - PRODUCT_BUNDLE_IDENTIFIER = com.thomasricouard.IceCubesApp.IceCubesNotifications; + PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID_PREFIX).IceCubesApp.IceCubesNotifications"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; SKIP_INSTALL = YES; @@ -720,7 +724,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 730; - DEVELOPMENT_TEAM = Z6P74P6T99; + DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)"; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = IceCubesShareExtension/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "Ice Cubes"; @@ -732,7 +736,7 @@ "@executable_path/../../Frameworks", ); MARKETING_VERSION = 1.0.10; - PRODUCT_BUNDLE_IDENTIFIER = com.thomasricouard.IceCubesApp.IceCubesShareExtension; + PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID_PREFIX).IceCubesApp.IceCubesShareExtension"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; SKIP_INSTALL = YES; @@ -750,7 +754,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 730; - DEVELOPMENT_TEAM = Z6P74P6T99; + DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)"; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = IceCubesShareExtension/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = "Ice Cubes"; @@ -762,7 +766,7 @@ "@executable_path/../../Frameworks", ); MARKETING_VERSION = 1.0.10; - PRODUCT_BUNDLE_IDENTIFIER = com.thomasricouard.IceCubesApp.IceCubesShareExtension; + PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID_PREFIX).IceCubesApp.IceCubesShareExtension"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; SKIP_INSTALL = YES; @@ -775,6 +779,7 @@ }; 9FBFE646292A715600C250E9 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = DD31E2E5297FB68B00A4BE29 /* IceCubesApp.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; @@ -835,6 +840,7 @@ }; 9FBFE647292A715600C250E9 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 9F7D939529800B0300EE6B7A /* IceCubesApp-release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; @@ -902,7 +908,7 @@ CURRENT_PROJECT_VERSION = 730; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"IceCubesApp/Resources\""; - DEVELOPMENT_TEAM = Z6P74P6T99; + DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)"; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; @@ -926,7 +932,7 @@ "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 13.0; MARKETING_VERSION = 1.0.10; - PRODUCT_BUNDLE_IDENTIFIER = com.thomasricouard.IceCubesApp; + PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID_PREFIX).IceCubesApp"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = auto; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; @@ -954,7 +960,7 @@ CURRENT_PROJECT_VERSION = 730; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"IceCubesApp/Resources\""; - DEVELOPMENT_TEAM = Z6P74P6T99; + DEVELOPMENT_TEAM = "$(DEVELOPMENT_TEAM)"; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; @@ -978,7 +984,7 @@ "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 13.0; MARKETING_VERSION = 1.0.10; - PRODUCT_BUNDLE_IDENTIFIER = com.thomasricouard.IceCubesApp; + PRODUCT_BUNDLE_IDENTIFIER = "$(BUNDLE_ID_PREFIX).IceCubesApp"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = auto; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; diff --git a/IceCubesApp/IceCubesApp.entitlements b/IceCubesApp/IceCubesApp.entitlements index 85188eba..be5dba77 100644 --- a/IceCubesApp/IceCubesApp.entitlements +++ b/IceCubesApp/IceCubesApp.entitlements @@ -8,13 +8,13 @@ com.apple.security.application-groups - group.icecubesapps + group.$(BUNDLE_ID_PREFIX).IceCubesApp com.apple.security.files.user-selected.read-only keychain-access-groups - $(AppIdentifierPrefix)com.thomasricouard.IceCubesApp + $(AppIdentifierPrefix)$(BUNDLE_ID_PREFIX).IceCubesApp diff --git a/IceCubesNotifications/IceCubesNotifications.entitlements b/IceCubesNotifications/IceCubesNotifications.entitlements index 8ffdc6f3..187bce3e 100644 --- a/IceCubesNotifications/IceCubesNotifications.entitlements +++ b/IceCubesNotifications/IceCubesNotifications.entitlements @@ -4,11 +4,11 @@ com.apple.security.application-groups - group.icecubesapps + group.$(BUNDLE_ID_PREFIX).IceCubesApp keychain-access-groups - $(AppIdentifierPrefix)com.thomasricouard.IceCubesApp + $(AppIdentifierPrefix)$(BUNDLE_ID_PREFIX).IceCubesApp diff --git a/IceCubesShareExtension/IceCubesShareExtension.entitlements b/IceCubesShareExtension/IceCubesShareExtension.entitlements index 8ffdc6f3..187bce3e 100644 --- a/IceCubesShareExtension/IceCubesShareExtension.entitlements +++ b/IceCubesShareExtension/IceCubesShareExtension.entitlements @@ -4,11 +4,11 @@ com.apple.security.application-groups - group.icecubesapps + group.$(BUNDLE_ID_PREFIX).IceCubesApp keychain-access-groups - $(AppIdentifierPrefix)com.thomasricouard.IceCubesApp + $(AppIdentifierPrefix)$(BUNDLE_ID_PREFIX).IceCubesApp diff --git a/README.md b/README.md index fdc4e681..fc90974f 100644 --- a/README.md +++ b/README.md @@ -31,3 +31,15 @@ Please note that IceCubesApp is currently in an early stage of development and a Thanks! ![Icon](IceCubesApp/Assets.xcassets/AppIcon.appiconset/icon.png?) + +## Building the project + +To build the project, you need to clone the repo and create a copy of the included `.xcconfig` file to create your config before you can compile the project. **Otherwise, you will get an error.** + +Here are the steps: + +1. Clone the repo +2. In the same folder that contains the `IceCubesApp.xcconfig.template`, run this command: + - cp IceCubesApp.xcconfig.template IceCubesApp.xcconfig +3. Fill in the `DEVELOPMENT_TEAM` and `BUNDLE_ID_PREFIX` values. The first should have your Apple Team ID (which you can find by logging into the Apple Developer Portal). The latter is your domain in reverse notation or whatever you use as the prefix for your projects. +4. Save your changes, and then you should be able to compile the project without any issues.