Drop swift 4.2 support
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
// swift-tools-version:4.2
|
// swift-tools-version:5.0
|
||||||
import PackageDescription
|
import PackageDescription
|
||||||
|
|
||||||
let package = Package(
|
let package = Package(
|
||||||
@@ -19,5 +19,5 @@ let package = Package(
|
|||||||
"Spectre"
|
"Spectre"
|
||||||
])
|
])
|
||||||
],
|
],
|
||||||
swiftLanguageVersions: [.v4_2]
|
swiftLanguageVersions: [.v5]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
// swift-tools-version:5.0
|
|
||||||
import PackageDescription
|
|
||||||
|
|
||||||
let package = Package(
|
|
||||||
name: "Stencil",
|
|
||||||
products: [
|
|
||||||
.library(name: "Stencil", targets: ["Stencil"])
|
|
||||||
],
|
|
||||||
dependencies: [
|
|
||||||
.package(url: "https://github.com/kylef/PathKit.git", from: "1.0.1"),
|
|
||||||
.package(url: "https://github.com/kylef/Spectre.git", from: "0.10.1")
|
|
||||||
],
|
|
||||||
targets: [
|
|
||||||
.target(name: "Stencil", dependencies: [
|
|
||||||
"PathKit"
|
|
||||||
], path: "Sources"),
|
|
||||||
.testTarget(name: "StencilTests", dependencies: [
|
|
||||||
"Stencil",
|
|
||||||
"Spectre"
|
|
||||||
])
|
|
||||||
],
|
|
||||||
swiftLanguageVersions: [.v4_2, .v5]
|
|
||||||
)
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import Foundation
|
|
||||||
|
|
||||||
#if !swift(>=4.2)
|
|
||||||
extension ArraySlice where Element: Equatable {
|
|
||||||
func firstIndex(of element: Element) -> Int? {
|
|
||||||
return index(of: element)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
@@ -25,7 +25,6 @@
|
|||||||
},
|
},
|
||||||
"cocoapods_version": ">= 1.7.0",
|
"cocoapods_version": ">= 1.7.0",
|
||||||
"swift_versions": [
|
"swift_versions": [
|
||||||
"4.2",
|
|
||||||
"5.0"
|
"5.0"
|
||||||
],
|
],
|
||||||
"requires_arc": true,
|
"requires_arc": true,
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
import XCTest
|
|
||||||
|
|
||||||
import StencilTests
|
|
||||||
|
|
||||||
var tests = [XCTestCaseEntry]()
|
|
||||||
tests += StencilTests.__allTests()
|
|
||||||
|
|
||||||
XCTMain(tests)
|
|
||||||
@@ -1,228 +0,0 @@
|
|||||||
import XCTest
|
|
||||||
|
|
||||||
extension ContextTests {
|
|
||||||
static let __allTests = [
|
|
||||||
("testContextRestoration", testContextRestoration),
|
|
||||||
("testContextSubscripting", testContextSubscripting),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
extension EnvironmentBaseAndChildTemplateTests {
|
|
||||||
static let __allTests = [
|
|
||||||
("testRuntimeErrorInBaseTemplate", testRuntimeErrorInBaseTemplate),
|
|
||||||
("testRuntimeErrorInChildTemplate", testRuntimeErrorInChildTemplate),
|
|
||||||
("testSyntaxErrorInBaseTemplate", testSyntaxErrorInBaseTemplate),
|
|
||||||
("testSyntaxErrorInChildTemplate", testSyntaxErrorInChildTemplate),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
extension EnvironmentIncludeTemplateTests {
|
|
||||||
static let __allTests = [
|
|
||||||
("testRuntimeError", testRuntimeError),
|
|
||||||
("testSyntaxError", testSyntaxError),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
extension EnvironmentTests {
|
|
||||||
static let __allTests = [
|
|
||||||
("testLoading", testLoading),
|
|
||||||
("testRendering", testRendering),
|
|
||||||
("testRenderingError", testRenderingError),
|
|
||||||
("testSyntaxError", testSyntaxError),
|
|
||||||
("testUnknownFilter", testUnknownFilter),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
extension ExpressionsTests {
|
|
||||||
static let __allTests = [
|
|
||||||
("testAndExpression", testAndExpression),
|
|
||||||
("testEqualityExpression", testEqualityExpression),
|
|
||||||
("testExpressionParsing", testExpressionParsing),
|
|
||||||
("testFalseExpressions", testFalseExpressions),
|
|
||||||
("testFalseInExpression", testFalseInExpression),
|
|
||||||
("testInequalityExpression", testInequalityExpression),
|
|
||||||
("testLessThanEqualExpression", testLessThanEqualExpression),
|
|
||||||
("testLessThanExpression", testLessThanExpression),
|
|
||||||
("testMoreThanEqualExpression", testMoreThanEqualExpression),
|
|
||||||
("testMoreThanExpression", testMoreThanExpression),
|
|
||||||
("testMultipleExpressions", testMultipleExpressions),
|
|
||||||
("testNotExpression", testNotExpression),
|
|
||||||
("testOrExpression", testOrExpression),
|
|
||||||
("testTrueExpressions", testTrueExpressions),
|
|
||||||
("testTrueInExpression", testTrueInExpression),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
extension FilterTagTests {
|
|
||||||
static let __allTests = [
|
|
||||||
("testFilterTag", testFilterTag),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
extension FilterTests {
|
|
||||||
static let __allTests = [
|
|
||||||
("testDefaultFilter", testDefaultFilter),
|
|
||||||
("testDynamicFilters", testDynamicFilters),
|
|
||||||
("testFilterSuggestion", testFilterSuggestion),
|
|
||||||
("testIndentContent", testIndentContent),
|
|
||||||
("testIndentFirstLine", testIndentFirstLine),
|
|
||||||
("testIndentNotEmptyLines", testIndentNotEmptyLines),
|
|
||||||
("testIndentWithArbitraryCharacter", testIndentWithArbitraryCharacter),
|
|
||||||
("testJoinFilter", testJoinFilter),
|
|
||||||
("testRegistration", testRegistration),
|
|
||||||
("testRegistrationOverrideDefault", testRegistrationOverrideDefault),
|
|
||||||
("testRegistrationWithArguments", testRegistrationWithArguments),
|
|
||||||
("testSplitFilter", testSplitFilter),
|
|
||||||
("testStringFilters", testStringFilters),
|
|
||||||
("testStringFiltersWithArrays", testStringFiltersWithArrays),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
extension ForNodeTests {
|
|
||||||
static let __allTests = [
|
|
||||||
("testArrayOfTuples", testArrayOfTuples),
|
|
||||||
("testForNode", testForNode),
|
|
||||||
("testHandleInvalidInput", testHandleInvalidInput),
|
|
||||||
("testIterateDictionary", testIterateDictionary),
|
|
||||||
("testIterateRange", testIterateRange),
|
|
||||||
("testIterateUsingMirroring", testIterateUsingMirroring),
|
|
||||||
("testLoopMetadata", testLoopMetadata),
|
|
||||||
("testWhereExpression", testWhereExpression),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
extension IfNodeTests {
|
|
||||||
static let __allTests = [
|
|
||||||
("testEvaluatesNilAsFalse", testEvaluatesNilAsFalse),
|
|
||||||
("testParseIf", testParseIf),
|
|
||||||
("testParseIfnot", testParseIfnot),
|
|
||||||
("testParseIfWithElif", testParseIfWithElif),
|
|
||||||
("testParseIfWithElifWithoutElse", testParseIfWithElifWithoutElse),
|
|
||||||
("testParseIfWithElse", testParseIfWithElse),
|
|
||||||
("testParseMultipleElif", testParseMultipleElif),
|
|
||||||
("testParsingErrors", testParsingErrors),
|
|
||||||
("testRendering", testRendering),
|
|
||||||
("testSupportsRangeVariables", testSupportsRangeVariables),
|
|
||||||
("testSupportVariableFilters", testSupportVariableFilters),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
extension IncludeTests {
|
|
||||||
static let __allTests = [
|
|
||||||
("testParsing", testParsing),
|
|
||||||
("testRendering", testRendering),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
extension InheritanceTests {
|
|
||||||
static let __allTests = [
|
|
||||||
("testInheritance", testInheritance),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
extension LexerTests {
|
|
||||||
static let __allTests = [
|
|
||||||
("testComment", testComment),
|
|
||||||
("testContentMixture", testContentMixture),
|
|
||||||
("testEmptyVariable", testEmptyVariable),
|
|
||||||
("testEscapeSequence", testEscapeSequence),
|
|
||||||
("testNewlines", testNewlines),
|
|
||||||
("testPerformance", testPerformance),
|
|
||||||
("testText", testText),
|
|
||||||
("testTokenizeIncorrectSyntaxWithoutCrashing", testTokenizeIncorrectSyntaxWithoutCrashing),
|
|
||||||
("testTokenWithoutSpaces", testTokenWithoutSpaces),
|
|
||||||
("testUnclosedBlock", testUnclosedBlock),
|
|
||||||
("testUnclosedTag", testUnclosedTag),
|
|
||||||
("testVariable", testVariable),
|
|
||||||
("testVariablesWithoutBeingGreedy", testVariablesWithoutBeingGreedy),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
extension NodeTests {
|
|
||||||
static let __allTests = [
|
|
||||||
("testRendering", testRendering),
|
|
||||||
("testTextNode", testTextNode),
|
|
||||||
("testVariableNode", testVariableNode),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
extension NowNodeTests {
|
|
||||||
static let __allTests = [
|
|
||||||
("testParsing", testParsing),
|
|
||||||
("testRendering", testRendering),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
extension StencilTests {
|
|
||||||
static let __allTests = [
|
|
||||||
("testStencil", testStencil),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
extension TemplateLoaderTests {
|
|
||||||
static let __allTests = [
|
|
||||||
("testDictionaryLoader", testDictionaryLoader),
|
|
||||||
("testFileSystemLoader", testFileSystemLoader),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
extension TemplateTests {
|
|
||||||
static let __allTests = [
|
|
||||||
("testTemplate", testTemplate),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
extension TokenParserTests {
|
|
||||||
static let __allTests = [
|
|
||||||
("testTokenParser", testTokenParser),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
extension TokenTests {
|
|
||||||
static let __allTests = [
|
|
||||||
("testToken", testToken),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
extension VariableTests {
|
|
||||||
static let __allTests = [
|
|
||||||
("testArray", testArray),
|
|
||||||
("testDictionary", testDictionary),
|
|
||||||
("testKVO", testKVO),
|
|
||||||
("testLiterals", testLiterals),
|
|
||||||
("testMultipleSubscripting", testMultipleSubscripting),
|
|
||||||
("testOptional", testOptional),
|
|
||||||
("testRangeVariable", testRangeVariable),
|
|
||||||
("testReflection", testReflection),
|
|
||||||
("testSubscripting", testSubscripting),
|
|
||||||
("testTuple", testTuple),
|
|
||||||
("testVariable", testVariable),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
#if !os(macOS)
|
|
||||||
public func __allTests() -> [XCTestCaseEntry] {
|
|
||||||
return [
|
|
||||||
testCase(ContextTests.__allTests),
|
|
||||||
testCase(EnvironmentBaseAndChildTemplateTests.__allTests),
|
|
||||||
testCase(EnvironmentIncludeTemplateTests.__allTests),
|
|
||||||
testCase(EnvironmentTests.__allTests),
|
|
||||||
testCase(ExpressionsTests.__allTests),
|
|
||||||
testCase(FilterTagTests.__allTests),
|
|
||||||
testCase(FilterTests.__allTests),
|
|
||||||
testCase(ForNodeTests.__allTests),
|
|
||||||
testCase(IfNodeTests.__allTests),
|
|
||||||
testCase(IncludeTests.__allTests),
|
|
||||||
testCase(InheritanceTests.__allTests),
|
|
||||||
testCase(LexerTests.__allTests),
|
|
||||||
testCase(NodeTests.__allTests),
|
|
||||||
testCase(NowNodeTests.__allTests),
|
|
||||||
testCase(StencilTests.__allTests),
|
|
||||||
testCase(TemplateLoaderTests.__allTests),
|
|
||||||
testCase(TemplateTests.__allTests),
|
|
||||||
testCase(TokenParserTests.__allTests),
|
|
||||||
testCase(TokenTests.__allTests),
|
|
||||||
testCase(VariableTests.__allTests),
|
|
||||||
]
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
Reference in New Issue
Block a user