diff options
author | Justin Worthe <justin@worthe-it.co.za> | 2019-04-22 11:19:16 +0200 |
---|---|---|
committer | Justin Worthe <justin@worthe-it.co.za> | 2019-04-22 11:19:16 +0200 |
commit | 29a323e0a3bd3ab3e6109b23e15bb5f9e88398e3 (patch) | |
tree | a151c612b5993f127d99c29d4c4fdcf252528436 /README.md |
Start the project from the starter bot
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..a0c3008 --- /dev/null +++ b/README.md @@ -0,0 +1,81 @@ +# Steam Powered Wyrm + +This is an entry to the 2019 Entelect Challenge. + +## Environment Setup + +The Rust compiler toolchain can be downloaded from the Rust project +website. + +https://www.rust-lang.org/en-US/install.html + +The project requires these versions of the toolchain (or later). + +- cargo 1.34.0 +- rustc 1.34.0 + +## Building + +Rust's official build tool is called Cargo. It will download +dependencies and call the Rust compiler as required. Dependencies are +configured in [Cargo.toml](./Cargo.toml). + +Cargo needs to be called from the root of the bot (the folder with the +Cargo.toml file). + +```sh +cargo build --release +``` + +## Running Tests + +Rust has support for unit testing built into the language. Any +functions marked with the `#[test]` annotation are considered tests. + +Tests can be run using Cargo: + +```sh +cargo test +``` + +More information on how to write tests is available in +[The Rust Programming Language](https://doc.rust-lang.org/book/ch11-00-testing.html). + +## Exporting the compiled executable + +By default, Rust produces statically linked binaries, so you can just +copy out the executable file from the target directory and put it +wherever you want. + +The name of the binary will match the name of the binary crate in +Cargo.toml. + +Note: This binary has been built for the platform that it was compiled +on. In other words, if it was compiled on 64 bit Linux, you cannot +copy the binary to a Windows machine and run it. You WILL be able to +copy the binary between similar 64 bit Linux machines. + +The machine that the compiled binary is run on does not need to have +the Rust toolchain installed. + +```sh +cp ./target/release/<botFileName> <dest> +``` + +## Running + +The compiled binary can be executed directly. + +```sh +./target/release/<botFileName> +``` + +For convenience in development, you can compile and run through Cargo. + +Note: This is not recommended for the tournament servers, since there +is a small runtime cost in Cargo checking that the compiled binary is +up to date before running it. + +```sh +cargo run --release +``` |