Revision: 284
Author:
e...@google.com
Date: Mon Dec 3 12:06:44 2012
Log: Make it possible to run tests that use MockWebServer from within
libcore/.
Previously you had to be in the root of an Android tree because we were
using pathnames relative to the current directory.
http://code.google.com/p/vogar/source/detail?r=284
Modified:
/trunk/src/vogar/android/AndroidSdk.java
=======================================
--- /trunk/src/vogar/android/AndroidSdk.java Mon Jul 9 13:11:14 2012
+++ /trunk/src/vogar/android/AndroidSdk.java Mon Dec 3 12:06:44 2012
@@ -150,8 +150,9 @@
}
public static Collection<File> defaultSourcePath() {
- File supportSrc = new File("libcore/support/src/test/java");
- File mockWebServerSrc = new
File("external/mockwebserver/src/main/java/");
+ String buildRoot = System.getenv("ANDROID_BUILD_TOP");
+ File supportSrc = new
File(buildRoot, "libcore/support/src/test/java");
+ File mockWebServerSrc = new
File(buildRoot, "external/mockwebserver/src/main/java/");
ArrayList<File> sourcePath = new ArrayList<File>();
if (supportSrc.exists()) {
sourcePath.add(supportSrc);