This gist shows a quick overview of calling Rust in a Swift project, with Swift Package Manager configured.
Let's go ahead and create a folder containing all our sources:
mkdir swift-rs && cd $_| #!/bin/sh | |
| server_properties_path=$(dirname "$0")"/../server/server.properties" | |
| rcon_port=$(awk -F "=" '/rcon.port/ {print $2}' "$server_properties_path") | |
| rcon_password=$(awk -F "=" '/rcon.password/ {print $2}' "$server_properties_path") | |
| "$(dirname "$0")/mcrcon" -H 127.0.0.1 -P "$rcon_port" -p "$rcon_password" "$1" |