Browse Source

Removed the ToolPath's Condition check from new WiX Projects (.wixproj).

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.1@2293 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Matt Ward 19 years ago
parent
commit
39cb494584
  1. 2
      src/AddIns/BackendBindings/WixBinding/Project/Src/Project/WixProject.cs
  2. 40
      src/AddIns/BackendBindings/WixBinding/Test/Project/CreateNewWixProjectObjectTestFixture.cs

2
src/AddIns/BackendBindings/WixBinding/Project/Src/Project/WixProject.cs

@ -239,7 +239,7 @@ namespace ICSharpCode.WixBinding
string wixToolPath = @"$(SharpDevelopBinPath)\Tools\Wix"; string wixToolPath = @"$(SharpDevelopBinPath)\Tools\Wix";
AddGuardedProperty("WixToolPath", wixToolPath, false); AddGuardedProperty("WixToolPath", wixToolPath, false);
AddGuardedProperty("ToolPath", "$(WixToolPath)", false); SetProperty("ToolPath", "$(WixToolPath)", false);
AddGuardedProperty("WixMSBuildExtensionsPath", wixToolPath, false); AddGuardedProperty("WixMSBuildExtensionsPath", wixToolPath, false);
this.AddImport(DefaultTargetsFile, null); this.AddImport(DefaultTargetsFile, null);

40
src/AddIns/BackendBindings/WixBinding/Test/Project/CreateNewWixProjectObjectTestFixture.cs

@ -6,10 +6,12 @@
// </file> // </file>
using System; using System;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Dom; using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Internal.Templates; using ICSharpCode.SharpDevelop.Internal.Templates;
using ICSharpCode.SharpDevelop.Project; using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.WixBinding; using ICSharpCode.WixBinding;
using MSBuild = Microsoft.Build.BuildEngine;
using NUnit.Framework; using NUnit.Framework;
using WixBinding.Tests.Utils; using WixBinding.Tests.Utils;
@ -81,18 +83,39 @@ namespace WixBinding.Tests.Project
Assert.AreEqual(@"$(SharpDevelopBinPath)\Tools\Wix", project.GetUnevalatedProperty("WixToolPath")); Assert.AreEqual(@"$(SharpDevelopBinPath)\Tools\Wix", project.GetUnevalatedProperty("WixToolPath"));
} }
[Test]
public void WixToolPathCondition()
{
MSBuild.BuildProperty property = GetMSBuildProperty("WixToolPath");
Assert.AreEqual(" '$(WixToolPath)' == '' ", property.Condition);
}
[Test] [Test]
public void ToolPath() public void ToolPath()
{ {
Assert.AreEqual(@"$(WixToolPath)", project.GetUnevalatedProperty("ToolPath")); Assert.AreEqual(@"$(WixToolPath)", project.GetUnevalatedProperty("ToolPath"));
} }
[Test]
public void ToolPathHasNoCondition()
{
MSBuild.BuildProperty property = GetMSBuildProperty("ToolPath");
Assert.IsTrue(String.IsNullOrEmpty(property.Condition), "ToolPath should not have a condition: " + property.Condition);
}
[Test] [Test]
public void WixMSBuildExtensionsPath() public void WixMSBuildExtensionsPath()
{ {
Assert.AreEqual(@"$(SharpDevelopBinPath)\Tools\Wix", project.GetUnevalatedProperty("WixMSBuildExtensionsPath")); Assert.AreEqual(@"$(SharpDevelopBinPath)\Tools\Wix", project.GetUnevalatedProperty("WixMSBuildExtensionsPath"));
} }
[Test]
public void WixMSBuildExtensionsPathCondition()
{
MSBuild.BuildProperty property = GetMSBuildProperty("WixMSBuildExtensionsPath");
Assert.AreEqual(" '$(WixMSBuildExtensionsPath)' == '' ", property.Condition);
}
[Test] [Test]
public void DebugConfiguration() public void DebugConfiguration()
{ {
@ -122,5 +145,22 @@ namespace WixBinding.Tests.Project
{ {
Assert.AreEqual(LanguageProperties.None, project.LanguageProperties); Assert.AreEqual(LanguageProperties.None, project.LanguageProperties);
} }
/// <summary>
/// Gets the MSBuild build property with the specified name from the WixProject.
/// </summary>
MSBuild.BuildProperty GetMSBuildProperty(string name)
{
MSBuild.Project msbuildProject = project.MSBuildProject;
foreach (MSBuild.BuildPropertyGroup g in Linq.ToList(Linq.CastTo<MSBuild.BuildPropertyGroup>(msbuildProject.PropertyGroups))) {
if (!g.IsImported) {
MSBuild.BuildProperty property = MSBuildInternals.GetProperty(g, name);
if (property != null) {
return property;
}
}
}
return null;
}
} }
} }

Loading…
Cancel
Save