Skip to content

Commit

Permalink
(chore): Configure Mock GoogleService-Info.plist
Browse files Browse the repository at this point in the history
  • Loading branch information
N3v1 committed Oct 27, 2024
1 parent 3d48642 commit 5474891
Show file tree
Hide file tree
Showing 4 changed files with 266 additions and 5 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ jobs:
run: |
if [ "${{ matrix.os }}" == "iOS" ]; then
xcodebuild -scheme ScribbleLab -configuration ${{ matrix.configuration }} \
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" build | xcpretty | tee build.log
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" \
OTHER_SWIFT_FLAGS="-D CI_ENV" build | xcpretty | tee build.log
else
xcodebuild -scheme ScribbleLab -configuration ${{ matrix.configuration }} \
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" build | xcpretty | tee build.log
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" \
OTHER_SWIFT_FLAGS="-D CI_ENV" build | xcpretty | tee build.log
fi
echo "AUTOGENERATED BUILD.LOG VIA TEE:"
Expand All @@ -46,10 +48,12 @@ jobs:
run: |
if [ "${{ matrix.os }}" == "iOS" ]; then
xcodebuild test -scheme ScribbleLab -configuration ${{ matrix.configuration }} \
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" | xcpretty | tee test.log
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" \
OTHER_SWIFT_FLAGS="-D CI_ENV" | xcpretty | tee test.log
else
xcodebuild test -scheme ScribbleLab -configuration ${{ matrix.configuration }} \
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" | xcpretty | tee test.log
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" \
OTHER_SWIFT_FLAGS="-D CI_ENV" | xcpretty | tee test.log
fi
echo "AUTOGENERATED TEST.LOG VIA TEE:"
Expand Down
65 changes: 65 additions & 0 deletions GoogleService-Info-Mock.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- THIS FILE REPRESENTS A MOCK GOOGLESERVICE-INFO.PLIST -->
<!--
Copyright (c) 2024 ScribbleLabApp LLC. All rights reserved
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<!-- MOCK GOOGLESERVICE-INFO.PLIST [BEGIN] -->
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string></string>
<key>REVERSED_CLIENT_ID</key>
<string></string>
<key>API_KEY</key>
<string></string>
<key>GCM_SENDER_ID</key>
<string></string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string></string>
<key>PROJECT_ID</key>
<string></string>
<key>STORAGE_BUCKET</key>
<string></string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string></string>
</dict>
</plist>
<!-- MOCK GOOGLESERVICE-INFO.PLIST [END] -->
162 changes: 162 additions & 0 deletions ScribbleLab.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

/* Begin PBXBuildFile section */
3836ECE12CCC2AA800EBBD8B /* ScribbleFoundation in Frameworks */ = {isa = PBXBuildFile; productRef = 3836ECE02CCC2AA800EBBD8B /* ScribbleFoundation */; };
387BC5372CCE83F900B3D2A4 /* GoogleService-Info-Mock.plist in Resources */ = {isa = PBXBuildFile; fileRef = 387BC5362CCE83F900B3D2A4 /* GoogleService-Info-Mock.plist */; };
388038792CCBE5C1002494B7 /* Beta.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 388038782CCBE5C1002494B7 /* Beta.xcconfig */; };
3880387B2CCBE695002494B7 /* Alpha.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 3880387A2CCBE695002494B7 /* Alpha.xcconfig */; };
3880387D2CCBE6DD002494B7 /* Stable.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 3880387C2CCBE6DD002494B7 /* Stable.xcconfig */; };
Expand Down Expand Up @@ -45,6 +46,7 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
387BC5362CCE83F900B3D2A4 /* GoogleService-Info-Mock.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info-Mock.plist"; sourceTree = "<group>"; };
388038782CCBE5C1002494B7 /* Beta.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Beta.xcconfig; sourceTree = "<group>"; };
3880387A2CCBE695002494B7 /* Alpha.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Alpha.xcconfig; sourceTree = "<group>"; };
3880387C2CCBE6DD002494B7 /* Stable.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Stable.xcconfig; sourceTree = "<group>"; };
Expand Down Expand Up @@ -156,6 +158,7 @@
isa = PBXGroup;
children = (
388038B82CCBFDBE002494B7 /* PrivacyInfo.xcprivacy */,
387BC5362CCE83F900B3D2A4 /* GoogleService-Info-Mock.plist */,
388038A82CCBF74A002494B7 /* GoogleService-Info.plist */,
3880388F2CCBEAAE002494B7 /* Utilities */,
388038772CCBE59E002494B7 /* Configuration */,
Expand Down Expand Up @@ -315,6 +318,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
387BC5372CCE83F900B3D2A4 /* GoogleService-Info-Mock.plist in Resources */,
3880387F2CCBE76E002494B7 /* Development.xcconfig in Resources */,
388038792CCBE5C1002494B7 /* Beta.xcconfig in Resources */,
3880387B2CCBE695002494B7 /* Alpha.xcconfig in Resources */,
Expand Down Expand Up @@ -417,6 +421,160 @@
/* End PBXTargetDependency section */

/* Begin XCBuildConfiguration section */
387BC5382CCE892F00B3D2A4 /* CI_ENV */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3880387E2CCBE76E002494B7 /* Development.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GCC_C_LANGUAGE_STANDARD = gnu17;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"CI_ENV=1",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = CI_ENV;
};
387BC5392CCE892F00B3D2A4 /* CI_ENV */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3880387E2CCBE76E002494B7 /* Development.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = ScribbleLab/ScribbleLab.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"ScribbleLab/Preview Content\"";
DEVELOPMENT_TEAM = W93RMB5CDG;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = ScribbleLab/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = ScribbleLab;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.education";
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES;
"INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES;
"INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES;
"INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES;
"INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES;
"INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES;
INFOPLIST_KEY_UIStatusBarHidden = YES;
INFOPLIST_KEY_UIStatusBarStyle = "";
"INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault;
"INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault;
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
IPHONEOS_DEPLOYMENT_TARGET = 18.0;
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 14.5;
MARKETING_VERSION = "0.1-dev";
PRODUCT_BUNDLE_IDENTIFIER = com.nhsystems.ScribbleLab;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = auto;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,7";
XROS_DEPLOYMENT_TARGET = 2.0;
};
name = CI_ENV;
};
387BC53A2CCE892F00B3D2A4 /* CI_ENV */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3880387E2CCBE76E002494B7 /* Development.xcconfig */;
buildSettings = {
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = W93RMB5CDG;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 18.0;
MACOSX_DEPLOYMENT_TARGET = 14.5;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.nhsystems.ScribbleLabTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = auto;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,7";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ScribbleLab.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/ScribbleLab";
XROS_DEPLOYMENT_TARGET = 2.0;
};
name = CI_ENV;
};
387BC53B2CCE892F00B3D2A4 /* CI_ENV */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3880387E2CCBE76E002494B7 /* Development.xcconfig */;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = W93RMB5CDG;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 18.0;
MACOSX_DEPLOYMENT_TARGET = 14.5;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.nhsystems.ScribbleLabUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = auto;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator";
SWIFT_EMIT_LOC_STRINGS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,7";
TEST_TARGET_NAME = ScribbleLab;
XROS_DEPLOYMENT_TARGET = 2.0;
};
name = CI_ENV;
};
388038802CCBE829002494B7 /* Alpha */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3880387A2CCBE695002494B7 /* Alpha.xcconfig */;
Expand Down Expand Up @@ -1032,6 +1190,7 @@
isa = XCConfigurationList;
buildConfigurations = (
388DC8272CCBE37200C80FF9 /* Debug */,
387BC5382CCE892F00B3D2A4 /* CI_ENV */,
388038802CCBE829002494B7 /* Alpha */,
388038842CCBE86D002494B7 /* Beta */,
388DC8282CCBE37200C80FF9 /* Release */,
Expand All @@ -1043,6 +1202,7 @@
isa = XCConfigurationList;
buildConfigurations = (
388DC82A2CCBE37200C80FF9 /* Debug */,
387BC5392CCE892F00B3D2A4 /* CI_ENV */,
388038812CCBE829002494B7 /* Alpha */,
388038852CCBE86D002494B7 /* Beta */,
388DC82B2CCBE37200C80FF9 /* Release */,
Expand All @@ -1054,6 +1214,7 @@
isa = XCConfigurationList;
buildConfigurations = (
388DC82D2CCBE37200C80FF9 /* Debug */,
387BC53A2CCE892F00B3D2A4 /* CI_ENV */,
388038822CCBE829002494B7 /* Alpha */,
388038862CCBE86D002494B7 /* Beta */,
388DC82E2CCBE37200C80FF9 /* Release */,
Expand All @@ -1065,6 +1226,7 @@
isa = XCConfigurationList;
buildConfigurations = (
388DC8302CCBE37200C80FF9 /* Debug */,
387BC53B2CCE892F00B3D2A4 /* CI_ENV */,
388038832CCBE829002494B7 /* Alpha */,
388038872CCBE86D002494B7 /* Beta */,
388DC8312CCBE37200C80FF9 /* Release */,
Expand Down
32 changes: 31 additions & 1 deletion ScribbleLab/App/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,38 @@ class AppDelegate: NSObject, UIApplicationDelegate {
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil
) -> Bool {
FirebaseApp.configure()

// MARK: - GoogleService-Info.plist Selection
let gPlistFilePath: String

#if CI_ENV
guard let mockPlistPath = Bundle.main.path(
forResource: "GoogleService-Info-Mock",
ofType: "plist"
) else {
fatalError("CI Mock GoogleService-Info plist not found")
}

gPlistFilePath = mockPlistPath
#else
guard let localPlistPath = Bundle.main.path(
forResource: "GoogleService-Info",
ofType: "plist"
) else {
fatalError("Local GoogleService-Info plist not found")
}

gPlistFilePath = localPlistPath
#endif

guard let opts_file = FirebaseOptions(contentsOfFile: gPlistFilePath) else {
fatalError("Couldn't load options from file: \(gPlistFilePath)")
}

// MARK: - Firebase Configuration
FirebaseApp.configure(options: opts_file)

// MARK: - User Notification Configuration
application.registerForRemoteNotifications()

return true
Expand Down

0 comments on commit 5474891

Please sign in to comment.