From 7fc5a6477f5aeb9528af302f158892327572b6f3 Mon Sep 17 00:00:00 2001 From: Muhammad Umer Date: Fri, 24 Nov 2023 14:09:07 +0500 Subject: [PATCH] chore: add google and microsoft scheme (#172) * chore: add microsoft and google scheme to info.plist * fix: fix config tests file reference --- Core/Core.xcodeproj/project.pbxproj | 24 ++++++++++++++++++++---- config_script/process_config.py | 16 +++++++++++++--- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/Core/Core.xcodeproj/project.pbxproj b/Core/Core.xcodeproj/project.pbxproj index 0ee74bea0..036526d61 100644 --- a/Core/Core.xcodeproj/project.pbxproj +++ b/Core/Core.xcodeproj/project.pbxproj @@ -122,9 +122,9 @@ 07DDFCBD29A780BB00572595 /* UINavigationController+Animation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07DDFCBC29A780BB00572595 /* UINavigationController+Animation.swift */; }; C8C446EF233F81B9FABB77D2 /* Pods_App_Core.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 349B90CD6579F7B8D257E515 /* Pods_App_Core.framework */; }; CFC84952299F8B890055E497 /* Debounce.swift in Sources */ = {isa = PBXBuildFile; fileRef = CFC84951299F8B890055E497 /* Debounce.swift */; }; + DB4EBE9E2B1075E100CB4DC4 /* ConfigTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB4EBE9D2B1075E100CB4DC4 /* ConfigTests.swift */; }; DBF6F2412B014ADA0098414B /* FirebaseConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBF6F2402B014ADA0098414B /* FirebaseConfig.swift */; }; DBF6F2462B01DAFE0098414B /* AgreementConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBF6F2452B01DAFE0098414B /* AgreementConfig.swift */; }; - DBF6F2482B01E20A0098414B /* ConfigTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBF6F2472B01E20A0098414B /* ConfigTests.swift */; }; DBF6F24A2B0380E00098414B /* FeaturesConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBF6F2492B0380E00098414B /* FeaturesConfig.swift */; }; /* End PBXBuildFile section */ @@ -263,9 +263,9 @@ 9D5B06CAA99EA5CD49CBE2BB /* Pods-App-Core.debugdev.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App-Core.debugdev.xcconfig"; path = "Target Support Files/Pods-App-Core/Pods-App-Core.debugdev.xcconfig"; sourceTree = ""; }; C7E5BCE79CE297B20777B27A /* Pods-App-Core.debugprod.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App-Core.debugprod.xcconfig"; path = "Target Support Files/Pods-App-Core/Pods-App-Core.debugprod.xcconfig"; sourceTree = ""; }; CFC84951299F8B890055E497 /* Debounce.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Debounce.swift; sourceTree = ""; }; + DB4EBE9D2B1075E100CB4DC4 /* ConfigTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConfigTests.swift; sourceTree = ""; }; DBF6F2402B014ADA0098414B /* FirebaseConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirebaseConfig.swift; sourceTree = ""; }; DBF6F2452B01DAFE0098414B /* AgreementConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AgreementConfig.swift; sourceTree = ""; }; - DBF6F2472B01E20A0098414B /* ConfigTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfigTests.swift; sourceTree = ""; }; DBF6F2492B0380E00098414B /* FeaturesConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeaturesConfig.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -491,7 +491,7 @@ children = ( 0770DE5328D0B00C006D8A5D /* swiftgen.yml */, 0770DE0A28D07831006D8A5D /* Core */, - 078525AC2B0CBFF4007B4521 /* CoreTests */, + DB4EBE9B2B1075E100CB4DC4 /* CoreTests */, 0770DE0928D07831006D8A5D /* Products */, C9DFE47E699CFFA85A77AF2C /* Pods */, F1620A3A2C8B0699EAA61B57 /* Frameworks */, @@ -637,6 +637,22 @@ path = Combine; sourceTree = ""; }; + DB4EBE9B2B1075E100CB4DC4 /* CoreTests */ = { + isa = PBXGroup; + children = ( + DB4EBE9C2B1075E100CB4DC4 /* Configuration */, + ); + path = CoreTests; + sourceTree = ""; + }; + DB4EBE9C2B1075E100CB4DC4 /* Configuration */ = { + isa = PBXGroup; + children = ( + DB4EBE9D2B1075E100CB4DC4 /* ConfigTests.swift */, + ); + path = Configuration; + sourceTree = ""; + }; DBF6F2422B014AF30098414B /* Config */ = { isa = PBXGroup; children = ( @@ -823,7 +839,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - DBF6F2482B01E20A0098414B /* ConfigTests.swift in Sources */, + DB4EBE9E2B1075E100CB4DC4 /* ConfigTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/config_script/process_config.py b/config_script/process_config.py index 6941ce096..dd24319b0 100644 --- a/config_script/process_config.py +++ b/config_script/process_config.py @@ -94,7 +94,8 @@ def write_to_plist_file(self, plist, file_path): file_name = os.path.basename(file_path) with open(file_path, 'wb') as plist_file: plistlib.dump(plist, plist_file) - print(f"File {file_name} has been written to {file_path}") + print(f"File {file_name} has been written to:") + print(f"{file_path}") def print_info_plist_contents(self, plist_path): if not plist_path: @@ -136,7 +137,13 @@ def add_url_scheme(self, scheme, plist): if not found: existing.append(body) plist['CFBundleURLTypes'] = existing - + + def add_application_query_schemes(self, schemes, plist): + existing = plist.get('LSApplicationQueriesSchemes', []) + for scheme in schemes: + if scheme not in existing: + existing.append(scheme) + plist['LSApplicationQueriesSchemes'] = existing return plist def add_firebase_config(self, config, firebase_info_plist_path): @@ -179,8 +186,10 @@ def add_facebook_config(self, config, plist): def add_google_config(self, config, plist): google = config.get('GOOGLE', {}) key = google.get('GOOGLE_PLUS_KEY') + client_id = google.get('CLIENT_ID') - if key: + if key and client_id: + plist["GIDClientID"] = client_id scheme = ['.'.join(reversed(key.split('.')))] self.add_url_scheme(scheme, plist) @@ -192,6 +201,7 @@ def add_microsoft_config(self, config, plist): bundle_identifier = self.plist_manager.get_bundle_identifier() scheme = ["msauth." + bundle_identifier] self.add_url_scheme(scheme, plist) + self.add_application_query_schemes(["msauthv2", "msauthv3"], plist) def update_info_plist(self, plist_data, plist_path): if not plist_path: