Skip to content

Commit 2779d9c

Browse files
authored
Fix warnings in FIAM test projects (#5171)
* Migrate UI test project to Swift 5 * Fix warning in application:continueUserActivity: method signature * Update to recommended settings in functional test apps * Update to recommended settings in functional tests app * Change organization name to Firebase, treat warnings as error
1 parent 4e900ca commit 2779d9c

File tree

7 files changed

+34
-32
lines changed

7 files changed

+34
-32
lines changed

FirebaseInAppMessaging/Tests/Integration/DefaultUITestApp/FiamDisplaySwiftExample/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import UIKit
1919
class AppDelegate: UIResponder, UIApplicationDelegate {
2020
var window: UIWindow?
2121

22-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
22+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
2323
// Override point for customization after application launch.
2424
return true
2525
}

FirebaseInAppMessaging/Tests/Integration/DefaultUITestApp/FiamDisplaySwiftExample/CommonMessageTestVC.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class CommonMessageTestVC: UIViewController, InAppMessagingDisplayDelegate {
8282
UIGraphicsEndImageContext()
8383

8484
if let image = imageFromGraphics {
85-
return UIImagePNGRepresentation(image)
85+
return image.pngData()
8686
} else {
8787
return nil
8888
}

FirebaseInAppMessaging/Tests/Integration/DefaultUITestApp/InAppMessagingDisplay-Sample.xcodeproj/project.pbxproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,11 @@
170170
TargetAttributes = {
171171
AD7200B12124D19200AFD5F3 = {
172172
CreatedOnToolsVersion = 9.4.1;
173+
LastSwiftMigration = 1130;
173174
};
174175
AD7200D02125F92100AFD5F3 = {
175176
CreatedOnToolsVersion = 9.4.1;
177+
LastSwiftMigration = 1130;
176178
TestTargetID = AD7200B12124D19200AFD5F3;
177179
};
178180
};
@@ -287,7 +289,7 @@
287289
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
288290
"SWIFT_OBJC_BRIDGING_HEADER[arch=*]" = ../../../../FirebaseInAppMessaging/Sources/DefaultUI/FirebaseInAppMessagingDisplay.h;
289291
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
290-
SWIFT_VERSION = 4.0;
292+
SWIFT_VERSION = 5.0;
291293
TARGETED_DEVICE_FAMILY = "1,2";
292294
};
293295
name = Debug;
@@ -307,7 +309,7 @@
307309
SWIFT_COMPILATION_MODE = wholemodule;
308310
"SWIFT_OBJC_BRIDGING_HEADER[arch=*]" = ../../../../FirebaseInAppMessaging/Sources/DefaultUI/FirebaseInAppMessagingDisplay.h;
309311
SWIFT_OPTIMIZATION_LEVEL = "-O";
310-
SWIFT_VERSION = 4.0;
312+
SWIFT_VERSION = 5.0;
311313
TARGETED_DEVICE_FAMILY = "1,2";
312314
};
313315
name = Release;
@@ -326,7 +328,7 @@
326328
PRODUCT_NAME = "$(TARGET_NAME)";
327329
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
328330
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
329-
SWIFT_VERSION = 4.0;
331+
SWIFT_VERSION = 5.0;
330332
TARGETED_DEVICE_FAMILY = "1,2";
331333
TEST_TARGET_NAME = FiamDisplaySwiftExample;
332334
};
@@ -346,7 +348,7 @@
346348
PRODUCT_NAME = "$(TARGET_NAME)";
347349
SWIFT_COMPILATION_MODE = wholemodule;
348350
SWIFT_OPTIMIZATION_LEVEL = "-O";
349-
SWIFT_VERSION = 4.0;
351+
SWIFT_VERSION = 5.0;
350352
TARGETED_DEVICE_FAMILY = "1,2";
351353
TEST_TARGET_NAME = FiamDisplaySwiftExample;
352354
};

FirebaseInAppMessaging/Tests/Integration/FunctionalTestApp/App/InAppMessaging-Example-iOS/AppDelegate.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ - (BOOL)application:(UIApplication *)application
6767

6868
- (BOOL)application:(UIApplication *)application
6969
continueUserActivity:(NSUserActivity *)userActivity
70-
restorationHandler:(void (^)(NSArray *))restorationHandler {
70+
restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> *))restorationHandler {
7171
NSLog(@"handle page url %@", userActivity.webpageURL);
7272
BOOL handled = [[FIRDynamicLinks dynamicLinks]
7373
handleUniversalLink:userActivity.webpageURL

FirebaseInAppMessaging/Tests/Integration/FunctionalTestApp/InAppMessaging-Example-iOS.xcodeproj/project.pbxproj

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@
342342
isa = PBXProject;
343343
attributes = {
344344
LastSwiftUpdateCheck = 0830;
345-
LastUpgradeCheck = 0900;
346-
ORGANIZATIONNAME = "Yong Mao";
345+
LastUpgradeCheck = 1130;
346+
ORGANIZATIONNAME = Firebase;
347347
TargetAttributes = {
348348
AD811A2C1F13F88800BF632A = {
349349
CreatedOnToolsVersion = 8.3.3;
@@ -543,6 +543,7 @@
543543
buildSettings = {
544544
ALWAYS_SEARCH_USER_PATHS = NO;
545545
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
546+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
546547
CLANG_ANALYZER_NONNULL = YES;
547548
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
548549
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
@@ -553,13 +554,15 @@
553554
CLANG_WARN_BOOL_CONVERSION = YES;
554555
CLANG_WARN_COMMA = YES;
555556
CLANG_WARN_CONSTANT_CONVERSION = YES;
557+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
556558
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
557559
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
558560
CLANG_WARN_EMPTY_BODY = YES;
559561
CLANG_WARN_ENUM_CONVERSION = YES;
560562
CLANG_WARN_INFINITE_RECURSION = YES;
561563
CLANG_WARN_INT_CONVERSION = YES;
562564
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
565+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
563566
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
564567
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
565568
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -599,6 +602,7 @@
599602
buildSettings = {
600603
ALWAYS_SEARCH_USER_PATHS = NO;
601604
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
605+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
602606
CLANG_ANALYZER_NONNULL = YES;
603607
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
604608
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
@@ -609,13 +613,15 @@
609613
CLANG_WARN_BOOL_CONVERSION = YES;
610614
CLANG_WARN_COMMA = YES;
611615
CLANG_WARN_CONSTANT_CONVERSION = YES;
616+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
612617
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
613618
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
614619
CLANG_WARN_EMPTY_BODY = YES;
615620
CLANG_WARN_ENUM_CONVERSION = YES;
616621
CLANG_WARN_INFINITE_RECURSION = YES;
617622
CLANG_WARN_INT_CONVERSION = YES;
618623
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
624+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
619625
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
620626
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
621627
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -657,6 +663,8 @@
657663
CODE_SIGN_STYLE = Manual;
658664
DEVELOPMENT_TEAM = EQHXZ8M8AV;
659665
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
666+
GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
667+
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
660668
HEADER_SEARCH_PATHS = (
661669
"$(inherited)",
662670
"\"${PODS_ROOT}/../../../Firebase/InAppMessaging/\"/**",
@@ -685,6 +693,8 @@
685693
CODE_SIGN_STYLE = Manual;
686694
DEVELOPMENT_TEAM = EQHXZ8M8AV;
687695
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
696+
GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES;
697+
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
688698
HEADER_SEARCH_PATHS = (
689699
"$(inherited)",
690700
"\"${PODS_ROOT}/../../../Firebase/InAppMessaging/\"/**",

FirebaseInAppMessaging/Tests/Integration/FunctionalTestApp/InAppMessaging-Example-iOS.xcodeproj/xcshareddata/xcschemes/InAppMessaging_Example_iOS.xcscheme

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "1130"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,8 +26,17 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
codeCoverageEnabled = "YES"
30-
shouldUseLaunchSchemeArgsEnv = "YES">
29+
shouldUseLaunchSchemeArgsEnv = "YES"
30+
codeCoverageEnabled = "YES">
31+
<MacroExpansion>
32+
<BuildableReference
33+
BuildableIdentifier = "primary"
34+
BlueprintIdentifier = "AD811A2C1F13F88800BF632A"
35+
BuildableName = "InAppMessaging_Example_iOS.app"
36+
BlueprintName = "InAppMessaging_Example_iOS"
37+
ReferencedContainer = "container:InAppMessaging-Example-iOS.xcodeproj">
38+
</BuildableReference>
39+
</MacroExpansion>
3140
<Testables>
3241
<TestableReference
3342
skipped = "NO">
@@ -40,17 +49,6 @@
4049
</BuildableReference>
4150
</TestableReference>
4251
</Testables>
43-
<MacroExpansion>
44-
<BuildableReference
45-
BuildableIdentifier = "primary"
46-
BlueprintIdentifier = "AD811A2C1F13F88800BF632A"
47-
BuildableName = "InAppMessaging_Example_iOS.app"
48-
BlueprintName = "InAppMessaging_Example_iOS"
49-
ReferencedContainer = "container:InAppMessaging-Example-iOS.xcodeproj">
50-
</BuildableReference>
51-
</MacroExpansion>
52-
<AdditionalOptions>
53-
</AdditionalOptions>
5452
</TestAction>
5553
<LaunchAction
5654
buildConfiguration = "Debug"
@@ -78,8 +76,6 @@
7876
isEnabled = "YES">
7977
</CommandLineArgument>
8078
</CommandLineArguments>
81-
<AdditionalOptions>
82-
</AdditionalOptions>
8379
</LaunchAction>
8480
<ProfileAction
8581
buildConfiguration = "Release"

FirebaseInAppMessaging/Tests/Integration/FunctionalTestApp/InAppMessaging-Example-iOS.xcodeproj/xcshareddata/xcschemes/InAppMessaging_Tests_iOS.xcscheme

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "1130"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -10,7 +10,6 @@
1010
buildConfiguration = "Debug"
1111
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
1212
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
13-
language = ""
1413
shouldUseLaunchSchemeArgsEnv = "YES"
1514
codeCoverageEnabled = "YES">
1615
<Testables>
@@ -35,22 +34,17 @@
3534
</BuildableReference>
3635
</TestableReference>
3736
</Testables>
38-
<AdditionalOptions>
39-
</AdditionalOptions>
4037
</TestAction>
4138
<LaunchAction
4239
buildConfiguration = "Debug"
4340
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4441
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
45-
language = ""
4642
launchStyle = "0"
4743
useCustomWorkingDirectory = "NO"
4844
ignoresPersistentStateOnLaunch = "NO"
4945
debugDocumentVersioning = "YES"
5046
debugServiceExtension = "internal"
5147
allowLocationSimulation = "YES">
52-
<AdditionalOptions>
53-
</AdditionalOptions>
5448
</LaunchAction>
5549
<ProfileAction
5650
buildConfiguration = "Release"

0 commit comments

Comments
 (0)