Browse Source

Fixed bug that caused path to code analysis targets to be escaped twice.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5038 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 16 years ago
parent
commit
7661924579
  1. 2
      src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs
  2. 26
      src/Main/Base/Project/Src/Project/MSBuildEngine/MSBuildEngine.cs

2
src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs

@ -1084,8 +1084,6 @@ namespace ICSharpCode.SharpDevelop.Project @@ -1084,8 +1084,6 @@ namespace ICSharpCode.SharpDevelop.Project
object item = codon.BuildItem(null, new System.Collections.ArrayList());
if (item != null) {
string text = item.ToString();
if (!codon.Properties.Get("text", "").Contains("$("))
text = MSBuildInternals.Escape(text);
globalProperties[codon.Id] = text;
}
}

26
src/Main/Base/Project/Src/Project/MSBuildEngine/MSBuildEngine.cs

@ -44,10 +44,18 @@ namespace ICSharpCode.SharpDevelop.Project @@ -44,10 +44,18 @@ namespace ICSharpCode.SharpDevelop.Project
/// <summary>
/// Gets a list where addins can add additional properties for use in MSBuild.
/// You can add items to this dictionary by putting strings into
/// "/SharpDevelop/MSBuildEngine/AdditionalProperties".
/// </summary>
public static readonly IDictionary<string, string> MSBuildProperties;
/// <remarks>
/// Please use the AddIn Tree path "/SharpDevelop/MSBuildEngine/AdditionalProperties"
/// instead of this list.
/// </remarks>
public static readonly IDictionary<string, string> MSBuildProperties = new SortedList<string, string> {
{ "SharpDevelopBinPath", SharpDevelopBinPath },
// 'BuildingInsideVisualStudio' tells MSBuild that we took care of building a project's dependencies
// before trying to build the project itself. This speeds up compilation because it prevents MSBuild from
// repeatedly looking if a project needs to be rebuilt.
{ "BuildingInsideVisualStudio", "true" }
};
/// <summary>
/// Gets a list of additional target files that are automatically loaded into all projects.
@ -77,16 +85,8 @@ namespace ICSharpCode.SharpDevelop.Project @@ -77,16 +85,8 @@ namespace ICSharpCode.SharpDevelop.Project
);
AdditionalTargetFiles = AddInTree.BuildItems<string>(AdditionalTargetFilesPath, null, false);
AdditionalMSBuildLoggers = AddInTree.BuildItems<IMSBuildAdditionalLogger>(AdditionalLoggersPath, null, false);
MSBuildProperties = new SortedList<string, string>();
MSBuildProperties.Add("SharpDevelopBinPath", SharpDevelopBinPath);
// 'BuildingInsideVisualStudio' tells MSBuild that we took care of building a project's dependencies
// before trying to build the project itself. This speeds up compilation because it prevents MSBuild from
// repeatedly looking if a project needs to be rebuilt.
MSBuildProperties.Add("BuildingInsideVisualStudio", "true");
}
public static void StartBuild(IProject project, ThreadSafeServiceContainer serviceContainer, ProjectBuildOptions options, IBuildFeedbackSink feedbackSink, IEnumerable<string> additionalTargetFiles)
{
if (project == null)
@ -186,6 +186,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -186,6 +186,7 @@ namespace ICSharpCode.SharpDevelop.Project
globalProperties["SolutionPath"] = solution.FileName;
foreach (KeyValuePair<string, string> pair in options.Properties) {
LoggingService.Debug("Setting property " + pair.Key + " to '" + pair.Value + "'");
globalProperties[pair.Key] = pair.Value;
}
globalProperties["Configuration"] = options.Configuration;
@ -244,7 +245,8 @@ namespace ICSharpCode.SharpDevelop.Project @@ -244,7 +245,8 @@ namespace ICSharpCode.SharpDevelop.Project
// because we'll replace the hijackedProperty, manually write the corresponding include
if (globalProperties.ContainsKey(hijackedProperty)) {
// we need to escape the project name because properties passed to MSBuild will not be evaluated
// global properties passed to MSBuild are not be evaluated (and are not escaped),
// so we need to escape them for writing them into an MSBuild file
w.WriteStartElement("Import", xmlNamespace);
w.WriteAttributeString("Project", MSBuildInternals.Escape(globalProperties[hijackedProperty]));
w.WriteEndElement();

Loading…
Cancel
Save