Update travis & appveyor build scripts

This commit is contained in:
Mahmood(Thunder07) 2017-01-21 01:26:20 +00:00
parent d6b0029c8b
commit d931dbbe16
4 changed files with 186 additions and 47 deletions

View File

@ -2,14 +2,34 @@
travis_before_install()
{
sudo add-apt-repository --yes ppa:beineri/opt-qt562-trusty
sudo apt-get update -qq
sudo apt-get install -qq qt56base
cd ..
if [ "$TARGET_OS" = "Linux" ]; then
sudo add-apt-repository --yes ppa:beineri/opt-qt562-trusty;
sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test;
sudo apt-get update -qq;
sudo apt-get install -qq qt56base gcc-5 g++-5 cmake libalut-dev;
elif [ "$TARGET_OS" = "Android" ]; then
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y #is this needed?
sudo apt-get update -y
sudo apt-get install libstdc++6 -y
wget http://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip
unzip android-ndk-r13b-linux-x86_64.zip>/dev/null
export ANDROID_NDK=$(pwd)/android-ndk-r13b
echo "ndk.dir=$ANDROID_NDK">./Play-/build_android/local.properties
wget https://github.com/Commit451/android-cmake-installer/releases/download/1.1.0/install-cmake.sh
chmod +x install-cmake.sh>/dev/null
./install-cmake.sh
fi;
git clone -q https://github.com/jpd002/Play-Build.git Play-Build
pushd Play-Build
git submodule update -q --init --recursive
git submodule foreach "git checkout -q master"
cd Dependencies
git submodule update --init
cd ..
rm -rf Play
mv ../Play- Play
popd
@ -17,10 +37,27 @@ travis_before_install()
travis_script()
{
if [ "$CXX" = "g++" ]; then export CXX="g++-5" CC="gcc-5"; fi
source /opt/qt56/bin/qt56-env.sh || true
cd build_unix
./build.sh
if [ "$TARGET_OS" = "Android" ]; then
cd build_android
chmod 755 gradlew
./gradlew
./gradlew assembleDebug
else
cd build_cmake
mkdir build
cd build
if [ "$TARGET_OS" = "Linux" ]; then
if [ "$CXX" = "g++" ]; then export CXX="g++-5" CC="gcc-5"; fi
source /opt/qt56/bin/qt56-env.sh || true
cmake .. -G"$BUILD_TYPE" -DCMAKE_PREFIX_PATH=/opt/qt56/;
cmake --build .
elif [ "$TARGET_OS" = "OSX" ]; then
cmake .. -G"$BUILD_TYPE" -DCMAKE_BUILD_TYPE=Debug;
cmake --build .
fi;
fi;
}
set -e

View File

@ -1,23 +1,44 @@
sudo: required
language: cpp
dist: trusty
matrix:
include:
- os: linux
dist: trusty
env:
- BUILD_TYPE="Unix Makefiles"
- TARGET_OS=Linux
sudo: require
- os: osx
osx_image: xcode8.3
env:
- BUILD_TYPE=Xcode TARGET_OS=OSX
- os: osx
osx_image: xcode8.3
env:
- BUILD_TYPE="Unix Makefiles"
- TARGET_OS=OSX
- os: linux
dist: precise
language: android
sudo: required
jdk: oraclejdk8
env:
global:
- ANDROID_TARGET=android-24
- ANDROID_ABI=armeabi-v7a
- BUILD_TYPE=Gradle
- TARGET_OS=Android
android:
components:
- tools
- platform-tools
- build-tools-24.0.3
- android-24
- extra-android-m2repository
- sys-img-${ANDROID_ABI}-${ANDROID_TARGET}
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-5
- g++-5
- cmake
- libglew-dev
- libboost-filesystem-dev
- libboost-system-dev
- libboost-chrono-dev
- libopenal-dev
language: cpp
before_install:
- bash .travis.sh travis_before_install
script:
- bash .travis.sh travis_script
- bash .travis.sh travis_script

View File

@ -32,21 +32,92 @@ C:\Projects
- Nuanceur
- Play
### Common Building Instructions ###
First you'd need to clone Play-Build which provides you with the needed subprojects required to build Play!.
Then setup the submodules and the dependency submodule(s) too.
```
git clone https://github.com/jpd002/Play-.git
git submodule update -q --init --recursive
git submodule foreach "git checkout -q master"
cd Dependencies
git submodule update --init
cd ..
```
Currently macOS, Windows, Linux & Android builds support cmake build.
### Building for Windows ###
for Windows, you'd need to have cmake and DirectX sdk installed
```
cd Play/build_cmake
mkdir build
cd build
```
```
# Not specifying -G would automatically pick Visual Studio 32bit
cmake .. -G"Visual Studio 14 2015 Win64"
cmake --build . --config Release
```
### Building for macOS ###
if you dont have cmake installed, you can install it using brew with the following command `brew install cmake`
on macOS there is 2 ways to setup a build, using makefile or Xcode
```
cd Play/build_cmake
mkdir build
cd build
```
```
# Not specifying -G would automatically pick Makefiles
cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
cmake --build .
# OR
cmake .. -G"Xcode"
cmake --build . --config Release
```
### Building for UNIX ###
if you dont have cmake or openal lib installed, you can install it using your OS packaging tool, e.g ubuntu `apt install cmake libalut-dev`
on UNIX systems there is 2 ways to setup a build, using makefile or Ninja
```
cd Play/build_cmake
mkdir build
cd build
```
```
# Not specifying -G would automatically pick Makefiles
cmake .. -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/opt/qt56/
cmake --build .
# OR
cmake .. -G"Ninja" -DCMAKE_PREFIX_PATH=/opt/qt56/
cmake --build . --config Release
```
Note `CMAKE_PREFIX_PATH` refers to the qt directory containing bin/libs folder, the above example uses a backport repo to install qt5.6 on trusty, if you install qt from their offical website, your `CMAKE_PREFIX_PATH` might look like this `~/Qt5.6.0/5.6/gcc_64/`
### Building for Android ###
Building for Android has been tested on Windows and UNIX environments.
Building for Android has been tested on macOS and UNIX environments.
Android can be built using Android Studio or through Gradle.
- Make a copy of `ExternalDependencies.mk.template` found in `build_android/jni` and rename to `ExternalDependencies.mk`
- Open the newly copied `ExternalDependencies.mk` and change paths inside to point to the proper dependency/repository paths (ie.: `/path/to/boost` -> `C:\Libraries\Boost`)
- The build script relies on some environment variables that must be set before building:
- `ANDROID_NDK` -> Must refer to the Android NDK's path (ie.: `C:\Android\android-ndk-r10e`)
- `ANDROID_SDK_ROOT` -> Must refer to the Android SDK's path (ie.: `C:\Android\android-sdk`)
- `ANT_HOME` -> Must refer to a valid Apache Ant installation.
- Make sure you've built all necessary depencendies: boost, Framework and CodeGen.
- Run the `build_debug` script available in the `build_android` directory to generate a debug build and `build_release` for a release build.
- Android Studio:
Files->Open Projects->Directory To Play/build_android
Install NDK using sdk manager
edit/create Play/build_android/local.properties, this file should contain sdk.dir when opened through Android Studio
for OSX: on a new line add `ndk.dir=/Users/USER_NAME/Library/Android/sdk/ndk-bundle` replacing `USER_NAME` with your macOS username,
for UNIX: on a new line add `ndk.dir=~/Android/Sdk/ndk-bundle`
for Windows: ##### TODO #####
note, this line would only be valid if you installed NDK through Android Studio's SDK manager.
Once this is done, you can start the build
### Building for macOS and iOS ###
- Gradle
edit/create Play/build_android/local.properties, this file should contain `sdk.dir` when opened through Android Studio, otherwise it wont exist and you can create it. on a new line add `ndk.dir=/location/to/ndk`, if you installed the NDK using android SDK it should be in `/Users/USER_NAME/Library/Android/sdk/ndk-bundle` replacing `USER_NAME` with your macOS username, else you can download it manually and set the path as appropriate.
```
cd Play/build_android
sh gradle assembleDebug
```
##### TODO: add instructions about Release/Signed builds. #####
Building for macOS and iOS has been tested with Xcode 6 and Xcode 7.
### Building for iOS ###
Building for iOS has been tested with Xcode 6 and Xcode 7.
To build for those platforms, you need to first build boost using the [script](https://github.com/jpd002/Play-Dependencies/blob/master/BoostMac/boost.sh) provided in the [Dependencies](https://github.com/jpd002/Play-Dependencies) repository. This will create the boost Xcode framework files that are needed by the projects from this repository. Once this is done, you will be able to open `Play.xcodeproj` for either OSX and iOS and build the project normally.

View File

@ -1,11 +1,11 @@
version: '{build}'
pull_requests:
do_not_increment_build_number: true
configuration:
- Debug
- Release
platform: x64
before_build:
environment:
BUILD_TYPE: Visual Studio 14 2015 Win64
TARGET_OS: WIN32
matrix:
- CONFIG_TYPE: Release
- CONFIG_TYPE: Debug
build_script:
- cmd: >-
git clone -q https://github.com/jpd002/Play-Build.git C:\Projects\Play-Build
@ -15,12 +15,22 @@ before_build:
git submodule foreach -q "git checkout -q master"
cd Dependencies
git submodule update --init
cd ..
rd /S /Q Play
move C:\Projects\Play Play
nuget.exe restore -verbosity quiet C:\Projects\Play-Build\Play\build_win32\Play.sln
build:
project: C:\Projects\Play-Build\Play\build_win32\Play.sln
parallel: true
verbosity: minimal
cd Play\build_cmake
mkdir build
cd build
cmake .. -G"%BUILD_TYPE%" -DCMAKE_BUILD_TYPE=%CONFIG_TYPE%
cmake --build . --config %CONFIG_TYPE%