From 89fb76a8e7a874ebcc9eb915867cb3bd9fb456f9 Mon Sep 17 00:00:00 2001 From: xawotihs Date: Sun, 8 Dec 2013 12:16:25 +0100 Subject: [PATCH] Updated scripts to remove any modified artifacts from Res directory. Not doing it causes side effects on the testsuite. --- projects/mtg/bin/Res/createResourceZip.py | 7 +++++++ travis-script.sh | 4 +++- upload-binaries.sh | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/projects/mtg/bin/Res/createResourceZip.py b/projects/mtg/bin/Res/createResourceZip.py index 3699b882b..ff5ed73d5 100644 --- a/projects/mtg/bin/Res/createResourceZip.py +++ b/projects/mtg/bin/Res/createResourceZip.py @@ -7,10 +7,13 @@ from optparse import OptionParser def createResZipFile(filename): utilities = ZipUtilities() + rename = False if not os.path.isfile('settings/options.txt'): os.rename('settings/options.orig.txt', 'settings/options.txt') + remame = True if not os.path.isfile('player/options.txt'): os.rename('player/options.orig.txt', 'player/options.txt') + rename = True zip_file = zipfile.ZipFile(filename, 'w', zipfile.ZIP_STORED) utilities.addFolderToZip(zip_file, 'themes') @@ -25,6 +28,10 @@ def createResZipFile(filename): utilities.addFolderToZip(zip_file, 'campaigns') utilities.addFolderToZip(zip_file, 'ai') zip_file.close() + + if rename: + os.rename('settings/options.txt', 'settings/options.orig.txt') + os.rename('player/options.txt', 'player/options.orig.txt') def getFilename(): p = Properties(); diff --git a/travis-script.sh b/travis-script.sh index 5e1ad11ee..00f040c4e 100755 --- a/travis-script.sh +++ b/travis-script.sh @@ -39,7 +39,9 @@ make -j 8 # we create resource package cd projects/mtg/bin/Res python createResourceZip.py -mv core_*.zip core.zip +# if we let the zip here, Wagic will use it in the testsuite +# and we'll get 51 failed test cases +mv core_*.zip ../../../../core.zip cd ../../../.. # Now we run the testsuite (Res needs to be in the working directory) diff --git a/upload-binaries.sh b/upload-binaries.sh index efb900dc3..f688b8190 100755 --- a/upload-binaries.sh +++ b/upload-binaries.sh @@ -9,7 +9,7 @@ if [ "$TRAVIS_BRANCH" == "alphas" ]; then curl -X POST -H "Authorization: token ${GH_TOKEN}" \ -H "Accept: application/vnd.github.manifold-preview" \ -H "Content-Type: application/zip" \ - --data-binary @projects/mtg/bin/Res/core.zip \ + --data-binary @core.zip \ "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-core-${TRAVIS_BUILD_NUMBER}.zip" echo -e "Uploading android package\n"