[install package] Swift Package Management; is there such a thing as `swift package install`

I have a running binary on my iMac running XCode w/Swift 5.2 Development build and Vapor 4.0-rc3.1, how can I make an installer or copy a binary from my iMac to my MacMini server? The current environment is debug. I assume I have to change this to release? Perhaps this is more of an SPM question than Vapor? I mean I can always install XCode on the MacMini server as well and push CMD + R on there, but there must be a better way.

My binary runs fine from launchctl using /opt/local/dev/sss-19/.build/x86_64-apple-macosx/release/run serve --hostname 0.0.0.0 and plays well( at least with test data ) with all 4 NICs.

is there a way to tell Package.swift to do cp /opt/local/dev/sss-19/.build/x86_64-apple-macosx/release/run /opt/local/sss-19?
or cp /opt/local/dev/sss-19/.build/x86_64-apple-macosx/release/run /opt/local/sss-19/bin/run?

Is there such a thing as swift build install or swift build deploy? If so how can I configure this?

The following appears to serve my purpose in this case cp /opt/local/dev/sss-19/.build/x86_64-apple-macosx/release/run /opt/local/sss-19 However would be nice to have this as the Swift Package Manager.

There's no built-in install command currently.

You can use the --show-bin-path flag to get SwiftPM to tell you the destination path. This will return the correct path based on your build flags, like release or debug compilation mode. So you can use that as part of a larger shell script that calls swift build and then moves to the appropriate directory.

What I miss is gcc's make install feature. I was able to chmod and copy related / template files using a Makefile.

1 Like