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/09 03:34:20 UTC

[GitHub] csantanapr opened a new issue #2351: document how to add swift dependencies via Package.swift

csantanapr opened a new issue #2351: document how to add swift dependencies via Package.swift
URL: https://github.com/apache/incubator-openwhisk/issues/2351
 
 
   We document how to compile swift and create a zip action using the swift docker container.
   https://github.com/apache/incubator-openwhisk/blob/master/docs/actions.md#packaging-an-action-as-a-swift-executable
   
   The steps are missing how an user would add a dependency by using Package.swift
   
   This is one way I got it to work
   I tried this today and the steps missing are:
   Before running `/swift3Action/spm-build/swiftbuildandlink.sh`
   
   Delete the file `swiftbuildandlink.sh`
    `rm /swift3Action/spm-build/swiftbuildandlink.sh`
   
   Delete the build folder `spm-build/.build/`
   `rm -rf /swift3Action/spm-build/.build/`
   Edit for example using vim, or replacing the file `spm-build/Package.swift`
   `cp -f /owexec/Package.swift /swift3Action/spm-build/Package.swift`
   For example I tried adding a package used in swift.org examples `https://github.com/apple/example-package-deckofplayingcards.git`
   
   ```
   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)
           ]
   )
   
   ```
   Make sure at minimum you include `Kitura-net.git` and `SwiftyJSON.git`
   
   Recreate `swiftbuildandlink.sh`
   `python /swift3Action/buildandrecord.py`
   
   Then continue with current docs
   ```
   /swift3Action/spm-build/swiftbuildandlink.sh
   cd /swift3Action/spm-build
   zip /owexec/hello.zip .build/release/Action
   exit
   ```
 
----------------------------------------------------------------
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