// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#if NET_2_0
+
using System;
using System.IO;
using System.Collections;
string responseFile;
- public Parameters (MainClass mc)
+ public Parameters (string binPath)
{
consoleLoggerParameters = "";
displayHelp = false;
properties = new BuildPropertyGroup ();
targets = new string [0];
- responseFile = Path.Combine (mc.BinPath, "xbuild.rsp");
+ responseFile = Path.Combine (binPath, "xbuild.rsp");
}
public void ParseArguments (string[] args)
}
string responseFilename = Path.GetFullPath (s.Substring (1));
if (responseFiles.ContainsKey (responseFilename))
- throw new CommandLineException ("We already have " + responseFilename + "file.", 0001);
+ ErrorUtilities.ReportError (1, String.Format ("We already have {0} file.", responseFilename));
responseFiles [responseFilename] = responseFilename;
LoadResponseFile (responseFilename);
}
if (files.Length > 0)
projectFile = files [0];
else
- throw new CommandLineException ("No .proj file specified and no found in current directory.", 0003);
+ ErrorUtilities.ReportError (3, "No .proj file specified and no found in current directory.");
} else if (remainingArguments.Count == 1) {
projectFile = (string) remainingArguments [0];
} else {
- throw new CommandLineException ("Too many project files specified.", 0004);
+ ErrorUtilities.ReportError (4, "Too many project files specified");
}
}
- private void LoadResponseFile (string filename)
+ void LoadResponseFile (string filename)
{
StreamReader sr = null;
string line;
sb.Length = 0;
}
}
- } catch (Exception ex) {
- throw new CommandLineException ("Error during loading response file.", ex, 0002);
- } finally {
+ } catch (Exception) {
+ // FIXME: we lose exception message
+ ErrorUtilities.ReportError (2, "Error during loading response file.");
+ } finally {
if (sr != null)
sr.Close ();
}
case "/help":
case "/h":
case "/?":
- throw new CommandLineException ("Show usage", 0006);
+ ErrorUtilities.ShowUsage ();
+ break;
case "/nologo":
noLogo = true;
break;
case "/version":
case "/ver":
- throw new CommandLineException ("Show version", 0005);
+ ErrorUtilities.ShowVersion (true);
+ break;
case "/noconsolelogger":
case "/noconlog":
noConsoleLogger = true;
splittedProperties = parameter [1].Split (';');
foreach (string st in splittedProperties) {
property = st.Split ('=');
- properties.AddNewProperty (property [0], property [1]);
+ properties.SetProperty (property [0], property [1]);
}
}
}
}
-}
\ No newline at end of file
+}
+
+#endif