Update platform.dir search in tests.

The tests search for a built sdk using some heuristics. The default path
of the built sdk has changed now, and this updates the search
accordingly.

Change-Id: I36d465d8c5f6cfd971bbdf95878fb144de233c6c
This commit is contained in:
Deepanshu Gupta
2015-01-07 12:21:59 -08:00
parent f61bc8a262
commit 0359b4b199

View File

@@ -162,11 +162,27 @@ public class Main {
if (!out.isDirectory()) {
return null;
}
File sdkDir = new File(out, "sdk" + File.separator + "sdk");
File sdkDir = new File(out, "sdk");
if (!sdkDir.isDirectory()) {
// The directory we thought that should contain the sdk is not a directory.
return null;
}
File[] sdkDirs = sdkDir.listFiles(new FileFilter() {
@Override
public boolean accept(File path) {
// We need to search for $TARGET_PRODUCT (usually, sdk_phone_armv7)
return path.isDirectory() && path.getName().startsWith("sdk");
}
});
for (File dir : sdkDirs) {
String platformDir = getPlatformDirFromHostOutSdkSdk(dir);
if (platformDir != null) {
return platformDir;
}
}
return null;
}
private static String getPlatformDirFromHostOutSdkSdk(File sdkDir) {
File[] possibleSdks = sdkDir.listFiles(new FileFilter() {
@Override
public boolean accept(File path) {