Merge pull request #294 from stencilproject/feature/drop-swift-4

Drop Swift 4 support
This commit is contained in:
David Jennes
2020-05-29 02:14:43 +02:00
committed by GitHub
7 changed files with 12 additions and 82 deletions

View File

@@ -1,25 +1,13 @@
matrix: matrix:
include: include:
- os: osx - os: osx
osx_image: xcode9.2 osx_image: xcode11.4
env: SWIFT_VERSION=4.0.3
- os: osx
osx_image: xcode9.4
env: SWIFT_VERSION=4.1
- os: osx
osx_image: xcode10
env: SWIFT_VERSION=4.2 env: SWIFT_VERSION=4.2
- os: osx - os: osx
osx_image: xcode10.2 osx_image: xcode11.4
env: SWIFT_VERSION=5.0 env: SWIFT_VERSION=5.0
- os: linux
env: SWIFT_VERSION=4.0.3
- os: linux
env: SWIFT_VERSION=4.1
- os: linux - os: linux
env: SWIFT_VERSION=4.2 env: SWIFT_VERSION=4.2
- os: linux
env: SWIFT_VERSION=4.2.3
- os: linux - os: linux
env: SWIFT_VERSION=5.0 env: SWIFT_VERSION=5.0
language: generic language: generic

View File

@@ -4,7 +4,9 @@
### Breaking ### 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 ### Enhancements
@@ -22,7 +24,6 @@ _None_
- Fixed using parenthesis in boolean expressions, they now can be used without spaces around them. - Fixed using parenthesis in boolean expressions, they now can be used without spaces around them.
[Ilya Puchka](https://github.com/ilyapuchka) [Ilya Puchka](https://github.com/ilyapuchka)
[#254](https://github.com/stencilproject/Stencil/pull/254) [#254](https://github.com/stencilproject/Stencil/pull/254)
- Throw syntax error on empty variable tags (`{{ }}`) instead `fatalError`. - Throw syntax error on empty variable tags (`{{ }}`) instead `fatalError`.
[Ilya Puchka](https://github.com/ilyapuchka) [Ilya Puchka](https://github.com/ilyapuchka)
[#263](https://github.com/stencilproject/Stencil/pull/263) [#263](https://github.com/stencilproject/Stencil/pull/263)

View File

@@ -1,4 +1,4 @@
// swift-tools-version:4.0 // swift-tools-version:4.2
import PackageDescription import PackageDescription
let package = Package( let package = Package(
@@ -18,5 +18,6 @@ let package = Package(
"Stencil", "Stencil",
"Spectre" "Spectre"
]) ])
] ],
swiftLanguageVersions: [.v4_2]
) )

View File

@@ -1,23 +0,0 @@
// swift-tools-version:4.2
import PackageDescription
let package = Package(
name: "Stencil",
products: [
.library(name: "Stencil", targets: ["Stencil"])
],
dependencies: [
.package(url: "https://github.com/kylef/PathKit.git", from: "0.9.0"),
.package(url: "https://github.com/kylef/Spectre.git", from: "0.9.0")
],
targets: [
.target(name: "Stencil", dependencies: [
"PathKit"
], path: "Sources"),
.testTarget(name: "StencilTests", dependencies: [
"Stencil",
"Spectre"
])
],
swiftLanguageVersions: [.v4, .v4_2]
)

View File

@@ -19,5 +19,5 @@ let package = Package(
"Spectre" "Spectre"
]) ])
], ],
swiftLanguageVersions: [.v4, .v4_2, .v5] swiftLanguageVersions: [.v4_2, .v5]
) )

View File

@@ -1,42 +1,5 @@
import Foundation 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) #if !swift(>=4.2)
extension ArraySlice where Element: Equatable { extension ArraySlice where Element: Equatable {
func firstIndex(of element: Element) -> Int? { func firstIndex(of element: Element) -> Int? {

View File

@@ -23,12 +23,12 @@
"osx": "10.9", "osx": "10.9",
"tvos": "9.0" "tvos": "9.0"
}, },
"cocoapods_version": ">= 1.4.0", "cocoapods_version": ">= 1.7.0",
"swift_version": "5.0", "swift_versions": ["4.2", "5.0"],
"requires_arc": true, "requires_arc": true,
"dependencies": { "dependencies": {
"PathKit": [ "PathKit": [
"~> 0.9.0" "~> 1.0.0"
] ]
} }
} }