From 067946a5bfabcafd67b1e3d43d187e41f6f67e1a Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Thu, 5 Sep 2019 15:58:51 +0200 Subject: [PATCH 1/6] persist go cache in docker build image --- docker/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 33944905..af6eebe7 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -34,6 +34,9 @@ ENV ANDROID_NDK_HOME ${ANDROID_HOME}/ndk-bundle # Enable prebuild mode ENV SYNCTHING_ANDROID_PREBUILT 1 +# Set location of go cache +ENV GOCACHE /opt/gocache + # Run prebuild script (will prebuild stuff into the image if env var is set) ADD prebuild.sh /opt/prebuild.sh RUN /opt/prebuild.sh From 0d8e10afa1759c82234af28e6e1a03e3837993b8 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Thu, 5 Sep 2019 17:25:15 +0200 Subject: [PATCH 2/6] also persist go pkgs on docker image --- docker/Dockerfile | 3 +++ docker/prebuild.sh | 2 +- syncthing/build-syncthing.py | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index af6eebe7..b98c9df8 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -37,6 +37,9 @@ ENV SYNCTHING_ANDROID_PREBUILT 1 # Set location of go cache ENV GOCACHE /opt/gocache +# Set location of GOPATH to persist packages for module builds in GOPATH/pkg/mod +ENV GOPATH /opt/gopath + # Run prebuild script (will prebuild stuff into the image if env var is set) ADD prebuild.sh /opt/prebuild.sh RUN /opt/prebuild.sh diff --git a/docker/prebuild.sh b/docker/prebuild.sh index e2d8d5d1..b03505ce 100755 --- a/docker/prebuild.sh +++ b/docker/prebuild.sh @@ -33,7 +33,7 @@ for ARCH in arm x86 arm64; do GOOS=android GOARCH=$GOARCH go install -v std done -echo "Prepopulating gradle cache" +echo "Prepopulating gradle and go build/pkg cache" git clone https://github.com/syncthing/syncthing-android cd syncthing-android ./gradlew --no-daemon lint diff --git a/syncthing/build-syncthing.py b/syncthing/build-syncthing.py index f5bbb3bf..315da4cf 100644 --- a/syncthing/build-syncthing.py +++ b/syncthing/build-syncthing.py @@ -109,7 +109,6 @@ for target in BUILD_TARGETS: environ = os.environ.copy() environ.update({ - 'GOPATH': module_dir, 'GO111MODULE': 'on', 'CGO_ENABLED': '1', }) From 4a290c2be5dcdc45acab0ec3571ea4584e5158c0 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Thu, 5 Sep 2019 18:08:02 +0200 Subject: [PATCH 3/6] Remove go mod download as part of build (#1395) --- syncthing/build-syncthing.py | 1 - 1 file changed, 1 deletion(-) diff --git a/syncthing/build-syncthing.py b/syncthing/build-syncthing.py index 315da4cf..b1b2eea0 100644 --- a/syncthing/build-syncthing.py +++ b/syncthing/build-syncthing.py @@ -113,7 +113,6 @@ for target in BUILD_TARGETS: 'CGO_ENABLED': '1', }) - subprocess.check_call(['go', 'mod', 'download'], cwd=syncthing_dir) subprocess.check_call([ 'go', 'run', 'build.go', '-goos', 'android', '-goarch', target['goarch'], '-cc', os.path.join(standalone_ndk_dir, 'bin', target['cc']) ] + pkg_argument + ['-no-upgrade', 'build'], env=environ, cwd=syncthing_dir) From e8975a47146fc1adaaf0e39578860f3540f737b7 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Thu, 5 Sep 2019 18:11:10 +0200 Subject: [PATCH 4/6] Bumped version to 1.2.2.2 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index d824d0c3..c2dbefad 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -35,8 +35,8 @@ android { applicationId "com.nutomic.syncthingandroid" minSdkVersion 16 targetSdkVersion 28 - versionCode 4191 - versionName "1.2.2.1" + versionCode 4192 + versionName "1.2.2.2" testApplicationId 'com.nutomic.syncthingandroid.test' testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' } From 439476c18d301db07cc18948b594442750d2adb5 Mon Sep 17 00:00:00 2001 From: Audrius Butkevicius Date: Mon, 9 Sep 2019 08:24:20 +0100 Subject: [PATCH 5/6] Update AndroidManifest.xml --- app/src/main/AndroidManifest.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index f32d7b1b..c87ebe31 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -16,6 +16,8 @@ + + Date: Mon, 9 Sep 2019 08:25:48 +0100 Subject: [PATCH 6/6] Update build.gradle --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index c2dbefad..4b3f9a75 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -35,8 +35,8 @@ android { applicationId "com.nutomic.syncthingandroid" minSdkVersion 16 targetSdkVersion 28 - versionCode 4192 - versionName "1.2.2.2" + versionCode 4193 + versionName "1.2.2.3" testApplicationId 'com.nutomic.syncthingandroid.test' testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' }