From 3dfc2e001b846d2dbb11bf19aafc978c3f952a38 Mon Sep 17 00:00:00 2001
From: Syping <schiedelrafael@keppe.org>
Date: Wed, 30 May 2018 09:51:27 +0200
Subject: [PATCH] fix dropbox build

---
 .travis.yml              | 4 ++++
 .travis/source.sh        | 2 +-
 .travis/windows_build.sh | 7 ++++++-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index f04e462..b9f1b90 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -31,6 +31,10 @@ matrix:
     - QT_SELECT=qt5-x86_64-w64-mingw32
     - RELEASE_LABEL="Windows 64-Bit Portable"
     - EXECUTABLE_ARCH=_x64
+  - env:
+    - BUILD_SCRIPT=windows_travis.sh
+    - QT_SELECT=qt5-x86_64-w64-mingw32
+    - PACKAGE_CODE=Dropbox
   - env:
     - BUILD_SCRIPT=wininstall_travis.sh
     - QT_SELECT=qt5-x86_64-w64-mingw32
diff --git a/.travis/source.sh b/.travis/source.sh
index f3a168d..0f0792e 100755
--- a/.travis/source.sh
+++ b/.travis/source.sh
@@ -2,4 +2,4 @@
 
 rm -rf tmext/TelemetryClassAuthenticator.cpp && \
 openssl aes-256-cbc -K $encrypted_55502862a724_key -iv $encrypted_55502862a724_iv -in tmext/TelemetryClassAuthenticator.cpp.enc -out tmext/TelemetryClassAuthenticator.cpp -d && \
-openssl aes-256-cbc -K $encrypted_d57e7d2f8877_key -iv $encrypted_d57e7d2f8877_iv -in dropbox_uploader.enc -out ~./dropbox_uploader -d
+openssl aes-256-cbc -K $encrypted_d57e7d2f8877_key -iv $encrypted_d57e7d2f8877_iv -in .travis/dropbox_uploader.enc -out ~/.dropbox_uploader -d
diff --git a/.travis/windows_build.sh b/.travis/windows_build.sh
index 5ab864b..e356812 100755
--- a/.travis/windows_build.sh
+++ b/.travis/windows_build.sh
@@ -15,4 +15,9 @@ qmake-static ${QMAKE_FLAGS} DEFINES+=GTA5SYNC_BUILDTYPE_DEV "DEFINES+=GTA5SYNC_B
 make -j 4 && \
 cp -Rf release/*.exe ${PROJECT_DIR}/assets/${GTA5VIEW_EXECUTABLE} && \
 cd ${PROJECT_DIR}/assets && \
-upx --best ${GTA5VIEW_EXECUTABLE}
+upx --best ${GTA5VIEW_EXECUTABLE} && \
+
+if [ "${PACKAGE_CODE}" == "Dropbox" ]; then
+	${PROJECT_DIR}/.travis/dropbox_uploader.sh upload ${GTA5VIEW_EXECUTABLE} gta5view-builds/${GTA5VIEW_EXECUTABLE} && \
+	rm -rf ${GTA5VIEW_EXECUTABLE}
+fi