From 9aea87f7e9825edb8b29d340f4b081a13c5f743f Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Thu, 14 Oct 2021 16:24:19 +0200 Subject: [PATCH] Fix the delivery scripts It adds in the other resources, but ignores the ones handed out --- README.md | 22 ++++++++++++++++++- create_code_archive_for_blackboard_LINUX.sh | 13 ++++++++++- ...te_code_archive_for_blackboard_WINDOWS.bat | 14 +++++++++++- 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 992362b..61aaee2 100644 --- a/README.md +++ b/README.md @@ -14,4 +14,24 @@ Make sure it works before using it to write your report. ## Code delivery -To make a code archive (`source.zip`) for uploading to blackboard: run either `create_code_archive_for_blackboard_LINUX.sh` or `create_code_archive_for_blackboard_WINDOWS.bat`. +We want the following files and folders to be delivered in a ZIP file: + +* `resources` +* `shaders` +* `src` +* `Cargo.lock` +* `Cargo.toml` + +**Important:** Do not include the `target` folder! + +To automatically make an archive (`source.zip`) ready for uploading to blackboard: + +* Make sure any extra assets or resources you have might have added are located in the `resources` folder +* Then run either: + * `create_code_archive_for_blackboard_LINUX.sh` + * `create_code_archive_for_blackboard_WINDOWS.bat`. + +This script will explicitly ignore the `target` folder, and two files given as a handout for assignment 3, to save space: + +* `resources/helicopter.obj` +* `resources/lunarsurface.obj` diff --git a/create_code_archive_for_blackboard_LINUX.sh b/create_code_archive_for_blackboard_LINUX.sh index 9e784ff..6ec0439 100755 --- a/create_code_archive_for_blackboard_LINUX.sh +++ b/create_code_archive_for_blackboard_LINUX.sh @@ -1,2 +1,13 @@ #!/bin/sh -zip -r source.zip src shaders Cargo.lock Cargo.toml +if test -f source.zip; then + rm -v source.zip +fi +zip -r source.zip \ + Cargo.lock \ + Cargo.toml \ + src \ + shaders \ + resources/* \ + -x"resources/helicopter.obj" \ + -x"resources/lunarsurface.obj" \ + -x"resources/.gitkeep" diff --git a/create_code_archive_for_blackboard_WINDOWS.bat b/create_code_archive_for_blackboard_WINDOWS.bat index 12fea4f..b3a3f25 100644 --- a/create_code_archive_for_blackboard_WINDOWS.bat +++ b/create_code_archive_for_blackboard_WINDOWS.bat @@ -1,2 +1,14 @@ -vendor\7za.exe a source.zip src shaders Cargo.lock Cargo.toml + +if exist source.zip ( + del source.zip +) +vendor/7za.exe -tzip a source.zip ^ + Cargo.lock ^ + Cargo.toml ^ + src ^ + shaders ^ + resources/* ^ + -x!resources/helicopter.obj ^ + -x!resources/lunarsurface.obj ^ + -x!resources/.gitkeep pause