Skip to content

Commit cd67dae

Browse files
authored
Enable travis for GoogleDataLogger using cocoapods-generate (#2185)
* Add logTarget as a property to GDLLogEvent and connect the logger to the writer. * Enabled building and testing GoogleDataLogger in travis using cocoapods-generate * Update Gemfile.lock * Revert "Add logTarget as a property to GDLLogEvent and connect the logger to the writer." This reverts commit cce26d3. * Fix the workspace path. * Add xcpretty gem * Add the test directive to the GoogleDataLogger invocation * Refactor GoogleDataLogger into its own section Also remove GoogleDataLogger from Xcode9.4 pod lib linting, because the failure was not reproducible.
1 parent caf84ed commit cd67dae

File tree

6 files changed

+36
-3
lines changed

6 files changed

+36
-3
lines changed

.travis.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ jobs:
6060
before_install:
6161
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
6262
script:
63-
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh GoogleDataLogger.podspec
6463
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh GoogleUtilities.podspec
6564
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseCore.podspec
6665
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseAnalyticsInterop.podspec
@@ -114,6 +113,16 @@ jobs:
114113
# The travis_wait is necessary because the command takes more than 10 minutes.
115114
- travis_wait ./scripts/if_cron.sh ./scripts/pod_lib_lint.sh FirebaseFirestore.podspec --use-libraries --allow-warnings --no-subspecs
116115

116+
# GoogleDataLogger unit tests and pod linting using the default Xcode version.
117+
- stage: test
118+
env:
119+
- PROJECT=GoogleDataLogger PLATFORM=iOS METHOD=xcodebuild
120+
before_install:
121+
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
122+
script:
123+
- ./scripts/if_changed.sh ./scripts/build.sh $PROJECT $PLATFORM
124+
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh GoogleDataLogger.podspec
125+
117126
# Daily test for symbol collisions between Firebase and CocoaPods.
118127
- stage: test
119128
env:
@@ -180,7 +189,6 @@ jobs:
180189
before_install:
181190
- ./scripts/if_changed.sh ./scripts/install_prereqs.sh
182191
script:
183-
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh GoogleDataLogger.podspec
184192
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh GoogleUtilities.podspec
185193
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseCore.podspec
186194
- ./scripts/if_changed.sh ./scripts/pod_lib_lint.sh FirebaseAnalyticsInterop.podspec

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ source 'https://rubygems.org'
33

44
gem 'cocoapods', :git => 'https://github.com/CocoaPods/CocoaPods.git'
55
gem 'cocoapods-core', :git => 'https://github.com/CocoaPods/Core.git'
6+
gem 'cocoapods-generate', :git => 'https://github.com/square/cocoapods-generate'
67
gem 'xcodeproj', :git => 'https://github.com/CocoaPods/Xcodeproj.git'

Gemfile.lock

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ GIT
4242
colored2 (~> 3.1)
4343
nanaimo (~> 0.2.5)
4444

45+
GIT
46+
remote: https://github.com/square/cocoapods-generate
47+
revision: 46c337129ad97e52049f673e801fe56361660aa9
48+
specs:
49+
cocoapods-generate (1.3.1)
50+
4551
GEM
4652
remote: https://rubygems.org/
4753
specs:
@@ -87,7 +93,8 @@ PLATFORMS
8793
DEPENDENCIES
8894
cocoapods!
8995
cocoapods-core!
96+
cocoapods-generate!
9097
xcodeproj!
9198

9299
BUNDLED WITH
93-
1.16.1
100+
1.17.2

scripts/build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,15 @@ case "$product-$method-$platform" in
326326
build
327327
;;
328328

329+
GoogleDataLogger-xcodebuild-iOS)
330+
RunXcodebuild \
331+
-workspace 'GoogleDataLogger/gen/GoogleDataLogger/GoogleDataLogger.xcworkspace' \
332+
-scheme "GoogleDataLogger-Unit-Tests" \
333+
"${xcb_flags[@]}" \
334+
build \
335+
test
336+
;;
337+
329338
*)
330339
echo "Don't know how to build this product-platform-method combination" 1>&2
331340
echo " product=$product" 1>&2

scripts/if_changed.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ else
6666
check_changes '^(Firestore/(core|third_party)|cmake)'
6767
;;
6868

69+
GoogleDataLogger-*)
70+
check_changes '^(GoogleDataLogger|GoogleDataLogger.podspec)'
71+
;;
72+
6973
*)
7074
echo "Unknown project-method combo" 1>&2
7175
echo " PROJECT=$PROJECT" 1>&2

scripts/install_prereqs.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ case "$PROJECT-$PLATFORM-$METHOD" in
7272
bundle exec pod install --project-directory=SymbolCollisionTest --repo-update
7373
;;
7474

75+
GoogleDataLogger-iOS-xcodebuild)
76+
gem install xcpretty
77+
bundle exec pod gen GoogleDataLogger.podspec --gen-directory=GoogleDataLogger/gen
78+
;;
7579
*)
7680
echo "Unknown project-platform-method combo" 1>&2
7781
echo " PROJECT=$PROJECT" 1>&2

0 commit comments

Comments
 (0)