[vogar] r297 committed - Use adb to find the Android SDK.

13 views
Skip to first unread message

vo...@googlecode.com

unread,
Mar 1, 2014, 10:32:28 AM3/1/14
to voga...@googlegroups.com
Revision: 297
Author: limpbizkit
Date: Sat Mar 1 15:31:54 2014 UTC
Log: Use adb to find the Android SDK.
http://code.google.com/p/vogar/source/detail?r=297

Modified:
/trunk/src/vogar/android/AndroidSdk.java

=======================================
--- /trunk/src/vogar/android/AndroidSdk.java Wed May 1 01:01:18 2013 UTC
+++ /trunk/src/vogar/android/AndroidSdk.java Sat Mar 1 15:31:54 2014 UTC
@@ -85,12 +85,12 @@
this.mkdir = mkdir;
this.deviceFilesystem = new DeviceFilesystem(log, "adb", "shell");

- List<String> path = new Command(log, "which", "dx").execute();
+ List<String> path = new Command(log, "which", "adb").execute();
if (path.isEmpty()) {
- throw new RuntimeException("dx not found");
+ throw new RuntimeException("adb not found");
}
- File dx = new File(path.get(0)).getAbsoluteFile();
- String parentFileName = dx.getParentFile().getName();
+ File adb = new File(path.get(0)).getAbsoluteFile();
+ String parentFileName = adb.getParentFile().getName();

/*
* We probably get aapt/adb/dx from either a copy of the Android
SDK or a copy
@@ -111,13 +111,13 @@
*/

if ("platform-tools".equals(parentFileName)) {
- File sdkRoot = dx.getParentFile().getParentFile();
+ File sdkRoot = adb.getParentFile().getParentFile();
File newestPlatform = getNewestPlatform(sdkRoot);
log.verbose("using android platform: " + newestPlatform);
androidClasses = new File[] { new
File(newestPlatform, "android.jar") };
log.verbose("using android sdk: " + sdkRoot);
} else if ("bin".equals(parentFileName)) {
- File sourceRoot = dx.getParentFile().getParentFile()
+ File sourceRoot = adb.getParentFile().getParentFile()
.getParentFile().getParentFile().getParentFile();
log.verbose("using android build tree: " + sourceRoot);

@@ -132,7 +132,7 @@
androidClasses[i] = new File(sourceRoot,
String.format(pattern, jar));
}
} else {
- throw new RuntimeException("Couldn't derive Android home
from " + dx);
+ throw new RuntimeException("Couldn't derive Android home
from " + adb);
}
}

Reply all
Reply to author
Forward
0 new messages