From 7e5c3cd5edc8eba5da947d7abdf7981534f83ff4 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Tue, 10 Nov 2020 16:11:16 -0800 Subject: [PATCH 1/4] Update sample app for Firebase 7 and add build test to CI --- .github/workflows/segmentation.yml | 16 ++++++++++++++++ FirebaseSegmentation/Tests/Sample/Podfile | 5 ++++- .../project.pbxproj | 10 ++-------- .../Sample/SegmentationSampleApp/Info.plist | 9 +++++---- scripts/build.sh | 8 ++++++++ scripts/install_prereqs.sh | 5 +++++ 6 files changed, 40 insertions(+), 13 deletions(-) diff --git a/.github/workflows/segmentation.yml b/.github/workflows/segmentation.yml index 48a816a4578..1c0fde85382 100644 --- a/.github/workflows/segmentation.yml +++ b/.github/workflows/segmentation.yml @@ -61,3 +61,19 @@ jobs: run: | scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseSegmentation.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }} scripts/third_party/travis/retry.sh scripts/pod_lib_lint.rb FirebaseSegmentation.podspec --platforms=${{ matrix.target }} ${{ matrix.flags }} + + segmentation-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: Install Secret GoogleService-Info.plist + # Just copy a dummy plist for a build-only test + run: cp FirebaseCore/Tests/Unit/Resources/GoogleService-Info.plist FirebaseSegmentation/Tests/Sample/ + - name: Prereqs + run: scripts/install_prereqs.sh MessagingSample iOS + - name: Build + run: scripts/build.sh MessagingSample iOS diff --git a/FirebaseSegmentation/Tests/Sample/Podfile b/FirebaseSegmentation/Tests/Sample/Podfile index 9f52a7c02b5..35bd0109954 100644 --- a/FirebaseSegmentation/Tests/Sample/Podfile +++ b/FirebaseSegmentation/Tests/Sample/Podfile @@ -6,10 +6,13 @@ target 'SegmentationSampleApp' do # Comment the next line if you don't want to use dynamic frameworks use_frameworks! inherit! :search_paths - platform :ios, '8.0' + platform :ios, '10.0' # Pods for SegmentationSampleApp pod 'FirebaseCore', :path => '../../../' + pod 'FirebaseInstallations', :path => '../../../' pod 'FirebaseSegmentation', :path => '../../../' + pod 'GoogleDataTransport', :path => '../../../' + pod 'GoogleUtilities', :path => '../../../' end diff --git a/FirebaseSegmentation/Tests/Sample/SegmentationSampleApp.xcodeproj/project.pbxproj b/FirebaseSegmentation/Tests/Sample/SegmentationSampleApp.xcodeproj/project.pbxproj index 902dffc5bd8..9c666d9d542 100644 --- a/FirebaseSegmentation/Tests/Sample/SegmentationSampleApp.xcodeproj/project.pbxproj +++ b/FirebaseSegmentation/Tests/Sample/SegmentationSampleApp.xcodeproj/project.pbxproj @@ -31,11 +31,8 @@ 5B4DE0B022F8D7B300B55A7B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 5B4DE0B222F8D7B300B55A7B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 5B4DE0B322F8D7B300B55A7B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 5B4DE0BA22F8DA1200B55A7B /* SecondApp-GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SecondApp-GoogleService-Info.plist"; sourceTree = ""; }; 5B4DE0BB22F8DA1300B55A7B /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 5B4DE0BF22F8E07200B55A7B /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../../../../../configdaily googservice/GoogleService-Info.plist"; sourceTree = ""; }; - 5B4DE0C222F8E09900B55A7B /* SecondApp-GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SecondApp-GoogleService-Info.plist"; sourceTree = ""; }; - 5B4DE0C322F8E09900B55A7B /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -72,9 +69,6 @@ isa = PBXGroup; children = ( 5B4DE0BB22F8DA1300B55A7B /* GoogleService-Info.plist */, - 5B4DE0C322F8E09900B55A7B /* GoogleService-Info.plist */, - 5B4DE0BA22F8DA1200B55A7B /* SecondApp-GoogleService-Info.plist */, - 5B4DE0C222F8E09900B55A7B /* SecondApp-GoogleService-Info.plist */, 5B4DE0A322F8D7B100B55A7B /* SegmentationSampleApp */, 5B4DE0A222F8D7B100B55A7B /* Products */, 1DAAA9CDE17A7AD3D4D58BFA /* Pods */, @@ -373,7 +367,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.config.testapp.dev; + PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.paul.hackweek.nov2020; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "Firebase Remote Config TestApp Dev"; TARGETED_DEVICE_FAMILY = "1,2"; @@ -392,7 +386,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.config.testapp.dev; + PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.paul.hackweek.nov2020; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = "Firebase Remote Config TestApp Dev"; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/FirebaseSegmentation/Tests/Sample/SegmentationSampleApp/Info.plist b/FirebaseSegmentation/Tests/Sample/SegmentationSampleApp/Info.plist index 11970f5aaf1..f87da23a00f 100644 --- a/FirebaseSegmentation/Tests/Sample/SegmentationSampleApp/Info.plist +++ b/FirebaseSegmentation/Tests/Sample/SegmentationSampleApp/Info.plist @@ -20,6 +20,11 @@ 1 LSRequiresIPhoneOS + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -41,9 +46,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - NSAppTransportSecurity - - NSAllowsArbitraryLoads - diff --git a/scripts/build.sh b/scripts/build.sh index 6a19bb1c8f2..16983c6d23d 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -394,6 +394,14 @@ case "$product-$platform-$method" in fi ;; + SegmentationSample-*-*) + RunXcodebuild \ + -workspace 'FirebaseSegmementation/Tests/Sample/SegmentationSampleApp.xcworkspace' \ + -scheme "SegmentationSampleApp" \ + "${xcb_flags[@]}" \ + build + ;; + Database-*-unit) pod_gen FirebaseDatabase.podspec --platforms="${gen_platform}" RunXcodebuild \ diff --git a/scripts/install_prereqs.sh b/scripts/install_prereqs.sh index 7eb2ffd070c..3f9b97f7a5b 100755 --- a/scripts/install_prereqs.sh +++ b/scripts/install_prereqs.sh @@ -144,6 +144,11 @@ case "$project-$platform-$method" in bundle exec pod install --project-directory=FirebaseRemoteConfig/Tests/Sample --repo-update ;; + SegmentationSample-*) + install_xcpretty + bundle exec pod install --project-directory=FirebaseSegmentation/Tests/Sample --repo-update + ;; + GoogleDataTransport-watchOS-xcodebuild) install_xcpretty bundle exec pod install --project-directory=GoogleDataTransport/GDTWatchOSTestApp/ --repo-update From 09b11e8822c8854ace7d12c0bb084e4d7717f668 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Tue, 10 Nov 2020 16:28:50 -0800 Subject: [PATCH 2/4] Fix --- .github/workflows/segmentation.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/segmentation.yml b/.github/workflows/segmentation.yml index 1c0fde85382..de776af8b52 100644 --- a/.github/workflows/segmentation.yml +++ b/.github/workflows/segmentation.yml @@ -74,6 +74,6 @@ jobs: # Just copy a dummy plist for a build-only test run: cp FirebaseCore/Tests/Unit/Resources/GoogleService-Info.plist FirebaseSegmentation/Tests/Sample/ - name: Prereqs - run: scripts/install_prereqs.sh MessagingSample iOS + run: scripts/install_prereqs.sh SegmentationSample iOS - name: Build - run: scripts/build.sh MessagingSample iOS + run: scripts/build.sh SegmentationSample iOS From 3d3cde1ff20944a221804e2541de0cde8ae6c620 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Tue, 10 Nov 2020 18:16:53 -0800 Subject: [PATCH 3/4] spelling fix --- scripts/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.sh b/scripts/build.sh index 16983c6d23d..68db116d260 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -396,7 +396,7 @@ case "$product-$platform-$method" in SegmentationSample-*-*) RunXcodebuild \ - -workspace 'FirebaseSegmementation/Tests/Sample/SegmentationSampleApp.xcworkspace' \ + -workspace 'FirebaseSegmentation/Tests/Sample/SegmentationSampleApp.xcworkspace' \ -scheme "SegmentationSampleApp" \ "${xcb_flags[@]}" \ build From 534f7de540ef3b92cc953d1a544589485fcd214d Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Tue, 10 Nov 2020 18:20:12 -0800 Subject: [PATCH 4/4] unnecessary change --- .../Tests/Sample/SegmentationSampleApp/Info.plist | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/FirebaseSegmentation/Tests/Sample/SegmentationSampleApp/Info.plist b/FirebaseSegmentation/Tests/Sample/SegmentationSampleApp/Info.plist index f87da23a00f..11970f5aaf1 100644 --- a/FirebaseSegmentation/Tests/Sample/SegmentationSampleApp/Info.plist +++ b/FirebaseSegmentation/Tests/Sample/SegmentationSampleApp/Info.plist @@ -20,11 +20,6 @@ 1 LSRequiresIPhoneOS - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - UILaunchStoryboardName LaunchScreen UIMainStoryboardFile @@ -46,5 +41,9 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + NSAppTransportSecurity + + NSAllowsArbitraryLoads +