Skip to content

Commit 00574c8

Browse files
HannesWelltrancexpress
authored andcommitted
Search for executable at old locations too in pde.build.tests
Follow-up on - eclipse-pde#1841
1 parent 33a9a74 commit 00574c8

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

  • build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests

build/org.eclipse.pde.build.tests/src/org/eclipse/pde/build/internal/tests/Utils.java

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -383,18 +383,29 @@ public static File findExecutable() throws IOException {
383383
}
384384
}
385385
}
386-
386+
if (Platform.OS_MACOSX.equals(Platform.getOS())) {
387+
// After https://bugs.eclipse.org/431116 and related changes, the install
388+
// location on the Mac
389+
// moved down two directories (from <folder-containing-Eclipse.app> to
390+
// Eclipse.app/Contents/Eclipse).
391+
baseLocation = baseLocation.getParentFile().getParentFile();
392+
}
393+
File fallback1 = new File(baseLocation.getParentFile(), "deltapack/eclipse");
394+
executableLocation = findExecutable(fallback1);
395+
if (executableLocation != null) {
396+
return executableLocation;
397+
}
387398
if (Platform.OS.isMac()) {
388399
// After https://bugs.eclipse.org/431116 and related changes, the install
389400
// location on the Mac
390401
// moved down two directories (from <folder-containing-Eclipse.app> to
391402
// Eclipse.app/Contents/Eclipse).
392-
baseLocation = baseLocation.getParentFile().getParentFile().getParentFile();
403+
baseLocation = baseLocation.getParentFile();
393404
}
394-
File fallback = new File(baseLocation.getParentFile().getParentFile(), "deltapack/eclipse");
395-
executableLocation = findExecutable(fallback);
396-
assertNotNull("All attempts to find the executable failed including fallback to " + fallback.getAbsolutePath(),
397-
executableLocation);
405+
File fallback2 = new File(baseLocation.getParentFile().getParentFile(), "deltapack/eclipse");
406+
executableLocation = findExecutable(fallback2);
407+
assertNotNull("All attempts to find the executable failed including fallback to " + fallback1.getAbsolutePath()
408+
+ " or to " + fallback2.getAbsolutePath(), executableLocation);
398409
return executableLocation;
399410
}
400411

0 commit comments

Comments
 (0)