From 4fbddc2e6b805be713445583f339c60021ae8a21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Mon, 19 Aug 2019 14:58:37 -0400 Subject: [PATCH] use out for output, use CGO_ENABLED=1 and GO111MODULE=off for Android MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For details see: https://github.com/status-im/status-go/pull/1574 Signed-off-by: Jakub SokoĊ‚owski --- Makefile | 8 ++++++-- _assets/ci/Jenkinsfile | 2 +- _assets/ci/Jenkinsfile.android | 10 +++++++--- _assets/ci/Jenkinsfile.ios | 11 ++++++++--- _assets/ci/Jenkinsfile.linux | 6 +++--- _assets/ci/Jenkinsfile.xgo | 1 - 6 files changed, 25 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 127f28cbee7..af917ea4322 100644 --- a/Makefile +++ b/Makefile @@ -211,8 +211,8 @@ release: check-existing-release xgo-install: go get -u github.com/karalabe/xgo -gomobile-install: - go get -u golang.org/x/mobile/cmd/gomobile +gomobile-install: xtools-install + go get golang.org/x/mobile/cmd/gomobile release-install: go get -u github.com/c4milo/github-release @@ -221,6 +221,10 @@ gen-install: go get -u github.com/kevinburke/go-bindata/go-bindata@v3.13.0 go get -u github.com/golang/protobuf/protoc-gen-go@v1.3.1 +xtools-install: + # special fix for gomobile issues + go get golang.org/x/tools/go/packages + modvendor-install: # a tool to vendor non-go files go get -u github.com/goware/modvendor diff --git a/_assets/ci/Jenkinsfile b/_assets/ci/Jenkinsfile index 1cbacdecfeb..ad35a9b62ca 100644 --- a/_assets/ci/Jenkinsfile +++ b/_assets/ci/Jenkinsfile @@ -31,7 +31,7 @@ pipeline { GOPATH = "${env.WORKSPACE}" PATH = "/usr/local/go/bin:${env.PATH}:${env.GOPATH}/bin" /* This will override the var in Makefile */ - RELEASE_DIR = "${env.WORKSPACE}/pkg" + RELEASE_DIR = "${env.WORKSPACE}/out" } stages { diff --git a/_assets/ci/Jenkinsfile.android b/_assets/ci/Jenkinsfile.android index 79376b4b95e..c614ca0faf3 100644 --- a/_assets/ci/Jenkinsfile.android +++ b/_assets/ci/Jenkinsfile.android @@ -27,6 +27,10 @@ pipeline { } environment { + /* fix for gomobile complaining about missing packages */ + CGO_ENABLED = "1" + GO111MODULE = "off" + /* Other stuff */ BUILD_PLATFORM = 'android' STATUS_PATH = "${env.WORKSPACE}/src/github.com/status-im/status-go" CI_DIR = "${env.STATUS_PATH}/_assets/ci" @@ -47,7 +51,7 @@ pipeline { println("Git Branch: ${lib.gitBranch()}") println("Git Commit: ${lib.gitCommit()}") /* save and create a dir for artifacts */ - dest = "${env.WORKSPACE}/pkg" + dest = "${env.WORKSPACE}/out" sh "mkdir -p ${dest}" /* for easier reuse */ artifact = "status-go-android-${lib.suffix()}.aar" @@ -63,11 +67,11 @@ pipeline { } } } stage('Archive') { steps { - archiveArtifacts("pkg/${artifact}") + archiveArtifacts("out/${artifact}") } } stage('Upload') { steps { script { - env.PKG_URL = lib.uploadArtifact("pkg/${artifact}") + env.PKG_URL = lib.uploadArtifact("out/${artifact}") } } } } // stages post { diff --git a/_assets/ci/Jenkinsfile.ios b/_assets/ci/Jenkinsfile.ios index 7869fdb2223..84cde2f47f5 100644 --- a/_assets/ci/Jenkinsfile.ios +++ b/_assets/ci/Jenkinsfile.ios @@ -27,6 +27,10 @@ pipeline { } environment { + /* fix for gomobile complaining about missing packages */ + CGO_ENABLED = "1" + GO111MODULE = "off" + /* Other stuff */ BUILD_PLATFORM = 'ios' STATUS_PATH = "${env.WORKSPACE}/src/github.com/status-im/status-go" CI_DIR = "${env.STATUS_PATH}/_assets/ci" @@ -42,7 +46,7 @@ pipeline { println("Git Branch: ${lib.gitBranch()}") println("Git Commit: ${lib.gitCommit()}") /* save and create a dir for artifacts */ - dest = "${env.WORKSPACE}/pkg" + dest = "${env.WORKSPACE}/out" sh "mkdir -p ${dest}" /* for easier reuse */ artifact = "status-go-ios-${lib.suffix()}.zip" @@ -54,6 +58,7 @@ pipeline { stage('Compile') { steps { dir(env.STATUS_PATH) { sh 'make statusgo-ios' + sh 'go get golang.org/x/tools/go/packages' dir('build/bin') { sh 'zip -r status-go-ios.zip Statusgo.framework' sh "cp status-go-ios.zip ${dest}/${artifact}" @@ -61,11 +66,11 @@ pipeline { } } } stage('Archive') { steps { - archiveArtifacts("pkg/${artifact}") + archiveArtifacts("out/${artifact}") } } stage('Upload') { steps { script { - env.PKG_URL = lib.uploadArtifact("pkg/${artifact}") + env.PKG_URL = lib.uploadArtifact("out/${artifact}") } } } } // stages post { diff --git a/_assets/ci/Jenkinsfile.linux b/_assets/ci/Jenkinsfile.linux index ca89651be4a..e3b9595fa37 100644 --- a/_assets/ci/Jenkinsfile.linux +++ b/_assets/ci/Jenkinsfile.linux @@ -42,7 +42,7 @@ pipeline { println("Git Branch: ${lib.gitBranch()}") println("Git Commit: ${lib.gitCommit()}") /* save and create a dir for artifacts */ - dest = "${env.WORKSPACE}/pkg" + dest = "${env.WORKSPACE}/out" sh "mkdir -p ${dest}" /* for easier reuse */ artifact = "status-go-desktop-${lib.suffix()}.zip" @@ -57,11 +57,11 @@ pipeline { } } } stage('Archive') { steps { - archiveArtifacts("pkg/${artifact}") + archiveArtifacts("out/${artifact}") } } stage('Upload') { steps { script { - env.PKG_URL = lib.uploadArtifact("pkg/${artifact}") + env.PKG_URL = lib.uploadArtifact("out/${artifact}") } } } } // stages post { diff --git a/_assets/ci/Jenkinsfile.xgo b/_assets/ci/Jenkinsfile.xgo index 3943978fd98..b40da4c8ccf 100644 --- a/_assets/ci/Jenkinsfile.xgo +++ b/_assets/ci/Jenkinsfile.xgo @@ -76,7 +76,6 @@ pipeline { failure { script { load("${CI_DIR}/ghcmgr.groovy").postBuild(false) } } always { dir(env.STATUS_PATH) { sh 'make clean' - sh "rm -fr ${dest}" } } } // post }