+2009-03-19 Ankit Jain <jankit@novell.com>
+
+ Fix bug #484773.
+ * Main.cs (Execute): Check whether the project file exists or not.
+ * Parameters.cs (ParseArguments): Handle absolute paths too.
+
2009-03-13 Ankit Jain <jankit@novell.com>
* Main.cs (Execute): Build the project/sln with current directory set to
}
string projectFile = parameters.ProjectFile;
+ if (!File.Exists (projectFile)) {
+ ErrorUtilities.ReportError (0, String.Format ("Project file '{0}' not found.", projectFile));
+ return;
+ }
+
if (projectFile.EndsWith (".sln"))
projectFile = GenerateSolutionProject (projectFile);
project.Load (projectFile);
string oldCurrentDirectory = Environment.CurrentDirectory;
- Directory.SetCurrentDirectory (Path.GetDirectoryName (projectFile));
+ string dir = Path.GetDirectoryName (projectFile);
+ if (!String.IsNullOrEmpty (dir))
+ Directory.SetCurrentDirectory (dir);
result = engine.BuildProject (project, parameters.Targets, null);
Directory.SetCurrentDirectory (oldCurrentDirectory);
}
LoadResponseFile (responseFile);
}
foreach (string s in flatArguments) {
- if (s [0] == '/') {
- ParseFlatArgument (s);
- } else
+ if (s [0] != '/' || !ParseFlatArgument (s))
remainingArguments.Add (s);
}
if (remainingArguments.Count == 0) {
}
}
- private void ParseFlatArgument (string s)
+ private bool ParseFlatArgument (string s)
{
switch (s) {
case "/help":
default:
if (s.StartsWith ("/target:") || s.StartsWith ("/t:")) {
ProcessTarget (s);
- }
- if (s.StartsWith ("/property:") || s.StartsWith ("/p:")) {
+ } else if (s.StartsWith ("/property:") || s.StartsWith ("/p:")) {
ProcessProperty (s);
- }
- if (s.StartsWith ("/logger:") || s.StartsWith ("/l:")) {
+ } else if (s.StartsWith ("/logger:") || s.StartsWith ("/l:")) {
ProcessLogger (s);
- }
- if (s.StartsWith ("/verbosity:") || s.StartsWith ("/v:")) {
+ } else if (s.StartsWith ("/verbosity:") || s.StartsWith ("/v:")) {
ProcessVerbosity (s);
- }
- if (s.StartsWith ("/consoleloggerparameters:") || s.StartsWith ("/clp:")) {
+ } else if (s.StartsWith ("/consoleloggerparameters:") || s.StartsWith ("/clp:")) {
ProcessConsoleLoggerParameters (s);
- }
- if (s.StartsWith ("/validate:") || s.StartsWith ("/val:")) {
+ } else if (s.StartsWith ("/validate:") || s.StartsWith ("/val:")) {
ProcessValidate (s);
- }
+ } else
+ return false;
break;
}
+
+ return true;
}
internal void ProcessTarget (string s)