Skip to content

Commit

Permalink
Merge pull request #294 from stencilproject/feature/drop-swift-4
Browse files Browse the repository at this point in the history
Drop Swift 4 support
  • Loading branch information
djbe authored May 29, 2020
2 parents 9c3468e + 0f1286c commit 124df01
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 82 deletions.
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://github.com/djbe)
[#294](https://github.com/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://github.com/ilyapuchka)
[#254](https://github.com/stencilproject/Stencil/pull/254)

- Throw syntax error on empty variable tags (`{{ }}`) instead `fatalError`.
[Ilya Puchka](https://github.com/ilyapuchka)
[#263](https://github.com/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 Package@swift-4.2.swift

This file was deleted.

2 changes: 1 addition & 1 deletion Package@swift-5.swift
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"
]
}
}

0 comments on commit 124df01

Please sign in to comment.