Added Travis CI support.

This commit is contained in:
Felix Ableitner 2014-11-17 13:46:27 +02:00
parent c8f0df35fa
commit 37044eea4c
3 changed files with 49 additions and 29 deletions

17
.travis.yml Normal file
View File

@ -0,0 +1,17 @@
language: android
android:
components:
- build-tools-21.1.0
- extra-android-m2repository
- android-8
- android-16
- android-21
env:
matrix:
- ANDROID_SDKS=android-8 ANDROID_TARGET=android-8 ANDROID_ABI=armeabi
- ANDROID_SDKS=android-16 ANDROID_TARGET=android-16 ANDROID_ABI=armeabi-v7a
- ANDROID_SDKS=android-21 ANDROID_TARGET=android-21 ANDROID_ABI=x86
script: "./gradlew build"

View File

@ -1,5 +1,6 @@
# syncthing-android # syncthing-android
[![current build status](https://travis-ci.org/Nutomic/syncthing-android.svg?branch=master)](https://travis-ci.org/Nutomic/syncthing-android)
[![tip for next commit](https://tip4commit.com/projects/914.svg)](https://tip4commit.com/github/Nutomic/syncthing-android) [![tip for next commit](https://tip4commit.com/projects/914.svg)](https://tip4commit.com/github/Nutomic/syncthing-android)
A wrapper of [syncthing](https://github.com/syncthing/syncthing) for Android. A wrapper of [syncthing](https://github.com/syncthing/syncthing) for Android.

View File

@ -6,48 +6,50 @@ mkdir -p bin
# Load submodules # Load submodules
if [ ! -f "ext/syncthing/src/github.com/syncthing/syncthing/.git" ]; then if [ ! -f "ext/syncthing/src/github.com/syncthing/syncthing/.git" ]; then
git submodule update --init --recursive git submodule update --init --recursive
fi fi
# Use own Go instance, installing it if missing. # Check for GOLANG installation
mkdir -p "build" if [ -z $GOROOT ] || [[ $(go version) != go\ version\ go1.3.3* ]] ; then
tmpgo='build/go' mkdir -p "build"
if [ ! -f "$tmpgo/bin/go" ]; then tmpgo='build/go'
# Download GOLANG v1.3.3 if [ ! -f "$tmpgo/bin/go" ]; then
wget -O go.src.tar.gz https://golang.org/dl/go1.3.3.src.tar.gz # Download GOLANG v1.3.3
sha1=$(sha1sum go.src.tar.gz) wget -O go.src.tar.gz https://golang.org/dl/go1.3.3.src.tar.gz
if [ "$sha1" != "b54b7deb7b7afe9f5d9a3f5dd830c7dede35393a go.src.tar.gz" ]; then sha1=$(sha1sum go.src.tar.gz)
echo "go.src.tar.gz SHA1 checksum does not match!" if [ "$sha1" != "b54b7deb7b7afe9f5d9a3f5dd830c7dede35393a go.src.tar.gz" ]; then
exit 1 echo "go.src.tar.gz SHA1 checksum does not match!"
fi exit 1
mkdir -p $tmpgo fi
tar -xzf go.src.tar.gz --strip=1 -C $tmpgo mkdir -p $tmpgo
rm go.src.tar.gz tar -xzf go.src.tar.gz --strip=1 -C $tmpgo
# Build GO for host rm go.src.tar.gz
pushd $tmpgo/src # Build GO for host
./make.bash --no-clean pushd $tmpgo/src
popd ./make.bash --no-clean
popd
fi
# Add GO to the environment
export GOROOT="$(pwd)/$tmpgo"
fi fi
# Add GO to the environment
export GOROOT="$(pwd)/$tmpgo"
# Add GO compiler to PATH # Add GO compiler to PATH
export PATH=$PATH:$GOROOT/bin export PATH=$PATH:$GOROOT/bin
# Check whether GOLANG is compiled with cross-compilation for 386 # Check whether GOLANG is compiled with cross-compilation for 386
if [ ! -f $GOROOT/bin/linux_386/go ]; then if [ ! -f $GOROOT/bin/linux_386/go ]; then
pushd $GOROOT/src pushd $GOROOT/src
# Build GO for cross-compilation # Build GO for cross-compilation
GOOS=linux GOARCH=386 ./make.bash --no-clean GOOS=linux GOARCH=386 ./make.bash --no-clean
popd popd
fi fi
# Check whether GOLANG is compiled with cross-compilation for arm # Check whether GOLANG is compiled with cross-compilation for arm
if [ ! -f $GOROOT/bin/linux_arm/go ]; then if [ ! -f $GOROOT/bin/linux_arm/go ]; then
pushd $GOROOT/src pushd $GOROOT/src
# Build GO for cross-compilation # Build GO for cross-compilation
GOOS=linux GOARCH=arm ./make.bash --no-clean GOOS=linux GOARCH=arm ./make.bash --no-clean
popd popd
fi fi
# Setup GOPATH # Setup GOPATH