mirror of
https://github.com/go-i2p/gomobile-java.git
synced 2025-06-17 12:28:07 -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 {
|
gobind {
|
||||||
// package to bind
|
// Package to bind. Separate multiple packages with spaces.
|
||||||
pkg "github.com/someone/somepackage"
|
pkg "github.com/someone/somepackage"
|
||||||
|
|
||||||
// GOPATH
|
// GOPATH
|
||||||
|
@ -46,10 +46,10 @@ class GobindTask extends DefaultTask implements OutputFileTask {
|
|||||||
|
|
||||||
@TaskAction
|
@TaskAction
|
||||||
def gobind() {
|
def gobind() {
|
||||||
def pkg = project.gobind.pkg
|
def pkg = project.gobind.pkg.trim()
|
||||||
def gopath = (project.gobind.GOPATH ?: System.getenv("GOPATH"))?.trim()
|
def gopath = (project.gobind.GOPATH ?: System.getenv("GOPATH"))?.trim()
|
||||||
if (!pkg || !gopath) {
|
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" } +
|
def paths = (gopath.split(File.pathSeparator).collect{ "$it/bin" } +
|
||||||
@ -97,7 +97,7 @@ class GobindTask extends DefaultTask implements OutputFileTask {
|
|||||||
if (gomobileFlags) {
|
if (gomobileFlags) {
|
||||||
cmd = cmd+gomobileFlags.split(" ")
|
cmd = cmd+gomobileFlags.split(" ")
|
||||||
}
|
}
|
||||||
cmd << pkg
|
cmd.addAll(pkg.split(" "))
|
||||||
|
|
||||||
args(cmd)
|
args(cmd)
|
||||||
if (!androidHome?.trim()) {
|
if (!androidHome?.trim()) {
|
||||||
@ -137,7 +137,7 @@ class GobindTask extends DefaultTask implements OutputFileTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class GobindExtension {
|
class GobindExtension {
|
||||||
// Package to bind. (required)
|
// Package to bind. Separate multiple packages with spaces. (required)
|
||||||
def String pkg = ""
|
def String pkg = ""
|
||||||
|
|
||||||
// GOPATH: necessary for gomobile tool. (required)
|
// GOPATH: necessary for gomobile tool. (required)
|
||||||
|
Reference in New Issue
Block a user