Skip to content

Commit

Permalink
chore: add google and microsoft scheme (#172)
Browse files Browse the repository at this point in the history
* chore: add microsoft and google scheme to info.plist

* fix: fix config tests file reference
  • Loading branch information
mumer92 authored Nov 24, 2023
1 parent 1296cb9 commit 7fc5a64
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
24 changes: 20 additions & 4 deletions Core/Core.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down Expand Up @@ -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 = "<group>"; };
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 = "<group>"; };
CFC84951299F8B890055E497 /* Debounce.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Debounce.swift; sourceTree = "<group>"; };
DB4EBE9D2B1075E100CB4DC4 /* ConfigTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConfigTests.swift; sourceTree = "<group>"; };
DBF6F2402B014ADA0098414B /* FirebaseConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirebaseConfig.swift; sourceTree = "<group>"; };
DBF6F2452B01DAFE0098414B /* AgreementConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AgreementConfig.swift; sourceTree = "<group>"; };
DBF6F2472B01E20A0098414B /* ConfigTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfigTests.swift; sourceTree = "<group>"; };
DBF6F2492B0380E00098414B /* FeaturesConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeaturesConfig.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -491,7 +491,7 @@
children = (
0770DE5328D0B00C006D8A5D /* swiftgen.yml */,
0770DE0A28D07831006D8A5D /* Core */,
078525AC2B0CBFF4007B4521 /* CoreTests */,
DB4EBE9B2B1075E100CB4DC4 /* CoreTests */,
0770DE0928D07831006D8A5D /* Products */,
C9DFE47E699CFFA85A77AF2C /* Pods */,
F1620A3A2C8B0699EAA61B57 /* Frameworks */,
Expand Down Expand Up @@ -637,6 +637,22 @@
path = Combine;
sourceTree = "<group>";
};
DB4EBE9B2B1075E100CB4DC4 /* CoreTests */ = {
isa = PBXGroup;
children = (
DB4EBE9C2B1075E100CB4DC4 /* Configuration */,
);
path = CoreTests;
sourceTree = "<group>";
};
DB4EBE9C2B1075E100CB4DC4 /* Configuration */ = {
isa = PBXGroup;
children = (
DB4EBE9D2B1075E100CB4DC4 /* ConfigTests.swift */,
);
path = Configuration;
sourceTree = "<group>";
};
DBF6F2422B014AF30098414B /* Config */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -823,7 +839,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
DBF6F2482B01E20A0098414B /* ConfigTests.swift in Sources */,
DB4EBE9E2B1075E100CB4DC4 /* ConfigTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
16 changes: 13 additions & 3 deletions config_script/process_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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)

Expand All @@ -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:
Expand Down

0 comments on commit 7fc5a64

Please sign in to comment.