You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by gi...@git.apache.org on 2017/06/14 20:14:02 UTC

[GitHub] bjustin-ibm commented on a change in pull request #2369: document how to add swift dependencies

bjustin-ibm commented on a change in pull request #2369: document how to add swift dependencies
URL: https://github.com/apache/incubator-openwhisk/pull/2369#discussion_r122052411
 
 

 ##########
 File path: docs/actions.md
 ##########
 @@ -659,6 +661,42 @@ docker run --rm -it -v "$(pwd):/owexec" openwhisk/swift3action bash
   echo '_run_main(mainFunction:main)' >> /swift3Action/spm-build/main.swift
   ```
 
+  Copy any additional source files to `/swift3Action/spm-build/`
+
+- Create Package.swift
+  If you need to add dependencies create a Package.swift file like the following:
+  ```swift
+  import PackageDescription
+  
+  let package = Package(
+    name: "Action",
+        dependencies: [
+            .Package(url: "https://github.com/IBM-Swift/Kitura-net.git", "1.0.1"),
+            .Package(url: "https://github.com/IBM-Swift/SwiftyJSON.git", "14.2.0"),
+            .Package(url: "https://github.com/IBM-Swift/swift-watson-sdk.git", "0.4.1"),
+            .Package(url: "https://github.com/apple/example-package-deckofplayingcards.git", majorVersion: 3)
+        ]
+  )
+  ```
+
+As you can see this example adds `swift-watson-sdk` and `example-package-deckofplayingcards` dependencies.
+Notice that `Kitura-net` and `SwiftyJSON.git` are the minimum required dependencies to include.
+
+- Copy Package.swift
+  ```
+  cp -f /owexec/Package.swift /swift3Action/spm-build/Package.swift
+  ```
+
+- Remove .build directory
+  ```
+  rm -rf /swift3Action/spm-build/.build/
+  ```
+
+- Generate a new swiftbuildandlink.sh
+  ```
+  python /swift3Action/buildandrecord.py
+  ```
 
 Review comment:
   I only vaguely recall that this may have been done for performance reasons (https://github.com/apache/incubator-openwhisk/issues/1371). @paulcastro would know for sure.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services