Skip to content

Commit

Permalink
Merge pull request #195 from wordpress-mobile/release/1.7.3
Browse files Browse the repository at this point in the history
Merge Release/1.7.3 to master
  • Loading branch information
jtreanor authored Apr 8, 2019
2 parents e5e4bff + 03f2e3e commit 713ae66
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 38 deletions.
7 changes: 5 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@ version: 2.1

orbs:
# This uses the iOS Orb located at https://github.com/wordpress-mobile/circleci-orbs
ios: wordpress-mobile/[email protected].13
ios: wordpress-mobile/[email protected].24

workflows:
test_and_validate:
jobs:
- ios/test:
name: Test
xcode-version: "10.1.0"
workspace: WordPressShared.xcworkspace
scheme: WordPressShared
destination: "platform=iOS Simulator,name=iPhone XS,OS=latest"
device: iPhone XS
ios-version: "12.1"
- ios/validate-podspec:
name: Validate Podspec
xcode-version: "10.1.0"
podspec-path: WordPressShared.podspec
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source 'https://rubygems.org' do
gem 'cocoapods', '1.5.3'
gem 'cocoapods', '1.6.1'
gem 'xcpretty'
end
32 changes: 16 additions & 16 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,37 @@ GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.0)
activesupport (4.2.11)
activesupport (4.2.11.1)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
atomos (0.1.3)
claide (1.0.2)
cocoapods (1.5.3)
cocoapods (1.6.1)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.5.3)
cocoapods-core (= 1.6.1)
cocoapods-deintegrate (>= 1.0.2, < 2.0)
cocoapods-downloader (>= 1.2.0, < 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.1)
xcodeproj (>= 1.5.7, < 2.0)
cocoapods-core (1.5.3)
ruby-macho (~> 1.4)
xcodeproj (>= 1.8.1, < 2.0)
cocoapods-core (1.6.1)
activesupport (>= 4.0.2, < 6)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
cocoapods-deintegrate (1.0.2)
cocoapods-deintegrate (1.0.4)
cocoapods-downloader (1.2.2)
cocoapods-plugins (1.0.0)
nap
Expand All @@ -43,9 +43,9 @@ GEM
netrc (~> 0.11)
cocoapods-try (1.1.0)
colored2 (3.1.2)
concurrent-ruby (1.1.4)
concurrent-ruby (1.1.5)
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)
Expand All @@ -56,11 +56,11 @@ GEM
nap (1.1.0)
netrc (0.11.0)
rouge (2.0.7)
ruby-macho (1.3.1)
ruby-macho (1.4.0)
thread_safe (0.3.6)
tzinfo (1.2.5)
thread_safe (~> 0.1)
xcodeproj (1.8.0)
xcodeproj (1.8.2)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
Expand All @@ -73,7 +73,7 @@ PLATFORMS
ruby

DEPENDENCIES
cocoapods (= 1.5.3)!
cocoapods (= 1.6.1)!
xcpretty!

BUNDLED WITH
Expand Down
26 changes: 16 additions & 10 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,25 @@ use_frameworks!

platform :ios, '10.0'

def wordpress_shared_pods
pod 'CocoaLumberjack', '~> 3.4'
pod 'FormatterKit/TimeIntervalFormatter', '1.8.2'
end

target 'WordPressShared' do
project 'WordPressShared.xcodeproj'

pod 'CocoaLumberjack', '~> 3.4'
pod 'FormatterKit/TimeIntervalFormatter', '1.8.2'
wordpress_shared_pods
end

target 'WordPressSharedTests' do
project 'WordPressShared.xcodeproj'

target 'WordPressSharedTests' do
inherit! :search_paths
wordpress_shared_pods

pod 'OHHTTPStubs', '6.1.0'
pod 'OHHTTPStubs/Swift', '6.1.0'
pod 'OCMock', '~> 3.4'
pod 'Specta', '1.0.7'
pod 'Expecta', '1.0.6'
end
pod 'OHHTTPStubs', '6.1.0'
pod 'OHHTTPStubs/Swift', '6.1.0'
pod 'OCMock', '~> 3.4'
pod 'Specta', '1.0.7'
pod 'Expecta', '1.0.6'
end
4 changes: 2 additions & 2 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ SPEC CHECKSUMS:
OHHTTPStubs: 1e21c7d2c084b8153fc53d48400d8919d2d432d0
Specta: 3e1bd89c3517421982dc4d1c992503e48bd5fe66

PODFILE CHECKSUM: eb829a687e5e6f6e8da92abc9dbeb35b90e32550
PODFILE CHECKSUM: b36a5bbbbea55b426f8ec1497b35819126dfa30e

COCOAPODS: 1.5.3
COCOAPODS: 1.6.1
2 changes: 1 addition & 1 deletion WordPressShared.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "WordPressShared"
s.version = "1.7.2"
s.version = "1.7.3"
s.summary = "Shared components used in building the WordPress iOS apps and other library components."

s.description = <<-DESC
Expand Down
16 changes: 10 additions & 6 deletions WordPressShared.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
93AB05FF1EE840A100EF8764 /* Languages.json in Resources */ = {isa = PBXBuildFile; fileRef = 93AB05FE1EE840A100EF8764 /* Languages.json */; };
93C674F51EE83D4B00BFAF05 /* Languages.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93C674F41EE83D4B00BFAF05 /* Languages.swift */; };
93C882AD1EEB1E2F00227A59 /* NSDate+Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93C882AC1EEB1E2F00227A59 /* NSDate+Helpers.swift */; };
9A1329DF22170BE2009EE02A /* NSDateHelperTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A1329DE22170BE2009EE02A /* NSDateHelperTest.swift */; };
B5393FD8206D608F007BF9D4 /* EmailFormatValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5393FD6206D608E007BF9D4 /* EmailFormatValidator.swift */; };
B5393FD9206D608F007BF9D4 /* EmailTypoChecker.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5393FD7206D608F007BF9D4 /* EmailTypoChecker.swift */; };
B5393FDC206D6169007BF9D4 /* EmailFormatValidatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5393FDA206D6169007BF9D4 /* EmailFormatValidatorTests.swift */; };
Expand Down Expand Up @@ -156,6 +157,7 @@
93AB05FE1EE840A100EF8764 /* Languages.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = Languages.json; sourceTree = "<group>"; };
93C674F41EE83D4B00BFAF05 /* Languages.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Languages.swift; sourceTree = "<group>"; };
93C882AC1EEB1E2F00227A59 /* NSDate+Helpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSDate+Helpers.swift"; sourceTree = "<group>"; };
9A1329DE22170BE2009EE02A /* NSDateHelperTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSDateHelperTest.swift; sourceTree = "<group>"; };
AE15A6EE80D7766A21B83BF5 /* Pods_WordPressShared.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_WordPressShared.framework; sourceTree = BUILT_PRODUCTS_DIR; };
B5393FD6206D608E007BF9D4 /* EmailFormatValidator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EmailFormatValidator.swift; sourceTree = "<group>"; };
B5393FD7206D608F007BF9D4 /* EmailTypoChecker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EmailTypoChecker.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -304,6 +306,7 @@
isa = PBXGroup;
children = (
7414BD511F13CB90005759F8 /* DictionaryHelpersTests.swift */,
9A1329DE22170BE2009EE02A /* NSDateHelperTest.swift */,
740B23CE1F17F28E00067A2A /* DisplayableImageHelperTest.m */,
B5393FDA206D6169007BF9D4 /* EmailFormatValidatorTests.swift */,
B5393FDB206D6169007BF9D4 /* EmailTypoCheckerTests.swift */,
Expand Down Expand Up @@ -592,26 +595,26 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-WordPressSharedTests/Pods-WordPressSharedTests-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-WordPressSharedTests/Pods-WordPressSharedTests-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/CocoaLumberjack/CocoaLumberjack.framework",
"${BUILT_PRODUCTS_DIR}/FormatterKit/FormatterKit.framework",
"${BUILT_PRODUCTS_DIR}/Expecta/Expecta.framework",
"${BUILT_PRODUCTS_DIR}/OCMock/OCMock.framework",
"${BUILT_PRODUCTS_DIR}/OHHTTPStubs/OHHTTPStubs.framework",
"${BUILT_PRODUCTS_DIR}/Specta/Specta.framework",
"${BUILT_PRODUCTS_DIR}/CocoaLumberjack/CocoaLumberjack.framework",
"${BUILT_PRODUCTS_DIR}/FormatterKit/FormatterKit.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CocoaLumberjack.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FormatterKit.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Expecta.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OCMock.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OHHTTPStubs.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Specta.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CocoaLumberjack.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FormatterKit.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-WordPressSharedTests/Pods-WordPressSharedTests-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-WordPressSharedTests/Pods-WordPressSharedTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -673,6 +676,7 @@
7430C9DD1F1934190051B8E6 /* RichContentFormatterTests.swift in Sources */,
B5393FDC206D6169007BF9D4 /* EmailFormatValidatorTests.swift in Sources */,
748710AC1F06C465008095AB /* StringHelperTests.swift in Sources */,
9A1329DF22170BE2009EE02A /* NSDateHelperTest.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
1 change: 1 addition & 0 deletions WordPressShared/Core/Analytics/WPAnalytics.h
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ typedef NS_ENUM(NSUInteger, WPAnalyticsStat) {
WPAnalyticsStatSkippedConnectingToJetpack,
WPAnalyticsStatStatsAccessed,
WPAnalyticsStatStatsInsightsAccessed,
WPAnalyticsStatStatsOverviewBarChartTapped,
WPAnalyticsStatStatsPeriodDaysAccessed,
WPAnalyticsStatStatsPeriodWeeksAccessed,
WPAnalyticsStatStatsPeriodMonthsAccessed,
Expand Down
13 changes: 13 additions & 0 deletions WordPressShared/Core/Utility/NSDate+Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,13 @@ extension Date {
return DateFormatters.pageSectionFormatter.string(forTimeInterval: interval)
}
}

/// Returns the date components object.
///
public func dateAndTimeComponents() -> DateComponents {
return Calendar.current.dateComponents([.year, .month, .day, .hour, .minute, .second],
from: self)
}
}

extension NSDate {
Expand Down Expand Up @@ -234,4 +241,10 @@ extension NSDate {
@objc public func toStringForPageSections() -> String {
return (self as Date).toStringForPageSections()
}

/// Returns the date components object.
///
@objc public func dateAndTimeComponents() -> NSDateComponents {
return (self as Date).dateAndTimeComponents() as NSDateComponents
}
}
36 changes: 36 additions & 0 deletions WordPressSharedTests/NSDateHelperTest.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import Foundation
import XCTest
@testable import WordPressShared

class NSDateHelperTest: XCTestCase {
struct Data {
let year: Int
let month: Int
let day: Int

var dateString: String {
return "\(year)-\(month)-\(day)"
}
}

let data = Data(year: 2019, month: 02, day: 17)
var date: Date?
var dateFormatter: DateFormatter {
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd"
return formatter
}

override func setUp() {
date = dateFormatter.date(from: data.dateString)
}

func testDateAndTimeComponents() {
XCTAssertNotNil(date)

let components = date!.dateAndTimeComponents()
XCTAssertEqual(components.year, data.year)
XCTAssertEqual(components.month, data.month)
XCTAssertEqual(components.day, data.day)
}
}

0 comments on commit 713ae66

Please sign in to comment.