Fixes issue #21, use swift:default as kind (#22)
diff --git a/wsktools/WhiskSwiftTools/ProjectManager.swift b/wsktools/WhiskSwiftTools/ProjectManager.swift
index 6196e63..41a47d9 100644
--- a/wsktools/WhiskSwiftTools/ProjectManager.swift
+++ b/wsktools/WhiskSwiftTools/ProjectManager.swift
@@ -326,8 +326,8 @@
var runtimeStr = "nodejs"
switch runtime {
- case Runtime.swift3:
- runtimeStr = "swift:3"
+ case Runtime.swift:
+ runtimeStr = "swift:default"
case Runtime.python:
runtimeStr = "python"
case Runtime.java:
diff --git a/wsktools/WhiskSwiftTools/ProjectReader.swift b/wsktools/WhiskSwiftTools/ProjectReader.swift
index 8746af2..84197c8 100644
--- a/wsktools/WhiskSwiftTools/ProjectReader.swift
+++ b/wsktools/WhiskSwiftTools/ProjectReader.swift
@@ -34,7 +34,7 @@
}
enum Runtime {
- case swift3
+ case swift
case nodeJS
case java
case python
@@ -295,7 +295,7 @@
}
} else if item.hasSuffix(".swift") {
- try addAction(fullPath as NSString, item: item, runtime: .swift3)
+ try addAction(fullPath as NSString, item: item, runtime: .swift)
} else if item.hasSuffix(".js") {
try addAction(fullPath as NSString, item: item, runtime: .nodeJS)
} else if item.hasSuffix(".json") {
@@ -498,8 +498,9 @@
if let item = actionsDict[(prefix+itemName) as NSString] {
var runtime = item.runtime
if let kind = action["kind"] as? String {
- if runtime == Runtime.swift3 && kind == "swift:3" {
- runtime = Runtime.swift3
+ // swift:default == swift:3 at the moment
+ if runtime == Runtime.swift && kind == "swift:3" {
+ runtime = Runtime.swift
}
}
diff --git a/wsktools/WhiskSwiftTools/WhiskTokenizer.swift b/wsktools/WhiskSwiftTools/WhiskTokenizer.swift
index 01925ca..a183333 100644
--- a/wsktools/WhiskSwiftTools/WhiskTokenizer.swift
+++ b/wsktools/WhiskSwiftTools/WhiskTokenizer.swift
@@ -120,7 +120,7 @@
let fileUrl = URL(fileURLWithPath: actionPath)
try action.actionCode.write(to: fileUrl, atomically: false, encoding: String.Encoding.utf8)
- let whiskAction = Action(name: action.actionName as NSString, path: actionPath as NSString, runtime: Runtime.swift3, parameters: nil)
+ let whiskAction = Action(name: action.actionName as NSString, path: actionPath as NSString, runtime: Runtime.swift, parameters: nil)
whiskActionArray.append(whiskAction)