1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-22 12:21:15 +00:00

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
[![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)
A wrapper of [syncthing](https://github.com/syncthing/syncthing) for Android.

View file

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