From c5c4dddf7510d66572a06d4e9988de4aaa5f519f Mon Sep 17 00:00:00 2001 From: Michael Haney Date: Fri, 1 Feb 2019 14:16:52 -0800 Subject: [PATCH 01/12] Update podspec and factor out common test sources --- GoogleDataLogger.podspec | 19 ++++++++++++------- .../Categories/GDLLogStorage+Testing.h | 0 .../Categories/GDLLogStorage+Testing.m | 0 .../Categories/GDLRegistrar+Testing.h | 0 .../Categories/GDLRegistrar+Testing.m | 0 .../Categories/GDLUploadCoordinator+Testing.h | 0 .../Categories/GDLUploadCoordinator+Testing.m | 0 .../Fakes/GDLLogStorageFake.h | 0 .../Fakes/GDLLogStorageFake.m | 0 .../{Unit => Common}/Fakes/GDLLogWriterFake.h | 0 .../{Unit => Common}/Fakes/GDLLogWriterFake.m | 0 .../Fakes/GDLUploadCoordinatorFake.h | 0 .../Fakes/GDLUploadCoordinatorFake.m | 0 13 files changed, 12 insertions(+), 7 deletions(-) rename GoogleDataLogger/Tests/{Unit => Common}/Categories/GDLLogStorage+Testing.h (100%) rename GoogleDataLogger/Tests/{Unit => Common}/Categories/GDLLogStorage+Testing.m (100%) rename GoogleDataLogger/Tests/{Unit => Common}/Categories/GDLRegistrar+Testing.h (100%) rename GoogleDataLogger/Tests/{Unit => Common}/Categories/GDLRegistrar+Testing.m (100%) rename GoogleDataLogger/Tests/{Unit => Common}/Categories/GDLUploadCoordinator+Testing.h (100%) rename GoogleDataLogger/Tests/{Unit => Common}/Categories/GDLUploadCoordinator+Testing.m (100%) rename GoogleDataLogger/Tests/{Unit => Common}/Fakes/GDLLogStorageFake.h (100%) rename GoogleDataLogger/Tests/{Unit => Common}/Fakes/GDLLogStorageFake.m (100%) rename GoogleDataLogger/Tests/{Unit => Common}/Fakes/GDLLogWriterFake.h (100%) rename GoogleDataLogger/Tests/{Unit => Common}/Fakes/GDLLogWriterFake.m (100%) rename GoogleDataLogger/Tests/{Unit => Common}/Fakes/GDLUploadCoordinatorFake.h (100%) rename GoogleDataLogger/Tests/{Unit => Common}/Fakes/GDLUploadCoordinatorFake.m (100%) diff --git a/GoogleDataLogger.podspec b/GoogleDataLogger.podspec index 7a9f776e9d3..ab2e7b8fe12 100644 --- a/GoogleDataLogger.podspec +++ b/GoogleDataLogger.podspec @@ -18,24 +18,29 @@ Shared library for iOS SDK data logging needs. s.ios.deployment_target = '8.0' - s.cocoapods_version = '>= 1.5.3' + s.cocoapods_version = '>= 1.6.0.rc.2' - # TODO(mikehaney24): Change to static framework after cocoapods 1.6.0 release? - s.static_framework = false + s.static_framework = true s.prefix_header_file = false s.source_files = 'GoogleDataLogger/GoogleDataLogger/**/*' s.public_header_files = 'GoogleDataLogger/GoogleDataLogger/Classes/Public/*.h' + s.private_header_files = 'GoogleDataLogger/GoogleDataLogger/Classes/Private/*.h' s.dependency 'GoogleUtilities/Logger' s.pod_target_xcconfig = { 'GCC_C_LANGUAGE_STANDARD' => 'c99', - 'GCC_TREAT_WARNINGS_AS_ERRORS' => 'YES' + 'GCC_TREAT_WARNINGS_AS_ERRORS' => 'YES', + 'CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY' => 'YES' } - # Test specs - s.test_spec 'UnitTests' do |test_spec| - test_spec.source_files = 'GoogleDataLogger/Tests/Unit/**/*.{h,m}' + common_test_sources = ['GoogleDataLogger/Tests/Common/**/*.{h,m}'] + + # Unit test specs + s.test_spec 'TestsUnit' do |test_spec| + test_spec.requires_app_host = false + test_spec.source_files = ['GoogleDataLogger/Tests/Unit/**/*.{h,m}'] + common_test_sources + end end end diff --git a/GoogleDataLogger/Tests/Unit/Categories/GDLLogStorage+Testing.h b/GoogleDataLogger/Tests/Common/Categories/GDLLogStorage+Testing.h similarity index 100% rename from GoogleDataLogger/Tests/Unit/Categories/GDLLogStorage+Testing.h rename to GoogleDataLogger/Tests/Common/Categories/GDLLogStorage+Testing.h diff --git a/GoogleDataLogger/Tests/Unit/Categories/GDLLogStorage+Testing.m b/GoogleDataLogger/Tests/Common/Categories/GDLLogStorage+Testing.m similarity index 100% rename from GoogleDataLogger/Tests/Unit/Categories/GDLLogStorage+Testing.m rename to GoogleDataLogger/Tests/Common/Categories/GDLLogStorage+Testing.m diff --git a/GoogleDataLogger/Tests/Unit/Categories/GDLRegistrar+Testing.h b/GoogleDataLogger/Tests/Common/Categories/GDLRegistrar+Testing.h similarity index 100% rename from GoogleDataLogger/Tests/Unit/Categories/GDLRegistrar+Testing.h rename to GoogleDataLogger/Tests/Common/Categories/GDLRegistrar+Testing.h diff --git a/GoogleDataLogger/Tests/Unit/Categories/GDLRegistrar+Testing.m b/GoogleDataLogger/Tests/Common/Categories/GDLRegistrar+Testing.m similarity index 100% rename from GoogleDataLogger/Tests/Unit/Categories/GDLRegistrar+Testing.m rename to GoogleDataLogger/Tests/Common/Categories/GDLRegistrar+Testing.m diff --git a/GoogleDataLogger/Tests/Unit/Categories/GDLUploadCoordinator+Testing.h b/GoogleDataLogger/Tests/Common/Categories/GDLUploadCoordinator+Testing.h similarity index 100% rename from GoogleDataLogger/Tests/Unit/Categories/GDLUploadCoordinator+Testing.h rename to GoogleDataLogger/Tests/Common/Categories/GDLUploadCoordinator+Testing.h diff --git a/GoogleDataLogger/Tests/Unit/Categories/GDLUploadCoordinator+Testing.m b/GoogleDataLogger/Tests/Common/Categories/GDLUploadCoordinator+Testing.m similarity index 100% rename from GoogleDataLogger/Tests/Unit/Categories/GDLUploadCoordinator+Testing.m rename to GoogleDataLogger/Tests/Common/Categories/GDLUploadCoordinator+Testing.m diff --git a/GoogleDataLogger/Tests/Unit/Fakes/GDLLogStorageFake.h b/GoogleDataLogger/Tests/Common/Fakes/GDLLogStorageFake.h similarity index 100% rename from GoogleDataLogger/Tests/Unit/Fakes/GDLLogStorageFake.h rename to GoogleDataLogger/Tests/Common/Fakes/GDLLogStorageFake.h diff --git a/GoogleDataLogger/Tests/Unit/Fakes/GDLLogStorageFake.m b/GoogleDataLogger/Tests/Common/Fakes/GDLLogStorageFake.m similarity index 100% rename from GoogleDataLogger/Tests/Unit/Fakes/GDLLogStorageFake.m rename to GoogleDataLogger/Tests/Common/Fakes/GDLLogStorageFake.m diff --git a/GoogleDataLogger/Tests/Unit/Fakes/GDLLogWriterFake.h b/GoogleDataLogger/Tests/Common/Fakes/GDLLogWriterFake.h similarity index 100% rename from GoogleDataLogger/Tests/Unit/Fakes/GDLLogWriterFake.h rename to GoogleDataLogger/Tests/Common/Fakes/GDLLogWriterFake.h diff --git a/GoogleDataLogger/Tests/Unit/Fakes/GDLLogWriterFake.m b/GoogleDataLogger/Tests/Common/Fakes/GDLLogWriterFake.m similarity index 100% rename from GoogleDataLogger/Tests/Unit/Fakes/GDLLogWriterFake.m rename to GoogleDataLogger/Tests/Common/Fakes/GDLLogWriterFake.m diff --git a/GoogleDataLogger/Tests/Unit/Fakes/GDLUploadCoordinatorFake.h b/GoogleDataLogger/Tests/Common/Fakes/GDLUploadCoordinatorFake.h similarity index 100% rename from GoogleDataLogger/Tests/Unit/Fakes/GDLUploadCoordinatorFake.h rename to GoogleDataLogger/Tests/Common/Fakes/GDLUploadCoordinatorFake.h diff --git a/GoogleDataLogger/Tests/Unit/Fakes/GDLUploadCoordinatorFake.m b/GoogleDataLogger/Tests/Common/Fakes/GDLUploadCoordinatorFake.m similarity index 100% rename from GoogleDataLogger/Tests/Unit/Fakes/GDLUploadCoordinatorFake.m rename to GoogleDataLogger/Tests/Common/Fakes/GDLUploadCoordinatorFake.m From 906ddced7c9ba9949f0c9754e88fc1bcc0880a37 Mon Sep 17 00:00:00 2001 From: Michael Haney Date: Fri, 1 Feb 2019 14:23:38 -0800 Subject: [PATCH 02/12] Add a wifi-only QoS specifier --- .../GoogleDataLogger/Classes/Public/GDLLogEvent.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/GoogleDataLogger/GoogleDataLogger/Classes/Public/GDLLogEvent.h b/GoogleDataLogger/GoogleDataLogger/Classes/Public/GDLLogEvent.h index ed6bb166c6f..00815a194da 100644 --- a/GoogleDataLogger/GoogleDataLogger/Classes/Public/GDLLogEvent.h +++ b/GoogleDataLogger/GoogleDataLogger/Classes/Public/GDLLogEvent.h @@ -35,7 +35,10 @@ typedef NS_ENUM(NSInteger, GDLLogQoS) { GDLLogQosDefault = 3, /** This log should be sent immediately along with any other data that can be batched. */ - GDLLogQoSFast = 4 + GDLLogQoSFast = 4, + + /** This log should only be uploaded on wifi. */ + GDLLogQoSWifiOnly = 5, }; @interface GDLLogEvent : NSObject From 120fbd1d8139a1debe5a514a6ce08fbe87e31f14 Mon Sep 17 00:00:00 2001 From: Michael Haney Date: Fri, 1 Feb 2019 14:31:48 -0800 Subject: [PATCH 03/12] Change the prioritizer protocol to include upload conditions --- .../Classes/Public/GDLLogPrioritizer.h | 24 ++++++++++++++++--- .../Tests/Unit/Helpers/GDLTestPrioritizer.m | 5 +++- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/GoogleDataLogger/GoogleDataLogger/Classes/Public/GDLLogPrioritizer.h b/GoogleDataLogger/GoogleDataLogger/Classes/Public/GDLLogPrioritizer.h index cdb2f7fe26e..a490523f766 100644 --- a/GoogleDataLogger/GoogleDataLogger/Classes/Public/GDLLogPrioritizer.h +++ b/GoogleDataLogger/GoogleDataLogger/Classes/Public/GDLLogPrioritizer.h @@ -20,6 +20,18 @@ NS_ASSUME_NONNULL_BEGIN +/** Options that define a set of upload conditions. This is used to help minimize end user data + * consumption impact. + */ +typedef NS_OPTIONS(NSInteger, GDLUploadConditions) { + + /** An upload would likely use mobile data. */ + GDLUploadConditionMobileData, + + /** An upload would likely use wifi data. */ + GDLUploadConditionWifiData, +}; + /** This protocol defines the common interface of a log prioritization. Log prioritizers are * stateful objects that prioritize logs upon insertion into storage and remain prepared to return a * set of log filenames to the storage system. @@ -40,11 +52,17 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)prioritizeLog:(GDLLogEvent *)logEvent; -/** Returns a set of logs based on the logic of the prioritizer. +/** Unprioritizes a log. This method is called when a log has been removed from storage and should + * no longer be given as a log to upload. + */ +- (void)unprioritizeLog:(NSNumber *)logHash; + +/** Returns a set of logs to upload given a set of conditions. * - * @return A set of log hashes to upload, presumably based on the logs' priority. + * @param conditions A bit mask specifying the current upload conditions. + * @return A set of logs to upload with respect to the current conditions. */ -- (NSSet *)logsForNextUpload; +- (NSSet *)logsToUploadGivenConditions:(GDLUploadConditions)conditions; @end diff --git a/GoogleDataLogger/Tests/Unit/Helpers/GDLTestPrioritizer.m b/GoogleDataLogger/Tests/Unit/Helpers/GDLTestPrioritizer.m index d0a0f75a79b..c6df2d8b5dd 100644 --- a/GoogleDataLogger/Tests/Unit/Helpers/GDLTestPrioritizer.m +++ b/GoogleDataLogger/Tests/Unit/Helpers/GDLTestPrioritizer.m @@ -26,7 +26,7 @@ - (instancetype)init { return self; } -- (NSSet *)logsForNextUpload { +- (NSSet *)logsToUploadGivenConditions:(GDLUploadConditions)conditions { if (_logsForNextUploadBlock) { _logsForNextUploadBlock(); } @@ -39,4 +39,7 @@ - (void)prioritizeLog:(GDLLogEvent *)logEvent { } } +- (void)unprioritizeLog:(nonnull NSNumber *)logHash { +} + @end From 8c9b6dd02e46879027eadb6db1b21c66cc5b83cf Mon Sep 17 00:00:00 2001 From: Michael Haney Date: Fri, 1 Feb 2019 14:32:01 -0800 Subject: [PATCH 04/12] Remove an unused log target. --- .../GoogleDataLogger/Classes/Public/GDLLogTargets.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/GoogleDataLogger/GoogleDataLogger/Classes/Public/GDLLogTargets.h b/GoogleDataLogger/GoogleDataLogger/Classes/Public/GDLLogTargets.h index c373e5252be..fb235cccfb5 100644 --- a/GoogleDataLogger/GoogleDataLogger/Classes/Public/GDLLogTargets.h +++ b/GoogleDataLogger/GoogleDataLogger/Classes/Public/GDLLogTargets.h @@ -23,6 +23,4 @@ typedef NS_ENUM(NSInteger, GDLLogTarget) { /** The CCT log target. */ kGDLLogTargetCCT = 1000, - - GDLLogTargetLast = 1001 }; From d2e6f913e35366dc2be553bc029a1a73d5d28c7c Mon Sep 17 00:00:00 2001 From: Michael Haney Date: Fri, 1 Feb 2019 15:52:47 -0800 Subject: [PATCH 05/12] Call unprioritizeLog and remove an assert that wasn't helpful --- .../GoogleDataLogger/Classes/GDLLogStorage.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/GoogleDataLogger/GoogleDataLogger/Classes/GDLLogStorage.m b/GoogleDataLogger/GoogleDataLogger/Classes/GDLLogStorage.m index 10864651e72..ae243e1651f 100644 --- a/GoogleDataLogger/GoogleDataLogger/Classes/GDLLogStorage.m +++ b/GoogleDataLogger/GoogleDataLogger/Classes/GDLLogStorage.m @@ -77,11 +77,10 @@ - (void)storeLog:(GDLLogEvent *)log { // Check that a log prioritizer is available for this logTarget. id logPrioritizer = [GDLRegistrar sharedInstance].logTargetToPrioritizer[@(logTarget)]; - GDLAssert(logPrioritizer, @"There's no scorer registered for the given logTarget."); + GDLAssert(logPrioritizer, @"There's no prioritizer registered for the given logTarget."); // Write the extension bytes to disk, get a filename. GDLAssert(shortLivedLog.extensionBytes, @"The log should have been serialized to bytes"); - GDLAssert(shortLivedLog.extension == nil, @"The original log proto should be removed"); NSURL *logFile = [self saveLogProtoToDisk:shortLivedLog.extensionBytes logHash:shortLivedLog.hash]; @@ -121,6 +120,12 @@ - (void)removeLog:(NSNumber *)logHash logTarget:(NSNumber *)logTarget { GDLAssert(logHashes, @"There wasn't a logSet for this logTarget."); [logHashes removeObject:logHash]; // It's fine to not remove the set if it's empty. + + // Check that a log prioritizer is available for this logTarget. + id logPrioritizer = + [GDLRegistrar sharedInstance].logTargetToPrioritizer[logTarget]; + GDLAssert(logPrioritizer, @"There's no prioritizer registered for the given logTarget."); + [logPrioritizer unprioritizeLog:logHash]; }); } From 2d6769a5543716de0e85fca5b857cac2a21e8943 Mon Sep 17 00:00:00 2001 From: Michael Haney Date: Fri, 1 Feb 2019 15:53:23 -0800 Subject: [PATCH 06/12] Put the upload completionBlock on the uploader queue --- .../Classes/GDLUploadCoordinator.m | 54 ++++++++++++------- 1 file changed, 36 insertions(+), 18 deletions(-) diff --git a/GoogleDataLogger/GoogleDataLogger/Classes/GDLUploadCoordinator.m b/GoogleDataLogger/GoogleDataLogger/Classes/GDLUploadCoordinator.m index 3a5f4818927..2ec735d09bd 100644 --- a/GoogleDataLogger/GoogleDataLogger/Classes/GDLUploadCoordinator.m +++ b/GoogleDataLogger/GoogleDataLogger/Classes/GDLUploadCoordinator.m @@ -92,25 +92,27 @@ - (GDLUploaderCompletionBlock)onCompleteBlock { onCompleteBlock = ^(GDLLogTarget target, GDLClock *nextUploadAttemptUTC, NSError *error) { GDLUploadCoordinator *strongSelf = weakSelf; if (strongSelf) { - NSNumber *logTarget = @(target); - if (error) { - GDLLogWarning(GDLMCWUploadFailed, @"Error during upload: %@", error); + dispatch_async(strongSelf.coordinationQueue, ^{ + NSNumber *logTarget = @(target); + if (error) { + GDLLogWarning(GDLMCWUploadFailed, @"Error during upload: %@", error); + [strongSelf->_logTargetToInFlightLogSet removeObjectForKey:logTarget]; + return; + } + strongSelf->_logTargetToNextUploadTimes[logTarget] = nextUploadAttemptUTC; + NSSet *logHashSet = + [strongSelf->_logTargetToInFlightLogSet objectForKey:logTarget]; + [strongSelf.logStorage removeLogs:logHashSet logTarget:logTarget]; [strongSelf->_logTargetToInFlightLogSet removeObjectForKey:logTarget]; - return; - } - strongSelf->_logTargetToNextUploadTimes[logTarget] = nextUploadAttemptUTC; - NSSet *logHashSet = - [strongSelf->_logTargetToInFlightLogSet objectForKey:logTarget]; - [strongSelf.logStorage removeLogs:logHashSet logTarget:logTarget]; - [strongSelf->_logTargetToInFlightLogSet removeObjectForKey:logTarget]; - if (strongSelf->_forcedUploadQueue.count) { - GDLUploadCoordinatorForceUploadBlock queuedBlock = - [strongSelf->_forcedUploadQueue lastObject]; - if (queuedBlock) { - queuedBlock(); + if (strongSelf->_forcedUploadQueue.count) { + GDLUploadCoordinatorForceUploadBlock queuedBlock = + [strongSelf->_forcedUploadQueue lastObject]; + if (queuedBlock) { + queuedBlock(); + } + [strongSelf->_forcedUploadQueue removeLastObject]; } - [strongSelf->_forcedUploadQueue removeLastObject]; - } + }); } }; }); @@ -144,6 +146,8 @@ - (void)startTimer { - (void)checkPrioritizersAndUploadLogs { __weak GDLUploadCoordinator *weakSelf = self; dispatch_async(_coordinationQueue, ^{ + static int count = 0; + count++; GDLUploadCoordinator *strongSelf = weakSelf; if (strongSelf) { NSArray *logTargetsReadyForUpload = [self logTargetsReadyForUpload]; @@ -153,10 +157,14 @@ - (void)checkPrioritizersAndUploadLogs { id uploader = strongSelf->_registrar.logTargetToUploader[logTarget]; GDLAssert(prioritizer && uploader, @"log target '%@' is missing an implementation", logTarget); - NSSet *logHashesToUpload = [prioritizer logsForNextUpload]; + GDLUploadConditions conds = [self uploadConditions]; + NSSet *logHashesToUpload = [prioritizer logsToUploadGivenConditions:conds]; if (logHashesToUpload && logHashesToUpload.count > 0) { + NSAssert(logHashesToUpload.count > 0, @""); NSSet *logFilesToUpload = [strongSelf.logStorage logHashesToFiles:logHashesToUpload]; + NSAssert(logFilesToUpload.count == logHashesToUpload.count, + @"There should be the same number of files to logs"); [uploader uploadLogs:logFilesToUpload onComplete:self.onCompleteBlock]; strongSelf->_logTargetToInFlightLogSet[logTarget] = logHashesToUpload; } @@ -165,6 +173,12 @@ - (void)checkPrioritizersAndUploadLogs { }); } +/** */ +- (GDLUploadConditions)uploadConditions { + // TODO: Compute the real upload conditions. + return GDLUploadConditionMobileData; +} + /** Checks the next upload time for each log target and returns an array of log targets that are * able to make an upload attempt. * @@ -174,6 +188,10 @@ - (void)checkPrioritizersAndUploadLogs { NSMutableArray *logTargetsReadyForUpload = [[NSMutableArray alloc] init]; GDLClock *currentTime = [GDLClock snapshot]; for (NSNumber *logTarget in self.registrar.logTargetToPrioritizer) { + // Log targets in flight are not ready. + if (_logTargetToInFlightLogSet[logTarget]) { + continue; + } GDLClock *nextUploadTime = _logTargetToNextUploadTimes[logTarget]; // If no next upload time was specified or if the currentTime > nextUpload time, mark as ready. From 94dc96de8725521b8a5aa28fd9a09986b9f9f1e6 Mon Sep 17 00:00:00 2001 From: Michael Haney Date: Fri, 1 Feb 2019 16:00:51 -0800 Subject: [PATCH 07/12] Fix the CI and podspec. --- GoogleDataLogger.podspec | 1 - scripts/build.sh | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/GoogleDataLogger.podspec b/GoogleDataLogger.podspec index ab2e7b8fe12..b69fae650d3 100644 --- a/GoogleDataLogger.podspec +++ b/GoogleDataLogger.podspec @@ -42,5 +42,4 @@ Shared library for iOS SDK data logging needs. test_spec.requires_app_host = false test_spec.source_files = ['GoogleDataLogger/Tests/Unit/**/*.{h,m}'] + common_test_sources end - end end diff --git a/scripts/build.sh b/scripts/build.sh index e6942221ac3..777285ab7c6 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -329,7 +329,10 @@ case "$product-$method-$platform" in GoogleDataLogger-xcodebuild-iOS) RunXcodebuild \ -workspace 'GoogleDataLogger/gen/GoogleDataLogger/GoogleDataLogger.xcworkspace' \ - -scheme "GoogleDataLogger-Unit-Tests" \ + -scheme "GoogleDataLogger-Unit-TestsUnit" \ + "${xcb_flags[@]}" \ + build \ + test "${xcb_flags[@]}" \ build \ test From dccfef2991cb668c8e1c83f84c0ee83f94ba488e Mon Sep 17 00:00:00 2001 From: Michael Haney Date: Fri, 1 Feb 2019 19:00:18 -0800 Subject: [PATCH 08/12] [DO NOT MERGE TO MASTER] Raise the cocoapods version to 1.6.0.rc.2 --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 2b2cda9cb9e..02bda3d83b8 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ # use 'bundle update' to update to latest gems source 'https://rubygems.org' -gem 'cocoapods', :git => 'https://github.com/CocoaPods/CocoaPods.git' +gem 'cocoapods', :git => 'https://github.com/CocoaPods/CocoaPods.git', '>= 1.6.0.rc.2' gem 'cocoapods-core', :git => 'https://github.com/CocoaPods/Core.git' gem 'cocoapods-generate', :git => 'https://github.com/square/cocoapods-generate' gem 'xcodeproj', :git => 'https://github.com/CocoaPods/Xcodeproj.git' From 0bb53de4eeab5c2bf46d4648718fa412459af9d6 Mon Sep 17 00:00:00 2001 From: Michael Haney Date: Fri, 1 Feb 2019 23:03:13 -0800 Subject: [PATCH 09/12] [DO NOT MERGE TO MASTER] Update Gemfile correctly --- Gemfile | 4 ++-- Gemfile.lock | 54 ++++++++++++++++++++++++++-------------------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Gemfile b/Gemfile index 02bda3d83b8..b0e16666d6c 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ # use 'bundle update' to update to latest gems source 'https://rubygems.org' -gem 'cocoapods', :git => 'https://github.com/CocoaPods/CocoaPods.git', '>= 1.6.0.rc.2' -gem 'cocoapods-core', :git => 'https://github.com/CocoaPods/Core.git' +gem 'cocoapods', '1.6.0.rc.2', :git => 'https://github.com/CocoaPods/CocoaPods.git' +gem 'cocoapods-core', '1.6.0.rc.2', :git => 'https://github.com/CocoaPods/Core.git' gem 'cocoapods-generate', :git => 'https://github.com/square/cocoapods-generate' gem 'xcodeproj', :git => 'https://github.com/CocoaPods/Xcodeproj.git' diff --git a/Gemfile.lock b/Gemfile.lock index ae82215b945..8bf02132fac 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,46 +1,46 @@ GIT remote: https://github.com/CocoaPods/CocoaPods.git - revision: 10b69dbd9b991442646944f118f569d855652b26 + revision: daaac4758f8aab608b0f7f4b8fccc29e52e91f4b specs: - cocoapods (1.5.3) + cocoapods (1.6.0.rc.2) activesupport (>= 4.0.2, < 5) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.5.3) + cocoapods-core (= 1.6.0.rc.2) cocoapods-deintegrate (>= 1.0.2, < 2.0) - cocoapods-downloader (>= 1.2.1, < 2.0) + cocoapods-downloader (>= 1.2.2, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) cocoapods-stats (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.3.0, < 2.0) + cocoapods-trunk (>= 1.3.1, < 2.0) cocoapods-try (>= 1.1.0, < 2.0) colored2 (~> 3.1) escape (~> 0.0.4) - fourflusher (~> 2.0.1) + fourflusher (>= 2.2.0, < 3.0) gh_inspector (~> 1.0) - molinillo (~> 0.6.5) + molinillo (~> 0.6.6) nap (~> 1.0) - ruby-macho (~> 1.2) - xcodeproj (>= 1.5.8, < 2.0) + ruby-macho (~> 1.3, >= 1.3.1) + xcodeproj (>= 1.8.0, < 2.0) GIT remote: https://github.com/CocoaPods/Core.git - revision: 577c69f38fdb56cbdb883b44681ca2b224cad746 + revision: 99d4dc30ac43bfbfa374b3e59d2e592970be5f9a specs: - cocoapods-core (1.5.3) + cocoapods-core (1.6.0.rc.2) activesupport (>= 4.0.2, < 6) fuzzy_match (~> 2.0.4) nap (~> 1.0) GIT remote: https://github.com/CocoaPods/Xcodeproj.git - revision: cadb238767d09942a1c5eba90a3112034438ba23 + revision: 2bc4222ff4664386363cda25c56d2b54c20d565e specs: - xcodeproj (1.5.9) + xcodeproj (1.8.0) CFPropertyList (>= 2.3.3, < 4.0) - atomos (~> 0.1.2) + atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) - nanaimo (~> 0.2.5) + nanaimo (~> 0.2.6) GIT remote: https://github.com/square/cocoapods-generate @@ -52,37 +52,37 @@ GEM remote: https://rubygems.org/ specs: CFPropertyList (3.0.0) - activesupport (4.2.10) + activesupport (4.2.11) i18n (~> 0.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) - atomos (0.1.2) + atomos (0.1.3) claide (1.0.2) cocoapods-deintegrate (1.0.2) - cocoapods-downloader (1.2.1) + cocoapods-downloader (1.2.2) cocoapods-plugins (1.0.0) nap cocoapods-search (1.0.0) - cocoapods-stats (1.0.0) - cocoapods-trunk (1.3.0) + cocoapods-stats (1.1.0) + cocoapods-trunk (1.3.1) nap (>= 0.8, < 2.0) netrc (~> 0.11) cocoapods-try (1.1.0) colored2 (3.1.2) - concurrent-ruby (1.0.5) + concurrent-ruby (1.1.4) escape (0.0.4) - fourflusher (2.0.1) + fourflusher (2.2.0) fuzzy_match (2.0.4) gh_inspector (1.1.3) i18n (0.9.5) concurrent-ruby (~> 1.0) minitest (5.11.3) - molinillo (0.6.5) - nanaimo (0.2.5) + molinillo (0.6.6) + nanaimo (0.2.6) nap (1.1.0) netrc (0.11.0) - ruby-macho (1.2.0) + ruby-macho (1.3.1) thread_safe (0.3.6) tzinfo (1.2.5) thread_safe (~> 0.1) @@ -91,8 +91,8 @@ PLATFORMS ruby DEPENDENCIES - cocoapods! - cocoapods-core! + cocoapods (= 1.6.0.rc.2)! + cocoapods-core (= 1.6.0.rc.2)! cocoapods-generate! xcodeproj! From 234f79c5112cf4e7418ac01c12c7a61ee2a7f291 Mon Sep 17 00:00:00 2001 From: Michael Haney Date: Sun, 3 Feb 2019 12:11:47 -0800 Subject: [PATCH 10/12] [DO NOT MERGE TO MASTER] Use the tag, not the version number. --- Gemfile | 4 ++-- Gemfile.lock | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index b0e16666d6c..7a1a6ab1d9f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ # use 'bundle update' to update to latest gems source 'https://rubygems.org' -gem 'cocoapods', '1.6.0.rc.2', :git => 'https://github.com/CocoaPods/CocoaPods.git' -gem 'cocoapods-core', '1.6.0.rc.2', :git => 'https://github.com/CocoaPods/Core.git' +gem 'cocoapods', :git => 'https://github.com/CocoaPods/CocoaPods.git', :tag => '1.6.0.rc.2' +gem 'cocoapods-core', :git => 'https://github.com/CocoaPods/Core.git', :tag => '1.6.0.rc.2' gem 'cocoapods-generate', :git => 'https://github.com/square/cocoapods-generate' gem 'xcodeproj', :git => 'https://github.com/CocoaPods/Xcodeproj.git' diff --git a/Gemfile.lock b/Gemfile.lock index 8bf02132fac..c8ececda1e6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,7 @@ GIT remote: https://github.com/CocoaPods/CocoaPods.git - revision: daaac4758f8aab608b0f7f4b8fccc29e52e91f4b + revision: 783424de392ebb327f7dc25d685b8df9605e76be + tag: 1.6.0.rc.2 specs: cocoapods (1.6.0.rc.2) activesupport (>= 4.0.2, < 5) @@ -24,7 +25,8 @@ GIT GIT remote: https://github.com/CocoaPods/Core.git - revision: 99d4dc30ac43bfbfa374b3e59d2e592970be5f9a + revision: 2e99d7e1ce9c36bc82c822624e34c150b48342f5 + tag: 1.6.0.rc.2 specs: cocoapods-core (1.6.0.rc.2) activesupport (>= 4.0.2, < 6) @@ -91,8 +93,8 @@ PLATFORMS ruby DEPENDENCIES - cocoapods (= 1.6.0.rc.2)! - cocoapods-core (= 1.6.0.rc.2)! + cocoapods! + cocoapods-core! cocoapods-generate! xcodeproj! From 50dbacaf58dc52c2ffb8c05ba4e7ff42b19dca93 Mon Sep 17 00:00:00 2001 From: Michael Haney Date: Sun, 3 Feb 2019 12:48:48 -0800 Subject: [PATCH 11/12] Correct an incorrect commit --- scripts/build.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 777285ab7c6..e6942221ac3 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -329,10 +329,7 @@ case "$product-$method-$platform" in GoogleDataLogger-xcodebuild-iOS) RunXcodebuild \ -workspace 'GoogleDataLogger/gen/GoogleDataLogger/GoogleDataLogger.xcworkspace' \ - -scheme "GoogleDataLogger-Unit-TestsUnit" \ - "${xcb_flags[@]}" \ - build \ - test + -scheme "GoogleDataLogger-Unit-Tests" \ "${xcb_flags[@]}" \ build \ test From f4b3d36f6ebb2659da0860ecab7b47a7a54304de Mon Sep 17 00:00:00 2001 From: Michael Haney Date: Sun, 3 Feb 2019 12:59:23 -0800 Subject: [PATCH 12/12] Remove the name for standard unit tests --- GoogleDataLogger.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GoogleDataLogger.podspec b/GoogleDataLogger.podspec index b69fae650d3..5b1c8267a50 100644 --- a/GoogleDataLogger.podspec +++ b/GoogleDataLogger.podspec @@ -38,7 +38,7 @@ Shared library for iOS SDK data logging needs. common_test_sources = ['GoogleDataLogger/Tests/Common/**/*.{h,m}'] # Unit test specs - s.test_spec 'TestsUnit' do |test_spec| + s.test_spec do |test_spec| test_spec.requires_app_host = false test_spec.source_files = ['GoogleDataLogger/Tests/Unit/**/*.{h,m}'] + common_test_sources end