Browse Source

Move MSBuildEngineHelper to Scripting Tests project.

pull/1/head
mrward 15 years ago
parent
commit
18f3790186
  1. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Converter/ConvertToPythonProjectCommandTestFixture.cs
  2. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Converter/ProjectHasStartupObjectTestFixture.cs
  3. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Gui/AppSettingsPanelTestFixture.cs
  4. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Gui/CompilingOptionsPanelTestFixture.cs
  5. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Parsing/ParserTestFixture.cs
  6. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj
  7. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonLanguage/CreateNewPythonProjectTestFixture.cs
  8. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Testing/PythonTestFrameworkIsTestProjectTests.cs
  9. 24
      src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/PythonMSBuildEngineHelper.cs
  10. 2
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Converter/ConvertToRubyProjectCommandTestFixture.cs
  11. 2
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/RubyBinding.Tests.csproj
  12. 2
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestFrameworkIsTestProjectTests.cs
  13. 17
      src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Utils/RubyMSBuildEngineHelper.cs
  14. 1
      src/AddIns/BackendBindings/Scripting/Test/ICSharpCode.Scripting.Tests.csproj
  15. 43
      src/AddIns/BackendBindings/Scripting/Test/Utils/MSBuildEngineHelper.cs

2
src/AddIns/BackendBindings/Python/PythonBinding/Test/Converter/ConvertToPythonProjectCommandTestFixture.cs

@ -42,7 +42,7 @@ namespace PythonBinding.Tests.Converter @@ -42,7 +42,7 @@ namespace PythonBinding.Tests.Converter
[TestFixtureSetUp]
public void SetUpFixture()
{
MSBuildEngineHelper.InitMSBuildEngine();
PythonMSBuildEngineHelper.InitMSBuildEngine();
List<ProjectBindingDescriptor> bindings = new List<ProjectBindingDescriptor>();
using (TextReader reader = PythonBindingAddInFile.ReadAddInFile()) {

2
src/AddIns/BackendBindings/Python/PythonBinding/Test/Converter/ProjectHasStartupObjectTestFixture.cs

@ -54,7 +54,7 @@ namespace PythonBinding.Tests.Converter @@ -54,7 +54,7 @@ namespace PythonBinding.Tests.Converter
[TestFixtureSetUp]
public void SetUpFixture()
{
MSBuildEngineHelper.InitMSBuildEngine();
PythonMSBuildEngineHelper.InitMSBuildEngine();
List<ProjectBindingDescriptor> bindings = new List<ProjectBindingDescriptor>();
using (TextReader reader = PythonBindingAddInFile.ReadAddInFile()) {

2
src/AddIns/BackendBindings/Python/PythonBinding/Test/Gui/AppSettingsPanelTestFixture.cs

@ -30,7 +30,7 @@ namespace PythonBinding.Tests.Gui @@ -30,7 +30,7 @@ namespace PythonBinding.Tests.Gui
[SetUp]
public void SetUp()
{
MSBuildEngineHelper.InitMSBuildEngine();
PythonMSBuildEngineHelper.InitMSBuildEngine();
ProjectCreateInformation info = new ProjectCreateInformation();
info.Solution = new Solution();

2
src/AddIns/BackendBindings/Python/PythonBinding/Test/Gui/CompilingOptionsPanelTestFixture.cs

@ -30,7 +30,7 @@ namespace PythonBinding.Tests.Gui @@ -30,7 +30,7 @@ namespace PythonBinding.Tests.Gui
[SetUp]
public void SetUp()
{
MSBuildEngineHelper.InitMSBuildEngine();
PythonMSBuildEngineHelper.InitMSBuildEngine();
ProjectCreateInformation info = new ProjectCreateInformation();
info.Solution = new Solution();

2
src/AddIns/BackendBindings/Python/PythonBinding/Test/Parsing/ParserTestFixture.cs

@ -29,7 +29,7 @@ namespace PythonBinding.Tests.Parsing @@ -29,7 +29,7 @@ namespace PythonBinding.Tests.Parsing
[TestFixtureSetUp]
public void SetUpFixture()
{
MSBuildEngineHelper.InitMSBuildEngine();
PythonMSBuildEngineHelper.InitMSBuildEngine();
parser = new PythonParser();
}

2
src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonBinding.Tests.csproj

@ -446,7 +446,7 @@ @@ -446,7 +446,7 @@
<Compile Include="Utils\MockPythonConsolePad.cs" />
<Compile Include="Utils\MockPythonFileService.cs" />
<Compile Include="Utils\MockWorkbench.cs" />
<Compile Include="Utils\MSBuildEngineHelper.cs" />
<Compile Include="Utils\PythonMSBuildEngineHelper.cs" />
<Compile Include="Utils\TestablePythonConsole.cs" />
<Compile Include="Utils\Tests\AddInPathHelperTestFixture.cs" />
<EmbeddedResource Include="..\Project\PythonBinding.addin">

2
src/AddIns/BackendBindings/Python/PythonBinding/Test/PythonLanguage/CreateNewPythonProjectTestFixture.cs

@ -31,7 +31,7 @@ namespace PythonBinding.Tests.PythonLanguage @@ -31,7 +31,7 @@ namespace PythonBinding.Tests.PythonLanguage
[TestFixtureSetUp]
public void SetUpFixture()
{
MSBuildEngineHelper.InitMSBuildEngine();
PythonMSBuildEngineHelper.InitMSBuildEngine();
info = new ProjectCreateInformation();
info.Solution = new Solution();

2
src/AddIns/BackendBindings/Python/PythonBinding/Test/Testing/PythonTestFrameworkIsTestProjectTests.cs

@ -24,7 +24,7 @@ namespace PythonBinding.Tests.Testing @@ -24,7 +24,7 @@ namespace PythonBinding.Tests.Testing
[TestFixtureSetUp]
public void SetUpFixture()
{
MSBuildEngineHelper.InitMSBuildEngine();
PythonMSBuildEngineHelper.InitMSBuildEngine();
}
[SetUp]

24
src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/MSBuildEngineHelper.cs → src/AddIns/BackendBindings/Python/PythonBinding/Test/Utils/PythonMSBuildEngineHelper.cs

@ -8,16 +8,14 @@ @@ -8,16 +8,14 @@
using System;
using System.IO;
using ICSharpCode.PythonBinding;
using ICSharpCode.Scripting.Tests.Utils;
using ICSharpCode.SharpDevelop.Project;
namespace PythonBinding.Tests.Utils
{
/// <summary>
/// Description of MSBuildEngineHelper.
/// </summary>
public sealed class MSBuildEngineHelper
public sealed class PythonMSBuildEngineHelper
{
MSBuildEngineHelper()
PythonMSBuildEngineHelper()
{
}
@ -25,23 +23,15 @@ namespace PythonBinding.Tests.Utils @@ -25,23 +23,15 @@ namespace PythonBinding.Tests.Utils
/// The MSBuildEngine sets the PythonBinPath so if
/// the Python.Build.Tasks assembly is shadow copied it refers
/// to the shadow copied assembly not the original. This
/// causes problems for python projects that refer to the
/// causes problems for Python projects that refer to the
/// SharpDevelop.Python.Build.targets import via $(PythonBinPath)
/// so here we change it so it points to the real PythonBinPath
/// binary.
/// </summary>
public static void InitMSBuildEngine()
{
// Remove existing PythonBinPath property.
MSBuildEngine.MSBuildProperties.Remove("PythonBinPath");
// Set the PythonBinPath property so it points to
// the actual bin path where the Python.Build.Tasks was built not
// to the shadow copy folder.
string codeBase = typeof(PythonParser).Assembly.CodeBase.Replace("file:///", String.Empty);
string folder = Path.GetDirectoryName(codeBase);
folder = Path.GetFullPath(Path.Combine(folder, @"..\..\AddIns\BackendBindings\PythonBinding\"));
MSBuildEngine.MSBuildProperties["PythonBinPath"] = folder;
}
string relativePath = @"..\..\AddIns\BackendBindings\PythonBinding\";
MSBuildEngineHelper.InitMSBuildEngine("PythonBinPath", relativePath, typeof(PythonParser));
}
}
}

2
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Converter/ConvertToRubyProjectCommandTestFixture.cs

@ -45,7 +45,7 @@ namespace RubyBinding.Tests.Converter @@ -45,7 +45,7 @@ namespace RubyBinding.Tests.Converter
[TestFixtureSetUp]
public void SetUpFixture()
{
MSBuildEngineHelper.InitMSBuildEngine();
RubyMSBuildEngineHelper.InitMSBuildEngine();
List<ProjectBindingDescriptor> bindings = new List<ProjectBindingDescriptor>();
using (TextReader reader = RubyBindingAddInFile.ReadAddInFile()) {

2
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/RubyBinding.Tests.csproj

@ -340,8 +340,8 @@ @@ -340,8 +340,8 @@
<Compile Include="Utils\MockRubyFileService.cs" />
<Compile Include="Utils\MockConsoleTextEditor.cs" />
<Compile Include="Utils\MockWorkbench.cs" />
<Compile Include="Utils\MSBuildEngineHelper.cs" />
<Compile Include="Utils\RubyBindingAddInFile.cs" />
<Compile Include="Utils\RubyMSBuildEngineHelper.cs" />
<Compile Include="Utils\RubyParserHelper.cs" />
<Compile Include="Utils\RubySelectedTestsHelper.cs" />
<Compile Include="Utils\TestableRubyConsole.cs" />

2
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Testing/RubyTestFrameworkIsTestProjectTests.cs

@ -24,7 +24,7 @@ namespace RubyBinding.Tests.Testing @@ -24,7 +24,7 @@ namespace RubyBinding.Tests.Testing
[TestFixtureSetUp]
public void SetUpFixture()
{
MSBuildEngineHelper.InitMSBuildEngine();
RubyMSBuildEngineHelper.InitMSBuildEngine();
}
[SetUp]

17
src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Utils/MSBuildEngineHelper.cs → src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Utils/RubyMSBuildEngineHelper.cs

@ -8,13 +8,14 @@ @@ -8,13 +8,14 @@
using System;
using System.IO;
using ICSharpCode.RubyBinding;
using ICSharpCode.Scripting.Tests.Utils;
using ICSharpCode.SharpDevelop.Project;
namespace RubyBinding.Tests.Utils
{
public sealed class MSBuildEngineHelper
public sealed class RubyMSBuildEngineHelper
{
MSBuildEngineHelper()
RubyMSBuildEngineHelper()
{
}
@ -29,16 +30,8 @@ namespace RubyBinding.Tests.Utils @@ -29,16 +30,8 @@ namespace RubyBinding.Tests.Utils
/// </summary>
public static void InitMSBuildEngine()
{
// Remove existing RubyBinPath property.
MSBuildEngine.MSBuildProperties.Remove("RubyBinPath");
// Set the RubyBinPath property so it points to
// the actual bin path where the Ruby.Build.Tasks was built not
// to the shadow copy folder.
string codeBase = typeof(RubyParser).Assembly.CodeBase.Replace("file:///", String.Empty);
string folder = Path.GetDirectoryName(codeBase);
folder = Path.GetFullPath(Path.Combine(folder, @"..\..\AddIns\AddIns\BackendBindings\RubyBinding\"));
MSBuildEngine.MSBuildProperties["RubyBinPath"] = folder;
string relativePath = @"..\..\AddIns\BackendBindings\RubyBinding\";
MSBuildEngineHelper.InitMSBuildEngine("RubyBinPath", relativePath, typeof(RubyParser));
}
}
}

1
src/AddIns/BackendBindings/Scripting/Test/ICSharpCode.Scripting.Tests.csproj

@ -110,6 +110,7 @@ @@ -110,6 +110,7 @@
<Compile Include="Utils\MockTextEditorViewContent.cs" />
<Compile Include="Utils\MockTypeResolutionService.cs" />
<Compile Include="Utils\MockViewContent.cs" />
<Compile Include="Utils\MSBuildEngineHelper.cs" />
<Compile Include="Utils\NullPropertyUserControl.cs" />
<Compile Include="Utils\SupportInitCustomControl.cs" />
<Compile Include="Utils\Tests\MockComponentCreatorTests.cs" />

43
src/AddIns/BackendBindings/Scripting/Test/Utils/MSBuildEngineHelper.cs

@ -0,0 +1,43 @@ @@ -0,0 +1,43 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.IO;
using ICSharpCode.Scripting;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.Scripting.Tests.Utils
{
public sealed class MSBuildEngineHelper
{
MSBuildEngineHelper()
{
}
/// <summary>
/// The MSBuildEngine sets theBinPath so if
/// the Build.Tasks assembly is shadow copied it refers
/// to the shadow copied assembly not the original. This
/// causes problems for python projects that refer to the
/// SharpDevelop.*.Build.targets import via $(BinPath)
/// so here we change it so it points to the real BinPath
/// binary.
/// </summary>
public static void InitMSBuildEngine(string binPathName, string addInRelativePath, Type typeForCodeBase)
{
MSBuildEngine.MSBuildProperties.Remove(binPathName);
// Set the bin path property so it points to
// the actual bin path where the Build.Tasks was built not
// to the shadow copy folder.
string codeBase = typeForCodeBase.Assembly.CodeBase.Replace("file:///", String.Empty);
string folder = Path.GetDirectoryName(codeBase);
folder = Path.GetFullPath(Path.Combine(folder, addInRelativePath));
MSBuildEngine.MSBuildProperties[binPathName] = folder;
}
}
}
Loading…
Cancel
Save