Skip to content

Commit 0aacd28

Browse files
authored
Travis to Xcode 11.0 (#3944)
1 parent 865e289 commit 0aacd28

File tree

3 files changed

+28
-20
lines changed

3 files changed

+28
-20
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
os: osx
2-
osx_image: xcode10.3
2+
osx_image: xcode11
33
language: objective-c
44
cache:
55
- bundler
@@ -256,6 +256,7 @@ jobs:
256256
- travis_retry ./scripts/if_changed.sh ./scripts/pod_lib_lint.rb FirebaseFunctions.podspec --use-modular-headers
257257

258258
- stage: test
259+
osx_image: xcode10.3
259260
env:
260261
- PROJECT=InAppMessaging PLATFORM=iOS METHOD=xcodebuild
261262
before_install:
@@ -328,6 +329,7 @@ jobs:
328329
- travis_wait 45 ./scripts/pod_lib_lint.rb FirebaseFirestore.podspec --use-libraries --allow-warnings --no-subspecs
329330

330331
- stage: test
332+
osx_image: xcode10.3
331333
env:
332334
- PROJECT=GoogleDataTransport METHOD=pod-lib-lint
333335
script:

Example/Database/Tests/Unit/FLevelDBStorageEngineTests.m

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ - (void)testHugeLeafNodeThenDeeperSet {
473473
// It is kind of bad we raise "invalid" data, but at least we don't crash *trollface*
474474
- (void)testExtremeDoublesAsServerCache {
475475
#ifdef TARGET_OS_IOS
476-
if ([[NSProcessInfo processInfo] operatingSystemVersion].majorVersion == 11) {
476+
if ([[NSProcessInfo processInfo] operatingSystemVersion].majorVersion >= 11) {
477477
// NSJSONSerialization on iOS 11 correctly serializes small and large doubles.
478478
return;
479479
}
@@ -532,8 +532,14 @@ - (void)testIntegersAreReturnedsAsIntegers {
532532
XCTAssertEqual(CFNumberGetType((CFNumberRef)actualInt), kCFNumberSInt64Type);
533533
XCTAssertEqualObjects([actualLong stringValue], [longValue stringValue]);
534534
XCTAssertEqual(CFNumberGetType((CFNumberRef)actualLong), kCFNumberSInt64Type);
535-
#if TARGET_OS_MACCATALYST
536-
// Catalyst uses int128_t but CFNumber still calls it 64 bits
535+
#ifdef TARGET_OS_IOS
536+
// Catalyst and iOS 13 use int128_t but CFNumber still calls it 64 bits.
537+
if ([[NSProcessInfo processInfo] operatingSystemVersion].majorVersion >= 13) {
538+
XCTAssertEqual(CFNumberGetType((CFNumberRef)actualDouble), kCFNumberSInt64Type);
539+
} else {
540+
XCTAssertEqual(CFNumberGetType((CFNumberRef)actualDouble), kCFNumberFloat64Type);
541+
}
542+
#elif TARGET_OS_MACCATALYST
537543
XCTAssertEqual(CFNumberGetType((CFNumberRef)actualDouble), kCFNumberSInt64Type);
538544
#else
539545
XCTAssertEqual(CFNumberGetType((CFNumberRef)actualDouble), kCFNumberFloat64Type);

scripts/build.sh

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,22 @@ function RunXcodebuild() {
9191
fi
9292
}
9393

94-
ios_flags=(
95-
-sdk 'iphonesimulator'
96-
-destination 'platform=iOS Simulator,name=iPhone 7'
97-
)
94+
# Remove each product when it moves up to Xcode 11
95+
if [[ $product == 'Firestore' || # #3949
96+
$product == 'GoogleDataTransport' || # #3947
97+
$product == 'InAppMessaging' # #3948
98+
]]; then
99+
ios_flags=(
100+
-sdk 'iphonesimulator'
101+
-destination 'platform=iOS Simulator,name=iPhone 7'
102+
)
103+
else
104+
ios_flags=(
105+
-sdk 'iphonesimulator'
106+
-destination 'platform=iOS Simulator,name=iPhone 11'
107+
)
108+
fi
109+
98110
macos_flags=(
99111
-sdk 'macosx'
100112
-destination 'platform=OS X,arch=x86_64'
@@ -201,18 +213,6 @@ case "$product-$method-$platform" in
201213
if [[ $platform == 'iOS' ]]; then
202214
# Code Coverage collection is only working on iOS currently.
203215
./scripts/collect_metrics.sh 'Example/Firebase.xcworkspace' "AllUnitTests_$platform"
204-
205-
# Test iOS Objective-C static library build
206-
cd Example
207-
sed -i -e 's/use_frameworks/\#use_frameworks/' Podfile
208-
pod update --no-repo-update
209-
cd ..
210-
RunXcodebuild \
211-
-workspace 'Example/Firebase.xcworkspace' \
212-
-scheme "AllUnitTests_$platform" \
213-
"${xcb_flags[@]}" \
214-
build \
215-
test
216216
fi
217217
;;
218218

0 commit comments

Comments
 (0)