Skip to content

Commit f22918d

Browse files
authored
[Infra] Add sample app to test building SPM distro across supported platforms (#11150)
* Add client sample app * Build script changes and workflow changes * Style * Add note about special analytics libraries * Undo unintentional change * Update spm.yml * Update spm.yml * Fix CI for now * Workflow works locally- not on GHA? * Disable xcpretty in build.sh * Fix CI * Get PR in passing state * Fix CI for good
1 parent 230c008 commit f22918d

File tree

16 files changed

+1048
-0
lines changed

16 files changed

+1048
-0
lines changed

.github/workflows/spm.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,22 @@ jobs:
7777
run: scripts/third_party/travis/retry.sh ./scripts/build.sh version-test ${{ matrix.target }} spm
7878
- name: Analytics Build Tests
7979
run: scripts/third_party/travis/retry.sh ./scripts/build.sh analytics-import-test ${{ matrix.target }} spm
80+
81+
client-app:
82+
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
83+
env:
84+
FIREBASECI_USE_LATEST_GOOGLEAPPMEASUREMENT: 1
85+
runs-on: macos-12
86+
strategy:
87+
matrix:
88+
platform: [iOS]
89+
# TODO(Xcode 14.3): Remove above line and uncomment below array when GHA
90+
# supports Ventura/Xcode 14.3.
91+
# platform: [iOS, tvOS, macOS, catalyst]
92+
steps:
93+
- uses: actions/checkout@v3
94+
- uses: mikehardy/buildcache-action@c87cea0ccd718971d6cc39e672c4f26815b6c126
95+
with:
96+
cache_key: ${{ matrix.os }}
97+
- name: Build Client App –– ${{ matrix.platform }}
98+
run: scripts/third_party/travis/retry.sh ./scripts/build.sh SwiftPMClientApp ${{ matrix.platform }} xcodebuild

Package.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ let package = Package(
2929
name: "FirebaseAnalytics",
3030
targets: ["FirebaseAnalyticsTarget"]
3131
),
32+
// This library is not designed to be imported into client source code.
3233
.library(
3334
name: "FirebaseAnalyticsWithoutAdIdSupport",
3435
targets: ["FirebaseAnalyticsWithoutAdIdSupportTarget"]
3536
),
37+
// This library is not designed to be imported into client source code.
3638
.library(
3739
name: "FirebaseAnalyticsOnDeviceConversion",
3840
targets: ["FirebaseAnalyticsOnDeviceConversionTarget"]

SwiftPMTests/ClientApp/ClientApp.xcodeproj/project.pbxproj

Lines changed: 609 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"colors" : [
3+
{
4+
"idiom" : "universal"
5+
}
6+
],
7+
"info" : {
8+
"author" : "xcode",
9+
"version" : 1
10+
}
11+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"platform" : "ios",
6+
"size" : "1024x1024"
7+
},
8+
{
9+
"idiom" : "mac",
10+
"scale" : "1x",
11+
"size" : "16x16"
12+
},
13+
{
14+
"idiom" : "mac",
15+
"scale" : "2x",
16+
"size" : "16x16"
17+
},
18+
{
19+
"idiom" : "mac",
20+
"scale" : "1x",
21+
"size" : "32x32"
22+
},
23+
{
24+
"idiom" : "mac",
25+
"scale" : "2x",
26+
"size" : "32x32"
27+
},
28+
{
29+
"idiom" : "mac",
30+
"scale" : "1x",
31+
"size" : "128x128"
32+
},
33+
{
34+
"idiom" : "mac",
35+
"scale" : "2x",
36+
"size" : "128x128"
37+
},
38+
{
39+
"idiom" : "mac",
40+
"scale" : "1x",
41+
"size" : "256x256"
42+
},
43+
{
44+
"idiom" : "mac",
45+
"scale" : "2x",
46+
"size" : "256x256"
47+
},
48+
{
49+
"idiom" : "mac",
50+
"scale" : "1x",
51+
"size" : "512x512"
52+
},
53+
{
54+
"idiom" : "mac",
55+
"scale" : "2x",
56+
"size" : "512x512"
57+
}
58+
],
59+
"info" : {
60+
"author" : "xcode",
61+
"version" : 1
62+
}
63+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.app-sandbox</key>
6+
<true/>
7+
<key>com.apple.security.files.user-selected.read-only</key>
8+
<true/>
9+
</dict>
10+
</plist>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright 2023 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
import SwiftUI
16+
17+
@main
18+
struct ClientApp: App {
19+
var body: some Scene {
20+
WindowGroup {
21+
ContentView()
22+
}
23+
}
24+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Copyright 2023 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
import SwiftUI
16+
17+
struct ContentView: View {
18+
var body: some View {
19+
VStack {
20+
Image(systemName: "globe")
21+
.imageScale(.large)
22+
.foregroundColor(.accentColor)
23+
Text("Hello, world!")
24+
}
25+
.padding()
26+
}
27+
}
28+
29+
struct ContentView_Previews: PreviewProvider {
30+
static var previews: some View {
31+
ContentView()
32+
}
33+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}

0 commit comments

Comments
 (0)