Skip to content

Commit f76ae21

Browse files
authored
Fix GoogleUtilities regression for Firestore builds 2 (firebase#2433)
* Run Firestore builds/tests on GoogleUtilities changes * Silence macOS 10.10 warnings * Add cast to fix Firestore macOS builds
1 parent 9c41c87 commit f76ae21

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

GoogleUtilities/Logger/GULLogger.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
#import "GULLoggerLevel.h"
2020
#import "GULOSLogger.h"
2121

22+
#if TARGET_OS_IOS
23+
#import <UIKit/UIKit.h>
24+
#endif
25+
2226
static id<GULLoggerSystem> sGULLogger;
2327

2428
NSString *const kGULLoggerInvalidLoggerLevelCore = @"I-COR000023";

GoogleUtilities/Logger/Private/GULOSLogger.m

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
#import "GULLogger+Internal.h"
2323
#import "GULLoggerLevel.h"
2424

25+
#if TARGET_OS_IOS
26+
#import <UIKit/UIKit.h>
27+
#endif
28+
2529
NS_ASSUME_NONNULL_BEGIN
2630

2731
// Function which calls the macro so that this can be substituted for testing.
@@ -38,8 +42,14 @@ static void GULLOSLogWithType(os_log_t log, os_log_type_t type, char *s, ...) {
3842
va_start(args, s);
3943
#if TARGET_OS_TV
4044
os_log_with_type(log, type, "%s", (char *)args);
45+
#elif TARGET_OS_OSX
46+
// Silence macOS 10.10 warning until we move minimum to 10.11.
47+
#pragma clang diagnostic push
48+
#pragma clang diagnostic ignored "-Wunguarded-availability"
49+
os_log_with_type(log, type, "%s", (char *)args);
50+
#pragma clang diagnostic pop
4151
#else
42-
os_log_with_type(log, type, "%s", args);
52+
os_log_with_type(log, type, "%s", args);
4353
#endif
4454
va_end(args);
4555
} else {
@@ -169,7 +179,15 @@ - (void)logWithLevel:(GULLoggerLevel)level
169179
#else
170180
if ([[UIDevice currentDevice].systemVersion integerValue] >= 9) {
171181
#endif
182+
#if TARGET_OS_OSX
183+
// Silence macOS 10.10 warning until we move minimum to 10.11.
184+
#pragma clang diagnostic push
185+
#pragma clang diagnostic ignored "-Wunguarded-availability"
172186
osLog = os_log_create(kGULLoggerClientFacilityName, service.UTF8String);
187+
#pragma clang diagnostic pop
188+
#else
189+
osLog = os_log_create(kGULLoggerClientFacilityName, service.UTF8String);
190+
#endif
173191
self.categoryLoggers[service] = osLog;
174192
} else {
175193
#ifdef DEBUG

scripts/if_changed.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,12 @@ else
7171
;;
7272

7373
Firestore-xcodebuild|Firestore-pod-lib-lint)
74-
check_changes '^(Firestore|FirebaseFirestore.podspec|FirebaseFirestoreSwift.podspec)'
74+
check_changes '^(Firestore|FirebaseFirestore.podspec|FirebaseFirestoreSwift.podspec|'\
75+
'GoogleUtilities)'
7576
;;
7677

7778
Firestore-cmake)
78-
check_changes '^(Firestore/(core|third_party)|cmake)'
79+
check_changes '^(Firestore/(core|third_party)|cmake|GoogleUtilities)'
7980
;;
8081

8182
*)

0 commit comments

Comments
 (0)