Skip to content

Commit 6604ffa

Browse files
authored
Update targets and CI for 8.9.0 (#8830)
1 parent 80e0394 commit 6604ffa

File tree

9 files changed

+33
-26
lines changed

9 files changed

+33
-26
lines changed

.github/workflows/analytics.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,18 @@ jobs:
1818
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
1919

2020
runs-on: macos-11
21+
22+
strategy:
23+
matrix:
24+
target: [ios, tvos, macos]
2125
steps:
2226
- uses: actions/checkout@v2
2327
- name: Setup Bundler
2428
run: scripts/setup_bundler.sh
2529
- name: GoogleAppMeasurement
26-
run: scripts/third_party/travis/retry.sh pod spec lint GoogleAppMeasurement.podspec.json --sources=https://github.com/firebase/SpecsDev.git,https://github.com/firebase/SpecsStaging.git,https://cdn.cocoapods.org/
30+
run: scripts/third_party/travis/retry.sh pod spec lint GoogleAppMeasurement.podspec.json --platforms=${{ matrix.target }} --sources=https://github.com/firebase/SpecsDev.git,https://github.com/firebase/SpecsStaging.git,https://cdn.cocoapods.org/
2731
- name: FirebaseAnalyticsSwift
28-
run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseAnalyticsSwift.podspec --platforms=ios
32+
run: scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseAnalyticsSwift.podspec --platforms=${{ matrix.target }}
2933

3034
# TODO: Consider pushing GoogleAppMeasurement.podspec.json to SpecsDev to enable similar test
3135
# for FirebaseAnalytics.podspec.json

.github/workflows/spm.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ jobs:
3737
- uses: actions/checkout@v2
3838
- name: Initialize xcodebuild
3939
run: scripts/setup_spm_tests.sh
40-
- name: iOS Unit Tests
41-
# TODO (#7785) Change to Firebase-Package when #7785 is resolved.
42-
run: scripts/third_party/travis/retry.sh ./scripts/build.sh FirebaseFirestoreSwift-Beta iOS-device spmbuildonly
40+
- name: iOS Device and Test Build
41+
run: scripts/third_party/travis/retry.sh ./scripts/build.sh Firebase-Package iOS-device spmbuildonly
4342

4443
platforms:
4544
# Don't run on private repo unless it is a PR.
@@ -60,3 +59,5 @@ jobs:
6059
run: scripts/third_party/travis/retry.sh ./scripts/build.sh swift-test ${{ matrix.target }} spm
6160
- name: Version Tests
6261
run: scripts/third_party/travis/retry.sh ./scripts/build.sh version-test ${{ matrix.target }} spm
62+
- name: Analytics Build Tests
63+
run: scripts/third_party/travis/retry.sh ./scripts/build.sh analytics-import-test ${{ matrix.target }} spm

Firebase.podspec

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ Simplify your app development, grow your user base, and monetize more effectivel
3333
s.subspec 'Core' do |ss|
3434
ss.ios.deployment_target = '9.0'
3535
ss.osx.deployment_target = '10.12'
36-
ss.tvos.deployment_target = '10.0'
36+
ss.tvos.deployment_target = '12.0'
3737
ss.ios.dependency 'FirebaseAnalytics', '~> 8.9.0'
38+
ss.osx.dependency 'FirebaseAnalytics', '~> 8.9.0'
39+
ss.tvos.dependency 'FirebaseAnalytics', '~> 8.9.0'
3840
ss.dependency 'Firebase/CoreOnly'
3941
end
4042

@@ -59,16 +61,22 @@ Simplify your app development, grow your user base, and monetize more effectivel
5961

6062
s.subspec 'Analytics' do |ss|
6163
ss.ios.deployment_target = '9.0'
64+
ss.osx.deployment_target = '10.12'
65+
ss.tvos.deployment_target = '12.0'
6266
ss.dependency 'Firebase/Core'
6367
end
6468

6569
s.subspec 'AnalyticsWithAdIdSupport' do |ss|
6670
ss.ios.deployment_target = '9.0'
71+
ss.osx.deployment_target = '10.12'
72+
ss.tvos.deployment_target = '12.0'
6773
ss.dependency 'Firebase/Core'
6874
end
6975

7076
s.subspec 'AnalyticsWithoutAdIdSupport' do |ss|
7177
ss.ios.deployment_target = '9.0'
78+
ss.osx.deployment_target = '10.12'
79+
ss.tvos.deployment_target = '12.0'
7280
ss.ios.dependency 'FirebaseAnalytics/WithoutAdIdSupport', '~> 8.9.0'
7381
ss.dependency 'Firebase/CoreOnly'
7482
end

FirebaseAnalyticsSwift.podspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Firebase Analytics is a free, out-of-the-box analytics solution that inspires ac
1919
s.static_framework = true
2020
s.swift_version = '5.0'
2121
s.ios.deployment_target = '13.0'
22+
s.osx.deployment_target = '10.15'
23+
s.tvos.deployment_target = '13.0'
2224

2325
s.cocoapods_version = '>= 1.10.0'
2426
s.prefix_header_file = false

FirebaseAnalyticsSwift/Sources/Analytics+SwiftUI.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@
1717
import SwiftUI
1818

1919
/// Custom view modifier to allow for easily logging screen view events.
20-
@available(iOS 13, *)
21-
@available(tvOS, unavailable)
22-
@available(macOS, unavailable)
23-
@available(macCatalyst, unavailable)
20+
@available(iOS 13.0, macOS 10.15, macCatalyst 13.0, tvOS 13.0, *)
2421
@available(watchOS, unavailable)
2522
internal struct LoggedAnalyticsModifier: ViewModifier {
2623
/// The name of the view to log in the `AnalyticsParameterScreenName` parameter.
@@ -45,10 +42,7 @@
4542
}
4643
}
4744

48-
@available(iOS 13, *)
49-
@available(tvOS, unavailable)
50-
@available(macOS, unavailable)
51-
@available(macCatalyst, unavailable)
45+
@available(iOS 13.0, macOS 10.15, macCatalyst 13.0, tvOS 13.0, *)
5246
@available(watchOS, unavailable)
5347
public extension View {
5448
/// Logs `screen_view` events in Google Analytics for Firebase when this view appears on screen.

Package.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ let firebaseVersion = "8.9.0"
2121

2222
let package = Package(
2323
name: "Firebase",
24-
platforms: [.iOS(.v11), .macOS(.v10_12), .tvOS(.v10), .watchOS(.v7)],
24+
platforms: [.iOS(.v11), .macOS(.v10_12), .tvOS(.v12), .watchOS(.v7)],
2525
products: [
2626
.library(
2727
name: "FirebaseAnalytics",
@@ -275,10 +275,10 @@ let package = Package(
275275
.target(
276276
name: "FirebaseAnalyticsWrapper",
277277
dependencies: [
278-
.target(name: "FirebaseAnalytics", condition: .when(platforms: [.iOS])),
278+
.target(name: "FirebaseAnalytics", condition: .when(platforms: [.iOS, .macOS, .tvOS])),
279279
.product(name: "GoogleAppMeasurement",
280280
package: "GoogleAppMeasurement",
281-
condition: .when(platforms: [.iOS])),
281+
condition: .when(platforms: [.iOS, .macOS, .tvOS])),
282282
"FirebaseCore",
283283
"FirebaseInstallations",
284284
.product(name: "GULAppDelegateSwizzler", package: "GoogleUtilities"),
@@ -303,7 +303,7 @@ let package = Package(
303303
.target(
304304
name: "FirebaseAnalyticsSwiftTarget",
305305
dependencies: [.target(name: "FirebaseAnalyticsSwift",
306-
condition: .when(platforms: [.iOS]))],
306+
condition: .when(platforms: [.iOS, .macOS, .tvOS]))],
307307
path: "SwiftPM-PlatformExclude/FirebaseAnalyticsSwiftWrap"
308308
),
309309
.target(
@@ -315,13 +315,13 @@ let package = Package(
315315
.target(
316316
name: "FirebaseAnalyticsWithoutAdIdSupportTarget",
317317
dependencies: [.target(name: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
318-
condition: .when(platforms: [.iOS]))],
318+
condition: .when(platforms: [.iOS, .macOS, .tvOS]))],
319319
path: "SwiftPM-PlatformExclude/FirebaseAnalyticsWithoutAdIdSupportWrap"
320320
),
321321
.target(
322322
name: "FirebaseAnalyticsWithoutAdIdSupportWrapper",
323323
dependencies: [
324-
.target(name: "FirebaseAnalytics", condition: .when(platforms: [.iOS])),
324+
.target(name: "FirebaseAnalytics", condition: .when(platforms: [.iOS, .macOS, .tvOS])),
325325
.product(name: "GoogleAppMeasurementWithoutAdIdSupport",
326326
package: "GoogleAppMeasurement",
327327
condition: .when(platforms: [.iOS])),

SwiftPM-PlatformExclude/FirebaseAnalyticsSwiftWrap/dummy.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
// limitations under the License.
1414

1515
#import <TargetConditionals.h>
16-
#if !TARGET_OS_IOS
17-
#warning "Firebase Analytics only supports the iOS platform"
16+
#if TARGET_OS_WATCH
17+
#warning "Firebase Analytics does not support the watchOS platform"
1818
#endif

SwiftPMTests/analytics-import-test/analytics-import.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ class importTest: XCTestCase {
2525
parameters: [AnalyticsParameterShipping: 10.0])
2626
}
2727

28-
@available(iOS 13, *)
29-
@available(tvOS, unavailable)
30-
@available(macOS, unavailable)
31-
@available(macCatalyst, unavailable)
28+
@available(iOS 13.0, macOS 10.15, macCatalyst 13.0, tvOS 13.0, *)
3229
@available(watchOS, unavailable)
3330
func testAnalyticsSwiftImported() {
3431
_ = Text("Hello, Analytics")

scripts/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ fi
158158

159159
ios_device_flags=(
160160
-sdk 'iphoneos'
161+
-destination 'generic/platform=iOS'
161162
)
162163

163164
ipad_flags=(

0 commit comments

Comments
 (0)