diff --git a/.travis.yml b/.travis.yml index b7f08e04..9e0ca100 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ jobs: install: - | - if [ ! -f $HOME/Qt/$QT_VERSION/clang_64/bin/qmake ]; then \ + if [ ! -f $QT_BIN_DIR/qmake ]; then \ brew install p7zip && \ python3 -m pip install --upgrade pip && \ pip install -U aqtinstall requests py7zr && \ @@ -145,12 +145,13 @@ jobs: install: - | - if [ ! -f $HOME/Qt/$QT_VERSION/gcc_64/bin/qmake ]; then \ + if [ ! -f $QT_BIN_DIR/qmake ]; then \ sudo apt-get update && \ sudo apt install -yy p7zip python3 python3-pip && \ - python3 -m pip install --upgrade pip && \ - pip install -U aqtinstall requests py7zr && \ - pip show aqtinstall && \ + python3 -m pip install --user $(whoami) --upgrade pip && \ + export PATH=$HOME/.local/bin:$PATH && \ + python3 -m pip3 install -U aqtinstall requests py7zr && \ + python3 -m pip3 show aqtinstall && \ python3 -m aqt install-qt linux desktop $QT_VERSION clang_64 -m all -O $HOME/Qt && \ python3 -m aqt install-tool linux desktop tools_ifw -O $HOME/Qt ; \ fi @@ -199,12 +200,13 @@ jobs: install: - | - if [ ! -f $HOME/Qt/$QT_VERSION/android/bin/qmake ]; then \ + if [ ! -f $QT_BIN_DIR/qmake ]; then \ sudo apt-get update && \ sudo apt install -yy p7zip python3 python3-pip && \ - python3 -m pip install --upgrade pip && \ - pip install -U aqtinstall requests py7zr && \ - pip show aqtinstall && \ + python3 -m pip install --user $(whoami) --upgrade pip && \ + export PATH=$HOME/.local/bin:$PATH && \ + python3 -m pip3 install -U aqtinstall requests py7zr && \ + python3 -m pip3 show aqtinstall && \ python3 -m aqt install-qt linux android $QT_VERSION android_armv7 -m all -O $HOME/Qt && \ python3 -m aqt install-qt linux android $QT_VERSION android_arm64_v8a -m all -O $HOME/Qt && \ python3 -m aqt install-qt linux android $QT_VERSION android_x86_64 -m all -O $HOME/Qt && \ @@ -234,7 +236,30 @@ jobs: tags: true branch: master +# ------------------------------------------------------ + - name: iOS + os: osx + osx_image: xcode13.4 + language: objective-c + + env: + - QT_VERSION=5.15.2 + - QT_BIN_DIR=$HOME/Qt/$QT_VERSION/ios/bin + + install: + - | + if [ ! -f $QT_BIN_DIR/qmake ]; then \ + brew install p7zip && \ + python3 -m pip install --upgrade pip && \ + pip install -U aqtinstall requests py7zr && \ + pip show aqtinstall && \ + aqt install-qt mac ios $QT_VERSION -m all -O $HOME/Qt && \ + fi + - brew install golang && go install golang.org/x/mobile/cmd/gomobile@latest && gomobile init && \ + script: + - bash deploy/build_ios.sh + before_cache: - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew cleanup; fi diff --git a/client/scripts/apple_compile.sh b/client/scripts/apple_compile.sh index 48b438bb..fb44af30 100755 --- a/client/scripts/apple_compile.sh +++ b/client/scripts/apple_compile.sh @@ -270,6 +270,6 @@ print G "done." sed -i '' '/Original<\/string>/d' AmneziaVPN.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings fi -print Y "Opening in XCode..." -open AmneziaVPN.xcodeproj +# print Y "Opening in XCode..." +# open AmneziaVPN.xcodeproj print G "All done!" diff --git a/deploy/build_ios.sh b/deploy/build_ios.sh new file mode 100644 index 00000000..01e83837 --- /dev/null +++ b/deploy/build_ios.sh @@ -0,0 +1,50 @@ +#!/bin/bash +echo "Build script started ..." + +set -o errexit -o nounset + +# Hold on to current directory +PROJECT_DIR=$(pwd) +DEPLOY_DIR=$PROJECT_DIR/deploy + +mkdir -p $DEPLOY_DIR/build +BUILD_DIR=$DEPLOY_DIR/build + +echo "Project dir: ${PROJECT_DIR}" +echo "Build dir: ${BUILD_DIR}" + +APP_NAME=AmneziaVPN +APP_FILENAME=$APP_NAME.app +APP_DOMAIN=org.amneziavpn.package +PLIST_NAME=$APP_NAME.plist + +OUT_APP_DIR=$BUILD_DIR/client +BUNDLE_DIR=$OUT_APP_DIR/$APP_FILENAME + +PRO_FILE_PATH=$PROJECT_DIR/$APP_NAME.pro +QMAKE_STASH_FILE=$PROJECT_DIR/.qmake_stash + +# Seacrh Qt +if [ -z "${QT_VERSION+x}" ]; then +QT_VERSION=5.15.2; +QIF_VERSION=4.1 +QT_BIN_DIR=$HOME/Qt/$QT_VERSION/ios/bin +fi + +echo "Using Qt in $QT_BIN_DIR" + + +# Checking env +$QT_BIN_DIR/qmake -v + +# Build App +echo "Building App..." +cd PROJECT_DIR=$(pwd)/client + +./scripts/apple_compile.sh ios + +# Build and run tests here + +#echo "............Deploy.................." + +