Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs/tools
diff options
context:
space:
mode:
authorAnkit Jain <radical@corewars.org>2010-02-20 21:45:13 +0300
committerAnkit Jain <radical@corewars.org>2010-02-20 21:45:13 +0300
commit2b1392c364b13df220c66f8d48eaf5391a8f48cd (patch)
tree37a68cd7e2501ebc661ade0c2ded0b54081ae22a /mcs/tools
parentbc369663dfe84e49dee955f984f206b464299e18 (diff)
Update xbuild and Microsoft.Build.* from trunk.
In tools/xbuild: 2010-02-19 Ankit Jain <jankit@novell.com> * SolutionParser.cs (GetAllProjectFileNames): New. * Parameters.cs (ParseArguments): When no project file is specified, if the cur dir has a single sln and >1 project files, and all the project files are referenced by the sln, the pick the sln. In class/Microsoft.Build.Tasks/Microsoft.Build.Tasks: 2010-02-10 Ankit Jain <jankit@novell.com> * GenerateResource.cs (CompileResourceFile): Check File.Exists for source file. Don't build if the target is newer than the source file. (Execute): Continue building all the resources, even if there are failures for some files. 2010-02-10 Ankit Jain <jankit@novell.com> Fix bug #558739. * GenerateResource (Resgen): New. Internal task to run resgen with MONO_IOMAP=drive . (Execute): Use the new Resgen task to compile the resources. In class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine: 2010-02-19 Ankit Jain <jankit@novell.com> * ImportTest.cs (TestMissingImport*): Add new tests for missing import projects. 2010-02-11 Ankit Jain <jankit@novell.com> * ImportTest.cs (Add1): Fix test on windows. In class/Microsoft.Build.Engine/Test/various: 2010-02-19 Ankit Jain <jankit@novell.com> * Items.cs (TestItemsWithWildcards): Check for RecursiveDir metadata also. In class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine: 2010-02-19 Ankit Jain <jankit@novell.com> * BuildItem.cs: Track api changes. (SetMetadata): Allow RecursiveDir to be set, this is set by DirectoryScanner. * DirectoryScanner.cs (ProcessInclude): Set RecursiveDir metadata. 2010-02-19 Ankit Jain <jankit@novell.com> * Import.cs (Evaluate): Add param @ignoreMissingImports. * Project.cs (Load*): Add overloads with param @projectLoadSettings. (Log*): Mark internal. * ProjectLoadSettings.cs: New. In class/Microsoft.Build.Engine: 2010-02-19 Ankit Jain <jankit@novell.com> * Microsoft.Build.Engine.dll.sources: Add ProjectLoadSettings.cs . In class/Microsoft.Build.Utilities: 2010-02-10 Ankit Jain <jankit@novell.com> * Microsoft.Build.Utilities.dll.sources: Add ProcessStringDictionary.cs from class/System/System.Collections.Specialized . This is required as the StringDictionary in ToolTask, used for EnvironmentOverrides, is inadequate, because environment vars are case sensitive on unix. In class/Microsoft.Build.Utilities/Mono.XBuild.Utilities: 2010-02-19 Ankit Jain <jankit@novell.com> * ReservedNameUtils.cs (GetReservedMetadata): Add dictionary param @metadata. Use this to check for existing value of "RecursiveDir" metadata, use that if present. In class/Microsoft.Build.Utilities/Microsoft.Build.Utilities: 2010-02-19 Ankit Jain <jankit@novell.com> * TaskItem.cs: Track api changes. 2010-02-10 Ankit Jain <jankit@novell.com> * ProcessService.cs (globalEnvironmentVariablesOverride): Use ProcessStringDictionary instead of StringDictionary. ProcessStringDictionary retains the case of the keys (env vars here). * ToolTask.cs (environmentOverride): Likewise. 2010-02-10 Ankit Jain <jankit@novell.com> * ToolTask.cs (ExecuteTool): Use the virtual method Standard*LoggingImportance, instead of the underlying field. (LogEventsFromTextOutput): Use @importance argument for LogMessage. (LogToolCommand): Remove MonoTODO. svn path=/branches/mono-2-6/mcs/; revision=152128
Diffstat (limited to 'mcs/tools')
-rw-r--r--mcs/tools/xbuild/ChangeLog7
-rw-r--r--mcs/tools/xbuild/Parameters.cs15
-rw-r--r--mcs/tools/xbuild/SolutionParser.cs17
3 files changed, 39 insertions, 0 deletions
diff --git a/mcs/tools/xbuild/ChangeLog b/mcs/tools/xbuild/ChangeLog
index 48649b73c56..6368ff69d32 100644
--- a/mcs/tools/xbuild/ChangeLog
+++ b/mcs/tools/xbuild/ChangeLog
@@ -1,3 +1,10 @@
+2010-02-19 Ankit Jain <jankit@novell.com>
+
+ * SolutionParser.cs (GetAllProjectFileNames): New.
+ * Parameters.cs (ParseArguments): When no project file is specified,
+ if the cur dir has a single sln and >1 project files, and all the
+ project files are referenced by the sln, the pick the sln.
+
2010-02-06 Ankit Jain <jankit@novell.com>
* xbuild/Microsoft.Common.targets: Add targets for compiling
diff --git a/mcs/tools/xbuild/Parameters.cs b/mcs/tools/xbuild/Parameters.cs
index f5d413c0485..449625bc1ae 100644
--- a/mcs/tools/xbuild/Parameters.cs
+++ b/mcs/tools/xbuild/Parameters.cs
@@ -30,6 +30,8 @@
using System;
using System.IO;
using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
using System.Text;
using System.Reflection;
using Microsoft.Build.BuildEngine;
@@ -111,6 +113,19 @@ namespace Mono.XBuild.CommandLine {
ReportError (3, "Please specify the project or solution file " +
"to build, as none was found in the current directory.");
+ if (sln_files.Length == 1 && proj_files.Length > 0) {
+ var projects_table = new Dictionary<string, string> ();
+ foreach (string pfile in SolutionParser.GetAllProjectFileNames (sln_files [0])) {
+ string full_path = Path.GetFullPath (pfile);
+ projects_table [full_path] = full_path;
+ }
+
+ if (!proj_files.Any (p => !projects_table.ContainsKey (Path.GetFullPath (p))))
+ // if all the project files in the cur dir, are referenced
+ // from the single .sln in the cur dir, then pick the sln
+ proj_files = new string [0];
+ }
+
if (sln_files.Length + proj_files.Length > 1)
ReportError (5, "Please specify the project or solution file " +
"to build, as more than one solution or project file was found " +
diff --git a/mcs/tools/xbuild/SolutionParser.cs b/mcs/tools/xbuild/SolutionParser.cs
index a9fecfd74ce..9ebff1e0a72 100644
--- a/mcs/tools/xbuild/SolutionParser.cs
+++ b/mcs/tools/xbuild/SolutionParser.cs
@@ -885,6 +885,23 @@ namespace Mono.XBuild.CommandLine {
return levels [index];
}
+
+ public static IEnumerable<string> GetAllProjectFileNames (string solutionFile)
+ {
+ StreamReader reader = new StreamReader (solutionFile);
+ string line = reader.ReadToEnd ();
+ line = line.Replace ("\r\n", "\n");
+ string soln_dir = Path.GetDirectoryName (solutionFile);
+
+ Match m = projectRegex.Match (line);
+ while (m.Success) {
+ if (String.Compare (m.Groups [1].Value, solutionFolderGuid,
+ StringComparison.InvariantCultureIgnoreCase) != 0)
+ yield return Path.Combine (soln_dir, m.Groups [3].Value).Replace ("\\", "/");
+
+ m = m.NextMatch ();
+ }
+ }
}
}