Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Swift 4 support #294

Merged
merged 6 commits into from
May 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
matrix:
include:
- os: osx
osx_image: xcode9.2
env: SWIFT_VERSION=4.0.3
- os: osx
osx_image: xcode9.4
env: SWIFT_VERSION=4.1
- os: osx
osx_image: xcode10
osx_image: xcode11.4
env: SWIFT_VERSION=4.2
- os: osx
osx_image: xcode10.2
osx_image: xcode11.4
env: SWIFT_VERSION=5.0
- os: linux
env: SWIFT_VERSION=4.0.3
- os: linux
env: SWIFT_VERSION=4.1
- os: linux
env: SWIFT_VERSION=4.2
- os: linux
env: SWIFT_VERSION=4.2.3
- os: linux
env: SWIFT_VERSION=5.0
language: generic
Expand Down
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

### Breaking

_None_
- Drop support for Swift < 4.2. For Swift 4 support, you should use Stencil 0.13.1.
[David Jennes](https:/djbe)
[#294](https:/stencilproject/Stencil/pull/294)

### Enhancements

Expand All @@ -22,7 +24,6 @@ _None_
- Fixed using parenthesis in boolean expressions, they now can be used without spaces around them.
[Ilya Puchka](https:/ilyapuchka)
[#254](https:/stencilproject/Stencil/pull/254)

- Throw syntax error on empty variable tags (`{{ }}`) instead `fatalError`.
[Ilya Puchka](https:/ilyapuchka)
[#263](https:/stencilproject/Stencil/pull/263)
Expand Down
5 changes: 3 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:4.0
// swift-tools-version:4.2
import PackageDescription

let package = Package(
Expand All @@ -18,5 +18,6 @@ let package = Package(
"Stencil",
"Spectre"
])
]
],
swiftLanguageVersions: [.v4_2]
)
23 changes: 0 additions & 23 deletions [email protected]

This file was deleted.

2 changes: 1 addition & 1 deletion [email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ let package = Package(
"Spectre"
])
],
swiftLanguageVersions: [.v4, .v4_2, .v5]
swiftLanguageVersions: [.v4_2, .v5]
)
37 changes: 0 additions & 37 deletions Sources/_SwiftSupport.swift
Original file line number Diff line number Diff line change
@@ -1,42 +1,5 @@
import Foundation

#if !swift(>=4.1)
public extension Sequence {
func compactMap<ElementOfResult>(_ transform: (Element) throws -> ElementOfResult?) rethrows -> [ElementOfResult] {
return try flatMap(transform)
}
}
#endif

#if !swift(>=4.1)
public extension Collection {
func index(_ index: Self.Index, offsetBy offset: Int) -> Self.Index {
let indexDistance = Self.IndexDistance(offset)
return self.index(index, offsetBy: indexDistance)
}
}
#endif

#if !swift(>=4.1)
public extension TemplateSyntaxError {
public static func == (lhs: TemplateSyntaxError, rhs: TemplateSyntaxError) -> Bool {
return lhs.reason == rhs.reason &&
lhs.description == rhs.description &&
lhs.token == rhs.token &&
lhs.stackTrace == rhs.stackTrace &&
lhs.templateName == rhs.templateName
}
}
#endif

#if !swift(>=4.1)
public extension Variable {
public static func == (lhs: Variable, rhs: Variable) -> Bool {
return lhs.variable == rhs.variable
}
}
#endif

#if !swift(>=4.2)
extension ArraySlice where Element: Equatable {
func firstIndex(of element: Element) -> Int? {
Expand Down
6 changes: 3 additions & 3 deletions Stencil.podspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
"osx": "10.9",
"tvos": "9.0"
},
"cocoapods_version": ">= 1.4.0",
"swift_version": "5.0",
"cocoapods_version": ">= 1.7.0",
"swift_versions": ["4.2", "5.0"],
"requires_arc": true,
"dependencies": {
"PathKit": [
"~> 0.9.0"
"~> 1.0.0"
]
}
}