Skip to content

Commit

Permalink
Firebase pod support for watchOS for RC and RTDB (firebase#7841)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulb777 authored Apr 5, 2021
1 parent 4ac2833 commit b163ec5
Show file tree
Hide file tree
Showing 6 changed files with 176 additions and 2 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/watchos-sample.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: watchos-sample

on:
pull_request:
paths:
# Sources
- 'FirebaseABTesting/**'
- 'FirebaseDatabase/**'
- 'FirebaseRemoteConfig/**'
- 'FirebaseStorage/**'
# Sample
- 'Example/watchOSSample/**'
# Firebase Podspec
- 'Firebase.podspec'
# This file
- '.github/workflows/watchos-sample.yml'
# Rebuild on Ruby infrastructure changes
- 'Gemfile*'
schedule:
# Run every day at 10pm (PST) - cron uses UTC times
- cron: '0 6 * * *'

jobs:

tv-sample-build-test:
# Don't run on private repo unless it is a PR.
if: (github.repository == 'Firebase/firebase-ios-sdk' && github.event_name == 'schedule') || github.event_name == 'pull_request'
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Setup Bundler
run: scripts/setup_bundler.sh
- name: Prereqs
run: scripts/install_prereqs.sh WatchOSSample watchOS
- name: Build
run: ([ -z $plist_secret ] || scripts/build.sh WatchOSSample watchOS)
10 changes: 8 additions & 2 deletions Example/watchOSSample/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ source 'https://cdn.cocoapods.org/'
use_frameworks!

target 'SampleWatchAppWatchKitExtension' do
platform :watchos, '6.0'
platform :watchos, '7.0'

pod 'FirebaseCore', :path => '../../'
pod 'FirebaseMessaging', :path => '../../'
Expand All @@ -15,12 +15,18 @@ target 'SampleWatchAppWatchKitExtension' do
pod 'FirebaseStorage', :path => '../../'
pod 'FirebaseRemoteConfig', :path => '../../'
pod 'FirebaseABTesting', :path => '../../'
pod 'FirebaseDatabase', :path => '../../'

pod 'Firebase/Messaging', :path => '../../'
pod 'Firebase/Storage', :path => '../../'
pod 'Firebase/RemoteConfig', :path => '../../'
pod 'Firebase/ABTesting', :path => '../../'
pod 'Firebase/Database', :path => '../../'

end

target 'ServiceExtension' do
platform :watchos, '6.0'
platform :watchos, '7.0'
pod 'FirebaseMessaging', :path => '../../'
pod 'FirebaseInstanceID', :path => '../../'
end
104 changes: 104 additions & 0 deletions Example/watchOSSample/SampleWatchApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
0C2B2F85A0156FBA8723F203 /* Pods_SampleWatchAppWatchKitExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6A1681F802CB688198BFE1E /* Pods_SampleWatchAppWatchKitExtension.framework */; };
5156947923F4965000E7C350 /* SampleWatchAppWatchKitApp.app in Embed Watch Content */ = {isa = PBXBuildFile; fileRef = 5156947823F4965000E7C350 /* SampleWatchAppWatchKitApp.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
5156947F23F4965000E7C350 /* Interface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5156947D23F4965000E7C350 /* Interface.storyboard */; };
5156948123F4965100E7C350 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5156948023F4965100E7C350 /* Assets.xcassets */; };
Expand All @@ -18,6 +19,7 @@
5156949523F4965200E7C350 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5156949423F4965200E7C350 /* Assets.xcassets */; };
515694AF23F4A3D200E7C350 /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 515694AE23F4A3D200E7C350 /* NotificationService.swift */; };
515694B323F4A3D200E7C350 /* ServiceExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 515694AC23F4A3D200E7C350 /* ServiceExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
9C1E62C8ACA2E9975F320A8C /* Pods_ServiceExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EBA935736290F9E72DB25FF /* Pods_ServiceExtension.framework */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -81,6 +83,7 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
3EBA935736290F9E72DB25FF /* Pods_ServiceExtension.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ServiceExtension.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5156947423F4965000E7C350 /* SampleWatchApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SampleWatchApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
5156947823F4965000E7C350 /* SampleWatchAppWatchKitApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SampleWatchAppWatchKitApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
5156947E23F4965000E7C350 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Interface.storyboard; sourceTree = "<group>"; };
Expand All @@ -98,6 +101,11 @@
515694AC23F4A3D200E7C350 /* ServiceExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = ServiceExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
515694AE23F4A3D200E7C350 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = "<group>"; };
515694B023F4A3D200E7C350 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
7FBA4340635BF194157452B9 /* Pods-SampleWatchAppWatchKitExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SampleWatchAppWatchKitExtension.release.xcconfig"; path = "Target Support Files/Pods-SampleWatchAppWatchKitExtension/Pods-SampleWatchAppWatchKitExtension.release.xcconfig"; sourceTree = "<group>"; };
C0064A1E379E237E54A9086B /* Pods-ServiceExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ServiceExtension.debug.xcconfig"; path = "Target Support Files/Pods-ServiceExtension/Pods-ServiceExtension.debug.xcconfig"; sourceTree = "<group>"; };
CB6479A86CC43D17D90F1E89 /* Pods-ServiceExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ServiceExtension.release.xcconfig"; path = "Target Support Files/Pods-ServiceExtension/Pods-ServiceExtension.release.xcconfig"; sourceTree = "<group>"; };
D6A1681F802CB688198BFE1E /* Pods_SampleWatchAppWatchKitExtension.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SampleWatchAppWatchKitExtension.framework; sourceTree = BUILT_PRODUCTS_DIR; };
DAE14C0BA7504E3EE4267A02 /* Pods-SampleWatchAppWatchKitExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SampleWatchAppWatchKitExtension.debug.xcconfig"; path = "Target Support Files/Pods-SampleWatchAppWatchKitExtension/Pods-SampleWatchAppWatchKitExtension.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -112,13 +120,15 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
0C2B2F85A0156FBA8723F203 /* Pods_SampleWatchAppWatchKitExtension.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
515694A923F4A3D200E7C350 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9C1E62C8ACA2E9975F320A8C /* Pods_ServiceExtension.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -132,13 +142,24 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
203C8A236AE31151AAF474A5 /* Frameworks */ = {
isa = PBXGroup;
children = (
D6A1681F802CB688198BFE1E /* Pods_SampleWatchAppWatchKitExtension.framework */,
3EBA935736290F9E72DB25FF /* Pods_ServiceExtension.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
5156946D23F4965000E7C350 = {
isa = PBXGroup;
children = (
5156947C23F4965000E7C350 /* SampleWatchAppWatchKitApp */,
5156948B23F4965100E7C350 /* SampleWatchAppWatchKitExtension */,
515694AD23F4A3D200E7C350 /* ServiceExtension */,
5156947523F4965000E7C350 /* Products */,
BD04909E80693ABDC7D720F6 /* Pods */,
203C8A236AE31151AAF474A5 /* Frameworks */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -187,6 +208,18 @@
path = ServiceExtension;
sourceTree = "<group>";
};
BD04909E80693ABDC7D720F6 /* Pods */ = {
isa = PBXGroup;
children = (
DAE14C0BA7504E3EE4267A02 /* Pods-SampleWatchAppWatchKitExtension.debug.xcconfig */,
7FBA4340635BF194157452B9 /* Pods-SampleWatchAppWatchKitExtension.release.xcconfig */,
C0064A1E379E237E54A9086B /* Pods-ServiceExtension.debug.xcconfig */,
CB6479A86CC43D17D90F1E89 /* Pods-ServiceExtension.release.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -230,10 +263,12 @@
isa = PBXNativeTarget;
buildConfigurationList = 5156949A23F4965200E7C350 /* Build configuration list for PBXNativeTarget "SampleWatchAppWatchKitExtension" */;
buildPhases = (
E5B1B049432440CF1A70B29A /* [CP] Check Pods Manifest.lock */,
5156948323F4965100E7C350 /* Sources */,
5156948423F4965100E7C350 /* Frameworks */,
5156948523F4965100E7C350 /* Resources */,
515694B723F4A3D200E7C350 /* Embed App Extensions */,
1AC64D8D8CEC350A7BE652AA /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand All @@ -249,6 +284,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 515694B423F4A3D200E7C350 /* Build configuration list for PBXNativeTarget "ServiceExtension" */;
buildPhases = (
36BFC0F6A337B1157B6D7C11 /* [CP] Check Pods Manifest.lock */,
515694A823F4A3D200E7C350 /* Sources */,
515694A923F4A3D200E7C350 /* Frameworks */,
515694AA23F4A3D200E7C350 /* Resources */,
Expand Down Expand Up @@ -341,6 +377,70 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
1AC64D8D8CEC350A7BE652AA /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-SampleWatchAppWatchKitExtension/Pods-SampleWatchAppWatchKitExtension-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-SampleWatchAppWatchKitExtension/Pods-SampleWatchAppWatchKitExtension-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SampleWatchAppWatchKitExtension/Pods-SampleWatchAppWatchKitExtension-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
36BFC0F6A337B1157B6D7C11 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-ServiceExtension-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
E5B1B049432440CF1A70B29A /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-SampleWatchAppWatchKitExtension-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
5156948323F4965100E7C350 /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down Expand Up @@ -507,6 +607,7 @@
};
5156949B23F4965200E7C350 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = DAE14C0BA7504E3EE4267A02 /* Pods-SampleWatchAppWatchKitExtension.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_COMPLICATION_NAME = Complication;
CODE_SIGN_ENTITLEMENTS = SampleWatchAppWatchKitExtension/SampleWatchAppWatchKitExtension.entitlements;
Expand All @@ -532,6 +633,7 @@
};
5156949C23F4965200E7C350 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7FBA4340635BF194157452B9 /* Pods-SampleWatchAppWatchKitExtension.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_COMPLICATION_NAME = Complication;
CODE_SIGN_ENTITLEMENTS = SampleWatchAppWatchKitExtension/SampleWatchAppWatchKitExtension.entitlements;
Expand Down Expand Up @@ -629,6 +731,7 @@
};
515694B523F4A3D200E7C350 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = C0064A1E379E237E54A9086B /* Pods-ServiceExtension.debug.xcconfig */;
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Manual;
Expand All @@ -653,6 +756,7 @@
};
515694B623F4A3D200E7C350 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = CB6479A86CC43D17D90F1E89 /* Pods-ServiceExtension.release.xcconfig */;
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Manual;
Expand Down
15 changes: 15 additions & 0 deletions Firebase.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ Simplify your app development, grow your user base, and monetize more effectivel
s.subspec 'ABTesting' do |ss|
ss.dependency 'Firebase/CoreOnly'
ss.dependency 'FirebaseABTesting', '~> 7.10.0'
# Standard platforms PLUS watchOS.
ss.ios.deployment_target = '10.0'
ss.osx.deployment_target = '10.12'
ss.tvos.deployment_target = '10.0'
ss.watchos.deployment_target = '6.0'
end

s.subspec 'AdMob' do |ss|
Expand Down Expand Up @@ -101,6 +106,11 @@ Simplify your app development, grow your user base, and monetize more effectivel
s.subspec 'Database' do |ss|
ss.dependency 'Firebase/CoreOnly'
ss.dependency 'FirebaseDatabase', '~> 7.10.0'
# Standard platforms PLUS watchOS 7.
ss.ios.deployment_target = '10.0'
ss.osx.deployment_target = '10.12'
ss.tvos.deployment_target = '10.0'
ss.watchos.deployment_target = '7.0'
end

s.subspec 'DynamicLinks' do |ss|
Expand Down Expand Up @@ -151,6 +161,11 @@ Simplify your app development, grow your user base, and monetize more effectivel
s.subspec 'RemoteConfig' do |ss|
ss.dependency 'Firebase/CoreOnly'
ss.dependency 'FirebaseRemoteConfig', '~> 7.10.0'
# Standard platforms PLUS watchOS.
ss.ios.deployment_target = '10.0'
ss.osx.deployment_target = '10.12'
ss.tvos.deployment_target = '10.0'
ss.watchos.deployment_target = '6.0'
end

s.subspec 'Storage' do |ss|
Expand Down
8 changes: 8 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,14 @@ case "$product-$platform-$method" in
build
;;

WatchOSSample-*-*)
RunXcodebuild \
-workspace 'Example/watchOSSample/SampleWatchApp.xcworkspace' \
-scheme "SampleWatchAppWatchKitApp" \
"${xcb_flags[@]}" \
build
;;

Database-*-unit)
pod_gen FirebaseDatabase.podspec --platforms="${gen_platform}"
RunXcodebuild \
Expand Down
5 changes: 5 additions & 0 deletions scripts/install_prereqs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ case "$project-$platform-$method" in
bundle exec pod install --project-directory=FirebaseSegmentation/Tests/Sample --repo-update
;;

WatchOSSample-*)
install_xcpretty
bundle exec pod install --project-directory=Example/watchOSSample --repo-update
;;

GoogleDataTransport-watchOS-xcodebuild)
install_xcpretty
bundle exec pod install --project-directory=GoogleDataTransport/GDTWatchOSTestApp/ --repo-update
Expand Down

0 comments on commit b163ec5

Please sign in to comment.