Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build with Gomobile #959

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}

}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.15.0'
classpath 'com.github.triplet.gradle:play-publisher:1.2.0'
classpath 'me.tatarka:gradle-retrolambda:3.7.0'
classpath "gradle.plugin.org.golang.mobile.bind2:gobindPlugin:0.2.5"
}
}

apply plugin: 'com.android.application'
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'com.github.triplet.play'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: "org.golang.mobile.bind2"

repositories {
jcenter()
Expand Down Expand Up @@ -107,3 +112,28 @@ task deleteUnsupportedPlayTranslations(type: Delete) {
delete 'src/main/play/nb'
delete 'src/main/play/en/'
}

gobind {
// The Go package path; must be under one of the GOPATH elements or
// a relative to the current directory (e.g. ../../hello)
pkg = "github.com/syncthing/syncthing/cmd/syncthing"

// gobind doesn't seem to use `~/go/ if GOPATH is unset, so we have to check it explicitly.
// https://github.com/golang/go/issues/21658
GOPATH = System.getenv('GOPATH') ?: System.getenv('HOME') + "/go/"

// Optionally, set the absolute path to the gomobile binary.
// GOMOBILE = "/path/to/gomobile"

// Pass extra parameters to command line. Optional.
// GOMOBILEFLAGS="-javapkg my.java.package"

// Absolute path to the gobind binary. Optional.
// GOBIND="/path/to/gobind"

// gobind can
// GOBIND="/path/to/gobind"

// Optional list of architectures. Defaults to all supported architectures.
GOARCH="arm arm64 386"
}