diff options
author | Ankit Jain <radical@corewars.org> | 2009-09-24 23:04:36 +0400 |
---|---|---|
committer | Ankit Jain <radical@corewars.org> | 2009-09-24 23:04:36 +0400 |
commit | fd672808f87d15127e0d0f7a6ec51c52a3e5633e (patch) | |
tree | dcceac139873ba258ea4c16775fcfa88bd2abc31 /mcs/tools | |
parent | f237da9659d5bdf487f648899fa8301f15b536ac (diff) |
* Parameters.cs (ParseArguments): If no project file is specified,
then look for a .sln or *proj file in the current directory.
svn path=/trunk/mcs/; revision=142595
Diffstat (limited to 'mcs/tools')
-rw-r--r-- | mcs/tools/xbuild/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/tools/xbuild/Parameters.cs | 19 |
2 files changed, 20 insertions, 4 deletions
diff --git a/mcs/tools/xbuild/ChangeLog b/mcs/tools/xbuild/ChangeLog index 1b0818d9b98..8a1df53eb33 100644 --- a/mcs/tools/xbuild/ChangeLog +++ b/mcs/tools/xbuild/ChangeLog @@ -1,5 +1,10 @@ 2009-09-24 Ankit Jain <jankit@novell.com> + * Parameters.cs (ParseArguments): If no project file is specified, + then look for a .sln or *proj file in the current directory. + +2009-09-24 Ankit Jain <jankit@novell.com> + * Makefile: Create dir for WebApplication.targets . * Microsoft.Common.targets (_ValidateEssentialProperties): New. (BuildDependsOn): Add _ValidateEssentialProperties, temporary. diff --git a/mcs/tools/xbuild/Parameters.cs b/mcs/tools/xbuild/Parameters.cs index 3596bd94544..1f36902f43d 100644 --- a/mcs/tools/xbuild/Parameters.cs +++ b/mcs/tools/xbuild/Parameters.cs @@ -104,11 +104,22 @@ namespace Mono.XBuild.CommandLine { remainingArguments.Add (s); } if (remainingArguments.Count == 0) { - string[] files = Directory.GetFiles (Directory.GetCurrentDirectory (), "*.??proj"); - if (files.Length > 0) - projectFile = files [0]; + string[] sln_files = Directory.GetFiles (Directory.GetCurrentDirectory (), "*.sln"); + string[] proj_files = Directory.GetFiles (Directory.GetCurrentDirectory (), "*proj"); + + if (sln_files.Length == 0 && proj_files.Length == 0) + ErrorUtilities.ReportError (3, "Please specify the project or solution file " + + "to build, as none was found in the current directory."); + + if (sln_files.Length + proj_files.Length > 1) + ErrorUtilities.ReportError (5, "Please specify the project or solution file " + + "to build, as more than one solution or project file was found " + + "in the current directory"); + + if (sln_files.Length == 1) + projectFile = sln_files [0]; else - ErrorUtilities.ReportError (3, "No .proj file specified and no found in current directory."); + projectFile = proj_files [0]; } else if (remainingArguments.Count == 1) { projectFile = (string) remainingArguments [0]; } else { |