aboutsummaryrefslogtreecommitdiffstats
path: root/mobile/android_test.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-01-05 18:39:24 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-01-24 16:54:13 +0800
commit1bf508b449ebd42653f521ada92c782e8cb664d2 (patch)
tree1895aeb44d68b189a40a4023ca4869b1f3d1b955 /mobile/android_test.go
parent02aeb3d76652a4c0451e5c3734e6881aefe46249 (diff)
downloaddexon-1bf508b449ebd42653f521ada92c782e8cb664d2.tar
dexon-1bf508b449ebd42653f521ada92c782e8cb664d2.tar.gz
dexon-1bf508b449ebd42653f521ada92c782e8cb664d2.tar.bz2
dexon-1bf508b449ebd42653f521ada92c782e8cb664d2.tar.lz
dexon-1bf508b449ebd42653f521ada92c782e8cb664d2.tar.xz
dexon-1bf508b449ebd42653f521ada92c782e8cb664d2.tar.zst
dexon-1bf508b449ebd42653f521ada92c782e8cb664d2.zip
accounts/abi/bind: support event filtering in abigen
Diffstat (limited to 'mobile/android_test.go')
-rw-r--r--mobile/android_test.go15
1 files changed, 10 insertions, 5 deletions
diff --git a/mobile/android_test.go b/mobile/android_test.go
index 345e009b4..3d3bd66d0 100644
--- a/mobile/android_test.go
+++ b/mobile/android_test.go
@@ -72,7 +72,7 @@ public class AndroidTest extends InstrumentationTestCase {
Transaction tx = new Transaction(
1, new Address("0x0000000000000000000000000000000000000000"),
- new BigInt(0), new BigInt(0), new BigInt(1), null); // Random empty transaction
+ new BigInt(0), 0, new BigInt(1), null); // Random empty transaction
BigInt chain = new BigInt(1); // Chain identifier of the main net
// Sign a transaction with a single authorization
@@ -164,12 +164,17 @@ func TestAndroid(t *testing.T) {
t.Skip("command gradle not found, skipping")
}
if sdk := os.Getenv("ANDROID_HOME"); sdk == "" {
- t.Skip("ANDROID_HOME environment var not set, skipping")
+ // Android SDK not explicitly given, try to auto-resolve
+ autopath := filepath.Join(os.Getenv("HOME"), "Android", "Sdk")
+ if _, err := os.Stat(autopath); err != nil {
+ t.Skip("ANDROID_HOME environment var not set, skipping")
+ }
+ os.Setenv("ANDROID_HOME", autopath)
}
if _, err := exec.Command("which", "gomobile").CombinedOutput(); err != nil {
t.Log("gomobile missing, installing it...")
- if _, err := exec.Command("go", "install", "golang.org/x/mobile/cmd/gomobile").CombinedOutput(); err != nil {
- t.Fatalf("install failed: %v", err)
+ if out, err := exec.Command("go", "get", "golang.org/x/mobile/cmd/gomobile").CombinedOutput(); err != nil {
+ t.Fatalf("install failed: %v\n%s", err, string(out))
}
t.Log("initializing gomobile...")
start := time.Now()
@@ -239,7 +244,7 @@ const gradleConfig = `buildscript {
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:1.5.0'
+ classpath 'com.android.tools.build:gradle:2.2.3'
}
}
allprojects {