Browse Source

Initial commit

main
fdai7381 2 years ago
committed by fdai7451
commit
58a1bccd57
  1. 7
      .gitignore
  2. 7
      Cargo.lock
  3. 8
      Cargo.toml
  4. 1
      README.md
  5. 21
      build-project.sh
  6. 14
      prepare-build.sh
  7. 3
      src/main.rs

7
.gitignore

@ -0,0 +1,7 @@
.idea
.vscode
/target
.rustup
.cargo

7
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"

8
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]

1
README.md

@ -0,0 +1 @@
# pmuw-project

21
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"

14
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

3
src/main.rs

@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}
Loading…
Cancel
Save