From fd24e505111515c172e9952b0938ce4a298b76ac Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Sun, 18 May 2014 15:18:42 +0200 Subject: [PATCH] Use own build script instead of relying on syncthing build target. --- build-native.sh | 23 +++++++++++++++++++++++ build.gradle | 8 +++----- 2 files changed, 26 insertions(+), 5 deletions(-) create mode 100755 build-native.sh diff --git a/build-native.sh b/build-native.sh new file mode 100755 index 00000000..eb32e923 --- /dev/null +++ b/build-native.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +cd "$GOPATH/src/github.com/calmh/syncthing/" + +./build.sh test || exit 1 +./build.sh assets + +export GOOS=linux + +export GOARCH=386 + +./build.sh +cp syncthing syncthing-x86 + +export GOARCH=arm + +export GOARM=7 +./build.sh +cp syncthing syncthing-armeabi-v7a + +export GOARM=5 +./build.sh +cp syncthing syncthing-armeabi diff --git a/build.gradle b/build.gradle index 7948ac79..af7eaf78 100644 --- a/build.gradle +++ b/build.gradle @@ -95,16 +95,14 @@ def getVersionCodeFromManifest() { return Integer.parseInt(matcher.group(1)) } -ext.st_dir = System.getenv("GOPATH") + "/src/github.com/calmh/syncthing/"; task buildNative(type:Exec) { outputs.upToDateWhen { false } - executable = st_dir + 'build.sh' - workingDir = st_dir; - args = ['android'] + executable = './build-native.sh' } task copyNative(type: Copy) { outputs.upToDateWhen { false } + def st_dir = System.getenv("GOPATH") + "/src/github.com/calmh/syncthing/"; from st_dir + 'syncthing-x86', st_dir + 'syncthing-armeabi', st_dir + 'syncthing-armeabi-v7a'; into 'libs/' rename('syncthing-x86', 'x86/libsyncthing.so') @@ -116,4 +114,4 @@ buildNative.finalizedBy copyNative task cleanNative(type: Delete) { delete 'libs/' -} \ No newline at end of file +}