Merge pull request #45 from neonichu/spm-support

Support for SPM
This commit is contained in:
Kyle Fuller
2015-12-08 12:28:55 +00:00
35 changed files with 22 additions and 11 deletions

2
.gitignore vendored
View File

@@ -1 +1,3 @@
.conche/ .conche/
.build/
Packages/

1
.swift-version Normal file
View File

@@ -0,0 +1 @@
2.2-dev

8
Package.swift Normal file
View File

@@ -0,0 +1,8 @@
import PackageDescription
let package = Package(
name: "Stencil",
dependencies: [
.Package(url: "https://github.com/kylef/PathKit.git", majorVersion: 0, minor: 5),
]
)

View File

@@ -26,9 +26,10 @@ public class Context {
/// Set a variable in the current context, deleting the variable if it's nil /// Set a variable in the current context, deleting the variable if it's nil
set(value) { set(value) {
if var dictionary = dictionaries.popLast() { if let dictionary = dictionaries.popLast() {
dictionary[key] = value var mutable_dictionary = dictionary
dictionaries.append(dictionary) mutable_dictionary[key] = value
dictionaries.append(mutable_dictionary)
} }
} }
} }

View File

@@ -16,8 +16,7 @@
"tag": "0.4.0" "tag": "0.4.0"
}, },
"source_files": [ "source_files": [
"Stencil/*.swift", "Sources/*.swift"
"Stencil/TemplateLoader/*.swift"
], ],
"platforms": { "platforms": {
"ios": "8.0", "ios": "8.0",
@@ -29,9 +28,9 @@
}, },
"test_specification": { "test_specification": {
"source_files": [ "source_files": [
"StencilSpecs/*.swift", "Tests/*.swift",
"StencilSpecs/TemplateLoader/*.swift", "Tests/TemplateLoader/*.swift",
"StencilSpecs/Nodes/*.swift" "Tests/Nodes/*.swift"
], ],
"dependencies": { "dependencies": {
"Spectre": [ "~> 0.5.0" ], "Spectre": [ "~> 0.5.0" ],

View File

@@ -4,7 +4,7 @@ import PathKit
describe("Include") { describe("Include") {
let path = Path(__FILE__) + ".." + ".." + "StencilSpecs" + "fixtures" let path = Path(__FILE__) + ".." + ".." + "Tests" + "fixtures"
let loader = TemplateLoader(paths: [path]) let loader = TemplateLoader(paths: [path])
$0.describe("parsing") { $0.describe("parsing") {

View File

@@ -4,7 +4,7 @@ import PathKit
describe("Inheritence") { describe("Inheritence") {
let path = Path(__FILE__) + ".." + ".." + "StencilSpecs" + "fixtures" let path = Path(__FILE__) + ".." + ".." + "Tests" + "fixtures"
let loader = TemplateLoader(paths: [path]) let loader = TemplateLoader(paths: [path])
$0.it("can inherit from another template") { $0.it("can inherit from another template") {

View File

@@ -4,7 +4,7 @@ import PathKit
describe("TemplateLoader") { describe("TemplateLoader") {
let path = Path(__FILE__) + ".." + ".." + "StencilSpecs" + "fixtures" let path = Path(__FILE__) + ".." + ".." + "Tests" + "fixtures"
let loader = TemplateLoader(paths: [path]) let loader = TemplateLoader(paths: [path])
$0.it("returns nil when a template cannot be found") { $0.it("returns nil when a template cannot be found") {