# HG changeset patch # User Doug Simon # Date 1365592901 -7200 # Node ID 096725f4da58a94b6e116adfc241f6597a55f255 # Parent 6c4ac1a8cd206fd1fd6147a4208b0def43fb540f the -e option to the eclipseformat can now also accept an Eclipse installation directory diff -r 6c4ac1a8cd20 -r 096725f4da58 mxtool/mx.py --- a/mxtool/mx.py Wed Apr 10 11:26:50 2013 +0200 +++ b/mxtool/mx.py Wed Apr 10 13:21:41 2013 +0200 @@ -1561,6 +1561,13 @@ args.eclipse_exe = os.environ.get('ECLIPSE_EXE') if args.eclipse_exe is None: abort('Could not find Eclipse executable. Use -e option or ensure ECLIPSE_EXE environment variable is set.') + + # Maybe an Eclipse installation dir was specified - look for the executable in it + if join(args.eclipse_exe, exe_suffix('eclipse')): + args.eclipse_exe = join(args.eclipse_exe, exe_suffix('eclipse')) + + if not os.path.isfile(args.eclipse_exe) or not os.access(args.eclipse_exe, os.X_OK): + abort('Not an executable file: ' + args.eclipse_exe) eclipseinit([], buildProcessorJars=False)