mirror of
https://github.com/go-i2p/gomobile-java.git
synced 2025-06-15 19:48:47 -04:00
mobile/misc/androidstudio: support multiple packages
Let the 'pkg' configuration contain multiple packages, separated by spaces. Change-Id: Iea4385c126aef7cf839b0fa542a3e6c4530f57fe Reviewed-on: https://go-review.googlesource.com/20572 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This commit is contained in:
@ -9,7 +9,7 @@ plugins {
|
||||
}
|
||||
|
||||
gobind {
|
||||
// package to bind
|
||||
// Package to bind. Separate multiple packages with spaces.
|
||||
pkg "github.com/someone/somepackage"
|
||||
|
||||
// GOPATH
|
||||
|
@ -46,10 +46,10 @@ class GobindTask extends DefaultTask implements OutputFileTask {
|
||||
|
||||
@TaskAction
|
||||
def gobind() {
|
||||
def pkg = project.gobind.pkg
|
||||
def pkg = project.gobind.pkg.trim()
|
||||
def gopath = (project.gobind.GOPATH ?: System.getenv("GOPATH"))?.trim()
|
||||
if (!pkg || !gopath) {
|
||||
throw new GradleException('gobind.pkg and gobind.GOPATH must be set')
|
||||
throw new GradleException('gobind.pkg and gobind.GOPATH must be set')
|
||||
}
|
||||
|
||||
def paths = (gopath.split(File.pathSeparator).collect{ "$it/bin" } +
|
||||
@ -97,7 +97,7 @@ class GobindTask extends DefaultTask implements OutputFileTask {
|
||||
if (gomobileFlags) {
|
||||
cmd = cmd+gomobileFlags.split(" ")
|
||||
}
|
||||
cmd << pkg
|
||||
cmd.addAll(pkg.split(" "))
|
||||
|
||||
args(cmd)
|
||||
if (!androidHome?.trim()) {
|
||||
@ -137,7 +137,7 @@ class GobindTask extends DefaultTask implements OutputFileTask {
|
||||
}
|
||||
|
||||
class GobindExtension {
|
||||
// Package to bind. (required)
|
||||
// Package to bind. Separate multiple packages with spaces. (required)
|
||||
def String pkg = ""
|
||||
|
||||
// GOPATH: necessary for gomobile tool. (required)
|
||||
|
Reference in New Issue
Block a user