Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5e33dfa

Browse files
ReedyuksajidalidevCopilot
authored
Added TvOS, MacOS, iOSX64 support (#770)
* Add support for tvOS and update dependencies Updated the build configuration to include support for tvOS by setting deployment targets and adjusting Kotlin opt-ins. Also, updated Gradle and library versions to their latest stable releases as of commit `9b4c5f6`. This change ensures compatibility with new platforms while leveraging the latest features and improvements in dependencies. * Add macOS Support and Extend Platform Coverage Updated the build configuration to include support for macOS by setting appropriate deployment targets. Enhanced platform coverage by adding macOS targets to existing iOS, tvOS, and Kotlin opt-ins. Updated Gradle and library versions to their latest stable releases, ensuring compatibility with new platforms while leveraging recent improvements in dependencies. * Added iosX64 * attempt to update github actions * Added Apple target skip * Adjusted tvos and macos * Added missing target for macos and adjusted folder name * Added skips * Added missing macos check * hardcoded 16.4 xcode * Adjusted test matrix * Adjusted test matrix * Added platform types to projects. * Added check on plugins * adjusted check on plugins * Added platform filtering for test utils * Added platform filtering for test utils * Adjusted emulator matrix. * Adjusted emulator matrix. * Updated Xcode version to 16.2 in CI configuration files and adjusted supported targets for Firebase Crashlytics * Added fix for firebase storage * Adjusted to xcode 16.4 * bumped kotlin * Added ability to skip test targets * Adjusted tests. * Update firebase-database/build.gradle.kts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update firebase-auth/build.gradle.kts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update firebase-auth/build.gradle.kts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update firebase-auth/build.gradle.kts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Removed keychain function for macos * Removed keychain function for tvos * not needed for ios arm64 * osx not macos * Adjusted for error message on opt in * Added more opt in * removed firebase auth for macos. --------- Co-authored-by: Sajid Ali <sajidhanif865@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 213546b commit 5e33dfa

File tree

74 files changed

+1429
-1048
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1429
-1048
lines changed

‎.github/workflows/publish.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: chmod +x gradlew
3232
- uses: maxim-lobanov/setup-xcode@v1
3333
with:
34-
xcode-version: latest-stable
34+
xcode-version: '16.4'
3535
- name: Publish Firebase Analytics
3636
run: ./gradlew :firebase-analytics:publish
3737
- name: Publish Firebase App
@@ -74,7 +74,7 @@ jobs:
7474
run: chmod +x gradlew
7575
- uses: maxim-lobanov/setup-xcode@v1
7676
with:
77-
xcode-version: latest-stable
77+
xcode-version: '16.4'
7878
- name: Generate documentation
7979
run: ./gradlew dokkaHtmlMultiModule
8080
- name: Uploading build folder

‎.github/workflows/pull_request.yml‎

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
outputs:
1818
emulator_jobs_matrix: ${{ steps.dataStep.outputs.emulator_jobs_matrix }}
1919
ios_test_jobs_matrix: ${{ steps.dataStep.outputs.ios_test_jobs_matrix }}
20+
macos_test_jobs_matrix: ${{ steps.dataStep.outputs.macos_test_jobs_matrix }}
21+
tvos_test_jobs_matrix: ${{ steps.dataStep.outputs.tvos_test_jobs_matrix }}
2022
js_test_jobs_matrix: ${{ steps.dataStep.outputs.js_test_jobs_matrix }}
2123
jvm_test_jobs_matrix: ${{ steps.dataStep.outputs.jvm_test_jobs_matrix }}
2224
steps:
@@ -34,6 +36,8 @@ jobs:
3436
echo "
3537
emulator_jobs_matrix=$(jq -c . < ./build/emulator_jobs_matrix.json)
3638
ios_test_jobs_matrix=$(jq -c . < ./build/ios_test_jobs_matrix.json)
39+
macos_test_jobs_matrix=$(jq -c . < ./build/macos_test_jobs_matrix.json)
40+
tvos_test_jobs_matrix=$(jq -c . < ./build/tvos_test_jobs_matrix.json)
3741
js_test_jobs_matrix=$(jq -c . < ./build/js_test_jobs_matrix.json)
3842
jvm_test_jobs_matrix=$(jq -c . < ./build/jvm_test_jobs_matrix.json)
3943
" >> $GITHUB_OUTPUT
@@ -121,7 +125,7 @@ jobs:
121125
key: cocoapods-cache-v2
122126
- uses: maxim-lobanov/setup-xcode@v1
123127
with:
124-
xcode-version: latest-stable
128+
xcode-version: '16.4'
125129
- name: Setup test environment
126130
uses: ./.github/actions/setup_test_action
127131
- name: Set Artifact Name
@@ -141,6 +145,84 @@ jobs:
141145
with:
142146
name: iOS ${{ env.ARCHIVE_KEY }} Firebase Debug Log
143147
path: "**/firebase-debug.log"
148+
build-macos:
149+
needs: jobMatrixSetup
150+
runs-on: macos-15
151+
strategy:
152+
fail-fast: false
153+
matrix: ${{ fromJson(needs.jobMatrixSetup.outputs.macos_test_jobs_matrix) }}
154+
steps:
155+
- uses: actions/checkout@v4
156+
- name: Cocoapods cache
157+
uses: actions/cache@v4
158+
with:
159+
path: |
160+
~/.cocoapods
161+
~/Library/Caches/CocoaPods
162+
*/build/cocoapods
163+
*/build/classes
164+
key: cocoapods-cache-v2
165+
- uses: maxim-lobanov/setup-xcode@v1
166+
with:
167+
xcode-version: '16.4'
168+
- name: Setup test environment
169+
uses: ./.github/actions/setup_test_action
170+
- name: Set Artifact Name
171+
run: |
172+
echo "ARCHIVE_KEY=$(echo ${{ matrix.gradle_tasks }} | cut -d: -f2)" >> $GITHUB_ENV
173+
- name: Run macOS Tests
174+
run: ./gradlew ${{ matrix.gradle_tasks }}
175+
- name: Upload macOS test artifact
176+
uses: actions/upload-artifact@v4
177+
if: failure()
178+
with:
179+
name: macOS ${{ env.ARCHIVE_KEY }} Test Report HTML
180+
path: "**/build/reports/tests/macosArm64Test/"
181+
- name: Upload Firebase Debug Log
182+
uses: actions/upload-artifact@v4
183+
if: failure()
184+
with:
185+
name: macOS ${{ env.ARCHIVE_KEY }} Firebase Debug Log
186+
path: "**/firebase-debug.log"
187+
build-tvos:
188+
needs: jobMatrixSetup
189+
runs-on: macos-15
190+
strategy:
191+
fail-fast: false
192+
matrix: ${{ fromJson(needs.jobMatrixSetup.outputs.tvos_test_jobs_matrix) }}
193+
steps:
194+
- uses: actions/checkout@v4
195+
- name: Cocoapods cache
196+
uses: actions/cache@v4
197+
with:
198+
path: |
199+
~/.cocoapods
200+
~/Library/Caches/CocoaPods
201+
*/build/cocoapods
202+
*/build/classes
203+
key: cocoapods-cache-v2
204+
- uses: maxim-lobanov/setup-xcode@v1
205+
with:
206+
xcode-version: '16.4'
207+
- name: Setup test environment
208+
uses: ./.github/actions/setup_test_action
209+
- name: Set Artifact Name
210+
run: |
211+
echo "ARCHIVE_KEY=$(echo ${{ matrix.gradle_tasks }} | cut -d: -f2)" >> $GITHUB_ENV
212+
- name: Run tvOS Tests
213+
run: ./gradlew ${{ matrix.gradle_tasks }}
214+
- name: Upload tvOS test artifact
215+
uses: actions/upload-artifact@v4
216+
if: failure()
217+
with:
218+
name: tvOS ${{ env.ARCHIVE_KEY }} Test Report HTML
219+
path: "**/build/reports/tests/tvosArm64Test/"
220+
- name: Upload Firebase Debug Log
221+
uses: actions/upload-artifact@v4
222+
if: failure()
223+
with:
224+
name: tvOS ${{ env.ARCHIVE_KEY }} Firebase Debug Log
225+
path: "**/firebase-debug.log"
144226
build-jvm:
145227
needs: jobMatrixSetup
146228
runs-on: ubuntu-latest

‎.github/workflows/pull_request_target.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
key: cocoapods-cache-v2
3333
- uses: maxim-lobanov/setup-xcode@v1
3434
with:
35-
xcode-version: latest-stable
35+
xcode-version: '16.4'
3636
- name: Format Kotlin
3737
run: ./gradlew formatKotlin
3838
- name: Api File Update

‎buildSrc/build.gradle.kts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
plugins {
2+
`kotlin-dsl`
3+
}
4+
5+
repositories {
6+
gradlePluginPortal()
7+
}

‎buildSrc/src/main/kotlin/Utils.kt‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package utils
2+
3+
enum class TargetPlatform {
4+
Android, Ios, Macos, Tvos, Jvm, Js
5+
}
6+
7+
fun String.toTargetPlatforms(): List<TargetPlatform> =
8+
split(",").map {
9+
when (it.lowercase().trim()) {
10+
"android" -> TargetPlatform.Android
11+
"ios" -> TargetPlatform.Ios
12+
"macos" -> TargetPlatform.Macos
13+
"tvos" -> TargetPlatform.Tvos
14+
"jvm" -> TargetPlatform.Jvm
15+
"js" -> TargetPlatform.Js
16+
else -> throw IllegalArgumentException("Unknown target platform: $it")
17+
}
18+
}
19+
20+
fun List<TargetPlatform>.supportsApple() = this.any {
21+
it == TargetPlatform.Ios || it == TargetPlatform.Macos || it == TargetPlatform.Tvos
22+
}

‎convention-plugin-test-option/src/main/kotlin/EmulatorJobsMatrix.kt‎

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class EmulatorJobsMatrix {
1616
mapOf(
1717
"emulator_jobs_matrix.json" to getEmulatorTaskList(rootProject = rootProject),
1818
"ios_test_jobs_matrix.json" to getIosTestTaskList(rootProject = rootProject),
19+
"macos_test_jobs_matrix.json" to getMacosTestTaskList(rootProject = rootProject),
20+
"tvos_test_jobs_matrix.json" to getTvosTestTaskList(rootProject = rootProject),
1921
"js_test_jobs_matrix.json" to getJsTestTaskList(rootProject = rootProject),
2022
"jvm_test_jobs_matrix.json" to getJvmTestTaskList(rootProject = rootProject)
2123
)
@@ -32,27 +34,49 @@ class EmulatorJobsMatrix {
3234

3335
fun getIosTestTaskList(rootProject: Project): List<List<String>> =
3436
rootProject.subprojects.filter { subProject ->
35-
subProject.name=="test-utils"||
36-
(rootProject.property("${subProject.name}.skipIosTests") == "true").not()
37+
(subProject.property("${subProject.name}.supportedTestTargets") asString).toTargetPlatforms().contains(
38+
TargetPlatform.Ios) ||subProject.name == "test-utils"
3739
}.map { subProject ->
3840
when (val osArch = System.getProperty("os.arch")) {
3941
"arm64", "arm-v8", "aarch64" -> "${subProject.path}:iosSimulatorArm64Test"
4042
else -> throw Error("Unexpected System.getProperty(\"os.arch\") = $osArch")
4143
}
4244
}.map { listOf("cleanTest", it) }
4345

46+
fun getMacosTestTaskList(rootProject: Project): List<List<String>> =
47+
rootProject.subprojects.filter { subProject ->
48+
(subProject.property("${subProject.name}.supportedTestTargets") as String).toTargetPlatforms().contains(
49+
TargetPlatform.Macos) || subProject.name == "test-utils"
50+
}.map { subProject ->
51+
when (val osArch = System.getProperty("os.arch")) {
52+
"arm64", "arm-v8", "aarch64" -> "${subProject.path}:macosArm64Test"
53+
else -> throw Error("Unexpected System.getProperty(\"os.arch\") = $osArch")
54+
}
55+
}.map { listOf("cleanTest", it) }
56+
57+
fun getTvosTestTaskList(rootProject: Project): List<List<String>> =
58+
rootProject.subprojects.filter { subProject ->
59+
(subProject.property("${subProject.name}.supportedTestTargets") as String).toTargetPlatforms().contains(
60+
TargetPlatform.Tvos) || subProject.name == "test-utils"
61+
}.map { subProject ->
62+
when (val osArch = System.getProperty("os.arch")) {
63+
"arm64", "arm-v8", "aarch64" -> "${subProject.path}:tvosSimulatorArm64Test"
64+
else -> throw Error("Unexpected System.getProperty(\"os.arch\") = $osArch")
65+
}
66+
}.map { listOf("cleanTest", it) }
67+
4468
fun getJsTestTaskList(rootProject: Project): List<List<String>> =
4569
rootProject.subprojects.filter { subProject ->
46-
subProject.name=="test-utils"||
47-
(rootProject.property("${subProject.name}.skipJsTests") == "true").not()
70+
(subProject.property("${subProject.name}.supportedTestTargets") asString).toTargetPlatforms().contains(
71+
TargetPlatform.Js) ||subProject.name == "test-utils"
4872
}.map { subProject ->
4973
"${subProject.path}:jsTest"
5074
}.map { listOf("cleanTest", it) }
5175

5276
fun getJvmTestTaskList(rootProject: Project): List<List<String>> =
5377
rootProject.subprojects.filter { subProject ->
54-
subProject.name=="test-utils"||
55-
(rootProject.property("${subProject.name}.skipJvmTests") == "true").not()
78+
(subProject.property("${subProject.name}.supportedTestTargets") asString).toTargetPlatforms().contains(
79+
TargetPlatform.Jvm) ||subProject.name == "test-utils"
5680
}.map { subProject ->
5781
"${subProject.path}:jvmTest"
5882
}.map { listOf("cleanTest", it) }
@@ -101,3 +125,20 @@ fun getSdkmanagerFile(rootDir: File): File? =
101125
println("sdkmanagerFile: $sdkmanagerFile")
102126
sdkmanagerFile
103127
}
128+
129+
enum class TargetPlatform {
130+
Android, Ios, Macos, Tvos, Jvm, Js
131+
}
132+
133+
fun String.toTargetPlatforms(): List<TargetPlatform> =
134+
split(",").map {
135+
when (it.lowercase().trim()) {
136+
"android" -> TargetPlatform.Android
137+
"ios" -> TargetPlatform.Ios
138+
"macos" -> TargetPlatform.Macos
139+
"tvos" -> TargetPlatform.Tvos
140+
"jvm" -> TargetPlatform.Jvm
141+
"js" -> TargetPlatform.Js
142+
else -> throw IllegalArgumentException("Unknown target platform: $it")
143+
}
144+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /