From 61f49938e5719b50e2db5fc2963d54da1c7a4cee Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 29 Jul 2019 08:10:04 +0300 Subject: [PATCH] travis: build for android, not publish until touch controls are not done --- .travis.yml | 29 +++++++++++++++-------------- scripts/travis_android_deps.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 14 deletions(-) create mode 100755 scripts/travis_android_deps.sh diff --git a/.travis.yml b/.travis.yml index 41fbe9dd..eb25bc9c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -66,20 +66,21 @@ jobs: after_script: - ccache --show-stats - sh scripts/continious_upload.sh xash3d-fwgs-${ARCH}.AppImage xashds-linux-${ARCH} -# - # ... -# name: "Build for Android" -# cache: ccache -# os: linux -# dist: xenial -# before_script: -# - sh scripts/travis_common_deps.sh -# - sh scripts/travis_${TRAVIS_OS_NAME}_deps.sh -# - export ANDROID_HOME=$PWD/android-sdk-linux -# - export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:$PWD/android-ndk -# script: -# - sh scripts/build_${TRAVIS_OS_NAME}_engine.sh -# after_script: -# - ccache --show-stats + - # ... + name: "Build for Android" + cache: ccache + os: linux + dist: xenial + before_script: + - sh scripts/travis_common_deps.sh + - sh scripts/travis_android_deps.sh + - export ANDROID_SDK_HOME=$TRAVIS_BUILD_DIR/sdk + - export ANDROID_NDK_HOME=$ANDROID_SDK_HOME/ndk-bundle + script: + - cd android + - sh compile.sh + after_script: + - ccache --show-stats # - sh scripts/continious_upload.sh xash3d-fwgs.apk # - # ... # name: "Build for Windows MinGW" diff --git a/scripts/travis_android_deps.sh b/scripts/travis_android_deps.sh new file mode 100755 index 00000000..47aac61d --- /dev/null +++ b/scripts/travis_android_deps.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +echo "Download HLSDK" + +cd $TRAVIS_BUILD_DIR +git clone --depth 1 --recursive https://github.com/FWGS/hlsdk-xash3d hlsdk || exit 1 + +echo "Download Android SDK" +mkdir -p sdk && cd sdk +wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip -qO sdk.zip > /dev/null 2>/dev/null || exit 1 + +echo "Unpack Android SDK" +unzip sdk.zip > /dev/null 2>/dev/null || exit 1 + +echo "Download all needed tools and NDK" +cd tools/bin || exit 1 +./sdkmanager --install build-tools\;29.0.1 platform-tools platforms\;android-19 ndk-bundle + +echo "Download Xash3D FWGS Android source" +git clone --depth 1 https://github.com/FWGS/xash3d-android-project -b waf android || exit 1 +cd android + +echo "Fetching submodules" +git submodule update --init xash-extras || exit 1 + +ln -s $TRAVIS_BUILD_DIR xash3d-fwgs-sl +echo "Installed Xash3D FWGS source symlink" + +ln -s $TRAVIS_BUILD_DIR/hlsdk hlsdk-xash3d-sl +echo "Install HLSDK source symlink" + +cd $TRAVIS_BUILD_DIR