Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
kawoou committed May 20, 2018
2 parents ddd8ef9 + 6ef25e7 commit ae6fce2
Show file tree
Hide file tree
Showing 20 changed files with 1,107 additions and 65 deletions.
88 changes: 48 additions & 40 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,66 @@
osx_image: xcode9
osx_image: xcode9.3
language: objective-c
sudo: required
branches:
only:
- master
- develop
- /^v[\d.]+$/
except:
- screenshot

env:
global:
- PROJECT="AnyDate.xcodeproj"
- SCHEME="AnyDate-Package"
- FRAMEWORK="AnyDate"
- PROJECT="AnyDate.xcodeproj"
- SCHEME="AnyDate-Package"
- FRAMEWORK="AnyDate"
matrix:
- TEST=0 DESTINATION="platform=iOS Simulator,name=iPhone 8,OS=11.0"
- TEST=1 DESTINATION="arch=x86_64"
- TEST=0 DESTINATION="OS=11.0,name=Apple TV 1080p"
- TEST=0 DESTINATION="OS=4.0,name=Apple Watch - 38mm"
- TEST=1 DESTINATION="platform=iOS Simulator,name=iPhone 8,OS=11.3"
- TEST=1 DESTINATION="arch=x86_64"
- TEST=1 DESTINATION="OS=11.3,name=Apple TV"
- TEST=0 DESTINATION="OS=4.3,name=Apple Watch - 38mm"

install:
- eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
- swift --version
- eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
- swift --version

before_script:
- set -o pipefail
- if [ $TEST == 1 ]; then
TEST=1 swift package generate-xcodeproj;
else
swift package generate-xcodeproj;
fi
- set -o pipefail
- if [ $TEST == 1 ]; then
TEST=1 swift package generate-xcodeproj;
else
swift package generate-xcodeproj;
fi

script:
- if [ $TEST == 1 ]; then
xcodebuild clean build test
-project "$PROJECT"
-scheme "$SCHEME"
-destination "$DESTINATION"
-configuration Debug
-enableCodeCoverage YES
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty -c;
else
xcodebuild clean build
-project "$PROJECT"
-scheme "$SCHEME"
-destination "$DESTINATION"
-configuration Debug
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty -c;
fi
- if [ $TEST == 1 ]; then
xcodebuild clean build test
-project "$PROJECT"
-scheme "$SCHEME"
-destination "$DESTINATION"
-configuration Debug
-enableCodeCoverage YES
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty -c;
else
xcodebuild clean build
-project "$PROJECT"
-scheme "$SCHEME"
-destination "$DESTINATION"
-configuration Debug
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty -c;
fi

after_success:
- if [ $TEST == 1 ]; then
bash <(curl -s https://codecov.io/bash) -X xcodeplist -J 'AnyDate';
fi
- if [ $TEST == 1 ]; then
bash <(curl -s https://codecov.io/bash) -X xcodeplist -J 'AnyDate';
fi

before_deploy:
- ruby ./Supports/carthage_helper.rb prepare_xcconfig
- TEST=0 swift package generate-xcodeproj --xcconfig-overrides Config.xcconfig
- carthage build --no-skip-current --verbose | xcpretty -c
- ruby ./Supports/carthage_helper.rb modify_info
- carthage archive $FRAMEWORK
- ruby ./Supports/carthage_helper.rb prepare_xcconfig
- TEST=0 swift package generate-xcodeproj --xcconfig-overrides Config.xcconfig
- carthage build --no-skip-current --verbose | xcpretty -c
- ruby ./Supports/carthage_helper.rb modify_info
- carthage archive $FRAMEWORK

deploy:
provider: releases
Expand Down
2 changes: 1 addition & 1 deletion AnyDate.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = 'AnyDate'
s.version = '1.0.5'
s.version = '1.0.6'
s.summary = 'Swifty Date & Time API inspired from Java 8 DateTime API.'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.homepage = 'https://github.com/kawoou/AnyDate'
Expand Down
10 changes: 7 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ let package = Package(
targets: [
.target(
name: "AnyDate",
dependencies: []
dependencies: [],
path: "Sources/AnyDate"
),
.testTarget(
name: "AnyDateTests",
dependencies: []
dependencies: [
"AnyDate"
],
path: "Tests/AnyDateTests"
)
],
swiftLanguageVersions: [3, 4]
)
)
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,13 @@ print(newDate)
### [CocoaPods](https://cocoapods.org):

```ruby
pod 'AnyDate', '~> 1.0.5'
pod 'AnyDate', '~> 1.0.6'
```

### [Carthage](https://github.com/Carthage/Carthage):

```
github "kawoou/AnyDate" ~> 1.0.5
github "kawoou/AnyDate" ~> 1.0.6
```

### [Swift Package Manager](https://swift.org/package-manager):
Expand Down Expand Up @@ -221,6 +221,8 @@ You can either simply drag and drop the `Sources` folder into your existing proj
* Fix `Calendar(identifier: .iso8601)` crash on swift SR-3828.
* 1.0.5 - 2018/04/11
* Support for Swift 4.1 and Xcode 9.3.
* 1.0.6 - 2018/05/20
* Support Hashable.



Expand Down
13 changes: 12 additions & 1 deletion Sources/AnyDate/Clock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,17 @@ extension Clock: Comparable {
return !(lhs < rhs)
}

}
extension Clock: Hashable {

/// The hash value.
///
/// Hash values are not guaranteed to be equal across different executions of
/// your program. Do not save hash values to use during a future execution.
public var hashValue: Int {
return offsetSecond
}

}
extension Clock: Equatable {

Expand Down Expand Up @@ -184,7 +195,7 @@ extension Clock: CustomReflectable {
}

}
#if swift(>=4.1)
#if swift(>=4.1) || (swift(>=3.3) && !swift(>=4.0))
extension Clock: CustomPlaygroundDisplayConvertible {

/// Returns the custom playground description for this instance.
Expand Down
Loading

0 comments on commit ae6fce2

Please sign in to comment.