diff options
author | Deepanshu Gupta <deepanshu@google.com> | 2015-05-20 11:28:50 -0700 |
---|---|---|
committer | Deepanshu Gupta <deepanshu@google.com> | 2015-05-20 11:28:50 -0700 |
commit | 612a05e7e15184b21437731b9aa5db2d1d4fc54c (patch) | |
tree | 2b689eccd70f7bdedc4b0069e8b62b20e0b71e51 /tools | |
parent | f8ea750455eec81e4e6d877b3e18e29a86d4ec95 (diff) | |
download | frameworks_base-612a05e7e15184b21437731b9aa5db2d1d4fc54c.zip frameworks_base-612a05e7e15184b21437731b9aa5db2d1d4fc54c.tar.gz frameworks_base-612a05e7e15184b21437731b9aa5db2d1d4fc54c.tar.bz2 |
Update platformDir search in tests.
When trying to find the SDK Platform Dir for LayoutLib tests, also
test if the dir from which the tests are run is module dir.
Change-Id: Id5c6038d07ebbb122e38f907ad488ed1f2bcde32
Diffstat (limited to 'tools')
-rw-r--r-- | tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/Main.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/Main.java b/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/Main.java index 91be0bd..63115e4 100644 --- a/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/Main.java +++ b/tools/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/Main.java @@ -124,9 +124,14 @@ public class Main { if (platformDir != null) { return platformDir; } - // Test if workingDir is platform/frameworks/base/tools/layoutlib. That is, root should be - // workingDir/../../../../ (4 levels up) + + // Test if workingDir is platform/frameworks/base/tools/layoutlib/bridge. File currentDir = workingDir; + if (currentDir.getName().equalsIgnoreCase("bridge")) { + currentDir = currentDir.getParentFile(); + } + // Test if currentDir is platform/frameworks/base/tools/layoutlib. That is, root should be + // workingDir/../../../../ (4 levels up) for (int i = 0; i < 4; i++) { if (currentDir != null) { currentDir = currentDir.getParentFile(); |