commit 58a1bccd57b4341ddc68119c625b7e67b4d1d5e0 Author: fdai7381 Date: Fri Jan 13 20:30:35 2023 +0100 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..37a413c --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +.idea +.vscode + +/target + +.rustup +.cargo diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..45435f0 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "pmuw-project" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..8994795 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "pmuw-project" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/README.md b/README.md new file mode 100644 index 0000000..0b44a63 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# pmuw-project diff --git a/build-project.sh b/build-project.sh new file mode 100755 index 0000000..a4a8d48 --- /dev/null +++ b/build-project.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +DIR="$(realpath "$(dirname -- "$0")")" + +# set env variables which are requested for rust +export RUSTUP_HOME="$DIR/.rustup" +export CARGO_HOME="$DIR/.cargo" + +source "$DIR/.cargo/env" + +echo "Running tests..." +cargo test +echo "Finished tests" + +echo +echo +echo + +echo "Building binary..." +cargo build --release +echo "Finished building binary. It is available at $DIR/target/release/pmuw-project" diff --git a/prepare-build.sh b/prepare-build.sh new file mode 100755 index 0000000..f56b77a --- /dev/null +++ b/prepare-build.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +DIR="$(realpath "$(dirname -- "$0")")" + +# set env variables to overwrite the directory where rust is installed into +export RUSTUP_HOME="$DIR/.rustup" +export CARGO_HOME="$DIR/.cargo" + +# download rust +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path + +# set the default rust version +source "$DIR/.cargo/env" +rustup default stable diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}