diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2009-02-06 16:32:11 +0000 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2009-02-06 16:32:11 +0000 |
commit | 4c7803f58dd4c9c67a1b12bf12e81a3c99072480 (patch) | |
tree | 61714ff5dcd03c22284cea7de03f884cfcfed3ed /org.rtems.cdt | |
parent | Removed. (diff) | |
download | rtems-eclipse-plug-in-4c7803f58dd4c9c67a1b12bf12e81a3c99072480.tar.bz2 |
Improved error messages.
Diffstat (limited to 'org.rtems.cdt')
-rw-r--r-- | org.rtems.cdt/src/org/rtems/cdt/Storage.java | 44 |
1 files changed, 35 insertions, 9 deletions
diff --git a/org.rtems.cdt/src/org/rtems/cdt/Storage.java b/org.rtems.cdt/src/org/rtems/cdt/Storage.java index 93078c5..c167177 100644 --- a/org.rtems.cdt/src/org/rtems/cdt/Storage.java +++ b/org.rtems.cdt/src/org/rtems/cdt/Storage.java @@ -152,8 +152,16 @@ public class Storage { return path; } + public static String getPlatform( IProject project) { + return getPristineProperty( project, Constants.PLATFORM_KEY); + } + + public static void setPlatform( IProject project, String platform) { + setProperty( project, Constants.PLATFORM_KEY, platform); + } + public static void clearPlatform( IProject project) { - setProperty( project, Constants.PLATFORM_KEY, null); + setPlatform( project, null); // Delete discovered paths for all configurations of the project for (IConfiguration cfg : getConfigurations( project)) { @@ -164,10 +172,6 @@ public class Storage { } } - public static String getPlatform( IProject project) { - return getPristineProperty( project, Constants.PLATFORM_KEY); - } - public static void changePlatform( IProject project, String newPlatform) { String platform = getPlatform( project); @@ -178,7 +182,7 @@ public class Storage { } // Set new platform - setProperty( project, Constants.PLATFORM_KEY, newPlatform); + setPlatform( project, newPlatform); // Update path prepends String path = null; @@ -201,6 +205,7 @@ public class Storage { String bspPath = getProperty( project, Constants.BSP_PATH_KEY); IPath make = new Path( "make"); List<String> options = new LinkedList<String>(); + boolean error = false; // Set tools to default values updateTool( project, Constants.TOOL_ARCHIVER_KEY, "ar", options); @@ -237,23 +242,36 @@ public class Storage { path = Storage.prependToPath( path, part); env.put( Constants.PATH_VARIABLE_NAME, path); - // On windows we have to search for the make program in the new path environment + // On Windows we have to search for the make program in the new path environment if (Platform.getOS().equals( Platform.OS_WIN32)) { String parts [] = path.split( Constants.PATH_SEPARATOR); + boolean found = false; + for (String p : parts) { IPath makeCandidate = new Path( p).append( "make.exe"); File file = new File( makeCandidate.toOSString()); + if (file.exists()) { make = makeCandidate; + found = true; break; } } + + if (!found) { + createMarker( + project, + Constants.MARKER_ID_TOOL_DISCOVERY, + "make program not found, check your Cygwin or MinGW settings in the RTEMS preferences" + ); + } } // Set command line + String makeArgument = Constants.BSP_PATH_MAKE_VARIABLE + "=" + bspPath; pb.command( make.toOSString(), - Constants.BSP_PATH_MAKE_VARIABLE + "=" + bspPath + makeArgument ); // Start make process and parse its output @@ -306,6 +324,7 @@ public class Storage { updateTool( project, key, command, options); } } catch (IOException e) { + error = true; createMarker( project, Constants.MARKER_ID_TOOL_DISCOVERY, @@ -324,12 +343,19 @@ public class Storage { // Check exit status if (p.exitValue() != 0) { + error = true; createMarker( project, Constants.MARKER_ID_TOOL_DISCOVERY, - "make invokation `" + make.toOSString() + "' returned with error status " + p.exitValue() + "make invokation `" + make.toOSString() + " " + makeArgument + "' returned with error status " + p.exitValue() ); } + + // Check error + if (error) { + // Clear platform to trigger an update again if someone changed a preference or property value + setPlatform( project, null); + } } private static void updateTool( IProject project, String toolKey, String command, List<String> options) { |