mirror of
https://github.com/netbirdio/gomobile-tvos-fork.git
synced 2026-05-22 18:43:29 -07:00
cmd: fix handling of (multiple) tags
The gomobile tool mishandled build tags in two ways, first by ignoring tags for iOS, second by passing multiple tags along to the go tool incorrectly. This CL fixes both. Fixes golang/go#18523 Fixes golang/go#18515 Change-Id: I28a49c1e23670adb085617d9f5fb5cd5e22a4b65 Reviewed-on: https://go-review.googlesource.com/34955 Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
@@ -581,4 +581,8 @@ public class SeqTest extends InstrumentationTestCase {
|
||||
public void testSIGPIPE() {
|
||||
Testpkg.testSIGPIPE();
|
||||
}
|
||||
|
||||
public void testTags() {
|
||||
assertEquals("Constant from a tagged file", 42, Testpkg.TaggedConst);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,12 +106,12 @@ func runTest(t *testing.T, pkgNames []string, javaPkg, javaCls string) {
|
||||
}
|
||||
}
|
||||
|
||||
cmd := []string{"gomobile", "bind", "-o", "pkg.aar"}
|
||||
args := []string{"bind", "-tags", "aaa bbb", "-o", "pkg.aar"}
|
||||
if javaPkg != "" {
|
||||
cmd = append(cmd, "-javapkg", javaPkg)
|
||||
args = append(args, "-javapkg", javaPkg)
|
||||
}
|
||||
cmd = append(cmd, pkgNames...)
|
||||
buf, err := run(strings.Join(cmd, " "))
|
||||
args = append(args, pkgNames...)
|
||||
buf, err := exec.Command("gomobile", args...).CombinedOutput()
|
||||
if err != nil {
|
||||
t.Logf("%s", buf)
|
||||
t.Fatalf("failed to run gomobile bind: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user