Browse Source

Simplify project creation API.

pull/32/merge
Daniel Grunwald 13 years ago
parent
commit
7f08fe1c0f
  1. 7
      src/AddIns/Analysis/CodeCoverage/Test/Coverage/OpenCoverSettingsTestFixture.cs
  2. 1
      src/AddIns/Analysis/UnitTesting/Test/NUnit/NUnitConsoleExeSelectedTestFixture.cs
  3. 7
      src/AddIns/Analysis/UnitTesting/Test/Utils/MockCSharpProject.cs
  4. 5
      src/AddIns/BackendBindings/AspNet.Mvc/Test/Helpers/MSBuildProjectHelper.cs
  5. 5
      src/AddIns/BackendBindings/AspNet.Mvc/Test/Helpers/TestableProject.cs
  6. 2
      src/AddIns/BackendBindings/CppBinding/CppBinding/CppProjectBinding.cs
  7. 2
      src/AddIns/BackendBindings/FSharpBinding/FSharpLanguageBinding.cs
  8. 6
      src/AddIns/BackendBindings/WixBinding/Test/Gui/DeleteWixExtensionNodeTestFixture.cs
  9. 6
      src/AddIns/BackendBindings/WixBinding/Test/Gui/DeleteWixLibraryNodeTestFixture.cs
  10. 8
      src/AddIns/BackendBindings/WixBinding/Test/Project/CreateNewWixProjectObjectTestFixture.cs
  11. 7
      src/AddIns/BackendBindings/WixBinding/Test/Project/WixBuilderCannotBuildNonWixProjectTestFixture.cs
  12. 1
      src/AddIns/BackendBindings/WixBinding/Test/Utils/MockSolution.cs
  13. 5
      src/AddIns/BackendBindings/WixBinding/Test/Utils/WixBindingTestsHelper.cs
  14. 2
      src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlCompletionItem.cs
  15. 8
      src/AddIns/Misc/PackageManagement/Project/Src/NewProjectsCreated.cs
  16. 9
      src/AddIns/Misc/PackageManagement/Test/Src/Helpers/ProjectHelper.cs
  17. 11
      src/AddIns/Misc/PackageManagement/Test/Src/InstallProjectTemplatePackagesCommandTests.cs
  18. 5
      src/AddIns/Misc/PackageManagement/Test/Src/NewProjectsCreatedTests.cs
  19. 6
      src/AddIns/Misc/TextTemplating/Test/Helpers/ProjectHelper.cs
  20. 5
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  21. 116
      src/Main/Base/Project/Project/Configuration/ConfigurationMapping.cs
  22. 33
      src/Main/Base/Project/Project/Configuration/IConfigurationMapping.cs
  23. 11
      src/Main/Base/Project/Project/ISolution.cs
  24. 96
      src/Main/Base/Project/Project/ProjectInformation.cs
  25. 56
      src/Main/Base/Project/Project/SolutionSection.cs
  26. 34
      src/Main/Base/Project/Src/Gui/Dialogs/NewProjectDialog.cs
  27. 57
      src/Main/Base/Project/Src/Internal/Templates/Project/ProjectCreateInformation.cs
  28. 77
      src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs
  29. 65
      src/Main/Base/Project/Src/Internal/Templates/Project/ProjectTemplate.cs
  30. 25
      src/Main/Base/Project/Src/Internal/Templates/Project/SolutionDescriptor.cs
  31. 23
      src/Main/Base/Project/Src/Project/AbstractProject.cs
  32. 2
      src/Main/Base/Project/Src/Project/CompilableProject.cs
  33. 12
      src/Main/Base/Project/Src/Project/Converter/LanguageConverter.cs
  34. 2
      src/Main/Base/Project/Src/Project/IProject.cs
  35. 10
      src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs
  36. 55
      src/Main/Base/Project/Src/Project/ProjectLoadInformation.cs
  37. 7
      src/Main/Base/Test/WebReferences/WebReferenceTestHelper.cs
  38. 85
      src/Main/SharpDevelop/Project/Configuration/ConfigurationMapping.cs
  39. 3
      src/Main/SharpDevelop/Project/Configuration/SolutionConfigurationOrPlatformNameCollection.cs
  40. 11
      src/Main/SharpDevelop/Project/Solution.cs
  41. 2
      src/Main/SharpDevelop/Project/SolutionFolder.cs
  42. 5
      src/Main/SharpDevelop/Project/SolutionLoader.cs
  43. 1
      src/Main/SharpDevelop/SharpDevelop.csproj

7
src/AddIns/Analysis/CodeCoverage/Test/Coverage/OpenCoverSettingsTestFixture.cs

@ -62,12 +62,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Coverage @@ -62,12 +62,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Coverage
public void OpenCoverSettingsFileName()
{
MSBuildBasedProject project = new MSBuildBasedProject(
new ProjectCreateInformation {
Solution = MockSolution.Create(),
ConfigurationMapping = MockRepository.GenerateStub<IConfigurationMapping>(),
OutputProjectFileName = new FileName(@"C:\temp\test.csproj"),
ProjectName = "test"
});
new ProjectCreateInformation(MockSolution.Create(), new FileName(@"C:\temp\test.csproj")));
Assert.AreEqual(@"C:\temp\test.OpenCover.Settings", OpenCoverSettings.GetFileName(project));
}

1
src/AddIns/Analysis/UnitTesting/Test/NUnit/NUnitConsoleExeSelectedTestFixture.cs

@ -121,7 +121,6 @@ namespace UnitTesting.Tests.NUnit @@ -121,7 +121,6 @@ namespace UnitTesting.Tests.NUnit
public void NotMSBuildBasedProject()
{
ProjectLoadInformation info = new ProjectLoadInformation(MockSolution.Create(), FileName.Create(@"C:\Projects\Test.proj"), "Test");
info.ConfigurationMapping = MockRepository.GenerateStub<IConfigurationMapping>();
MissingProject project = new MissingProject(info);
ITestProject testProject = new NUnitTestProject(project);

7
src/AddIns/Analysis/UnitTesting/Test/Utils/MockCSharpProject.cs

@ -23,13 +23,10 @@ namespace UnitTesting.Tests.Utils @@ -23,13 +23,10 @@ namespace UnitTesting.Tests.Utils
}
public MockCSharpProject(ISolution solution, string name)
: base(new ProjectCreateInformation {
Solution = solution,
ConfigurationMapping = MockRepository.GenerateStub<IConfigurationMapping>(),
: base(new ProjectCreateInformation(solution, FileName.Create("c:\\projects\\" + name + "\\" + name + ".csproj")) {
ProjectName = name,
ProjectConfiguration = new ConfigurationAndPlatform("Debug", "x86"),
ActiveProjectConfiguration = new ConfigurationAndPlatform("Debug", "x86"),
TargetFramework = TargetFramework.Net40Client,
OutputProjectFileName = FileName.Create("c:\\projects\\" + name + "\\" + name + ".csproj")
})
{
OutputType = OutputType.Library;

5
src/AddIns/BackendBindings/AspNet.Mvc/Test/Helpers/MSBuildProjectHelper.cs

@ -13,10 +13,7 @@ namespace AspNet.Mvc.Tests.Helpers @@ -13,10 +13,7 @@ namespace AspNet.Mvc.Tests.Helpers
{
public static MSBuildBasedProject CreateCSharpProject()
{
var createInfo = new ProjectCreateInformation();
createInfo.Solution = FakeSolution.Create();
createInfo.ConfigurationMapping = MockRepository.GenerateStub<IConfigurationMapping>();
createInfo.OutputProjectFileName = new FileName(@"d:\projects\MyProject\MyProject.csproj");
var createInfo = new ProjectCreateInformation(FakeSolution.Create(), new FileName(@"d:\projects\MyProject\MyProject.csproj"));
return new MSBuildBasedProject(createInfo);
}
}

5
src/AddIns/BackendBindings/AspNet.Mvc/Test/Helpers/TestableProject.cs

@ -28,11 +28,8 @@ namespace AspNet.Mvc.Tests.Helpers @@ -28,11 +28,8 @@ namespace AspNet.Mvc.Tests.Helpers
public static TestableProject CreateProject(string fileName, string projectName)
{
var createInfo = new ProjectCreateInformation();
createInfo.Solution = FakeSolution.Create();
createInfo.ConfigurationMapping = MockRepository.GenerateStub<IConfigurationMapping>();
var createInfo = new ProjectCreateInformation(FakeSolution.Create(), new FileName(fileName));
createInfo.ProjectName = projectName;
createInfo.OutputProjectFileName = new FileName(fileName);
return new TestableProject(createInfo);
}

2
src/AddIns/BackendBindings/CppBinding/CppBinding/CppProjectBinding.cs

@ -27,7 +27,7 @@ namespace ICSharpCode.CppBinding @@ -27,7 +27,7 @@ namespace ICSharpCode.CppBinding
}
public IProject CreateProject(ProjectCreateInformation info) {
info.ProjectConfiguration = new ConfigurationAndPlatform("Debug", "Win32");
info.ActiveProjectConfiguration = new ConfigurationAndPlatform("Debug", "Win32");
return new CppProject(info);
}

2
src/AddIns/BackendBindings/FSharpBinding/FSharpLanguageBinding.cs

@ -17,7 +17,7 @@ namespace FSharpBinding @@ -17,7 +17,7 @@ namespace FSharpBinding
return new FSharpProject(info);
}
public IProject CreateProject(ICSharpCode.SharpDevelop.Internal.Templates.ProjectCreateInformation info)
public IProject CreateProject(ProjectCreateInformation info)
{
return new FSharpProject(info);
}

6
src/AddIns/BackendBindings/WixBinding/Test/Gui/DeleteWixExtensionNodeTestFixture.cs

@ -33,11 +33,7 @@ namespace WixBinding.Tests.Gui @@ -33,11 +33,7 @@ namespace WixBinding.Tests.Gui
WixBindingTestsHelper.InitMSBuildEngine();
// create the project.
ProjectCreateInformation info = new ProjectCreateInformation();
info.Solution = MockSolution.Create();
info.ConfigurationMapping = MockRepository.GenerateStub<IConfigurationMapping>();
info.ProjectName = "Test";
info.OutputProjectFileName = new FileName(@"C:\Projects\Test\Test.wixproj");
ProjectCreateInformation info = new ProjectCreateInformation(MockSolution.Create(), new FileName(@"C:\Projects\Test\Test.wixproj"));
wixProject = new WixProjectWithOverriddenSave(info);

6
src/AddIns/BackendBindings/WixBinding/Test/Gui/DeleteWixLibraryNodeTestFixture.cs

@ -33,11 +33,7 @@ namespace WixBinding.Tests.Gui @@ -33,11 +33,7 @@ namespace WixBinding.Tests.Gui
WixBindingTestsHelper.InitMSBuildEngine();
// create the project.
ProjectCreateInformation info = new ProjectCreateInformation();
info.Solution = MockSolution.Create();
info.ConfigurationMapping = MockRepository.GenerateStub<IConfigurationMapping>();
info.ProjectName = "Test";
info.OutputProjectFileName = new FileName(@"C:\Projects\Test\Test.wixproj");
ProjectCreateInformation info = new ProjectCreateInformation(MockSolution.Create(), new FileName(@"C:\Projects\Test\Test.wixproj"));
wixProject = new WixProjectWithOverriddenSave(info);

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

@ -32,11 +32,7 @@ namespace WixBinding.Tests.Project @@ -32,11 +32,7 @@ namespace WixBinding.Tests.Project
SD.InitializeForUnitTests();
WixBindingTestsHelper.InitMSBuildEngine();
info = new ProjectCreateInformation();
info.Solution = MockSolution.Create();
info.ConfigurationMapping = MockRepository.GenerateStub<IConfigurationMapping>();
info.ProjectName = "Test";
info.OutputProjectFileName = new FileName(@"C:\Projects\Test\Test.wixproj");
info = new ProjectCreateInformation(MockSolution.Create(), new FileName(@"C:\Projects\Test\Test.wixproj"));
info.RootNamespace = "Test";
project = new WixProject(info);
@ -112,7 +108,7 @@ namespace WixBinding.Tests.Project @@ -112,7 +108,7 @@ namespace WixBinding.Tests.Project
[Test]
public void FileName()
{
Assert.AreEqual(info.OutputProjectFileName, project.FileName);
Assert.AreEqual(info.FileName, project.FileName);
}
[Test]

7
src/AddIns/BackendBindings/WixBinding/Test/Project/WixBuilderCannotBuildNonWixProjectTestFixture.cs

@ -29,12 +29,7 @@ namespace WixBinding.Tests.Project @@ -29,12 +29,7 @@ namespace WixBinding.Tests.Project
SD.InitializeForUnitTests();
wixNodeBuilder = new WixProjectNodeBuilder();
project = new MSBuildBasedProject(
new ProjectCreateInformation {
OutputProjectFileName = new FileName(@"C:\Projects\Test\test.csproj"),
Solution = MockSolution.Create(),
ConfigurationMapping = MockRepository.GenerateStub<IConfigurationMapping>(),
ProjectName = "test"
}
new ProjectCreateInformation(MockSolution.Create(), new FileName(@"C:\Projects\Test\test.csproj"))
);
project.IdGuid = Guid.Parse("FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF");
}

1
src/AddIns/BackendBindings/WixBinding/Test/Utils/MockSolution.cs

@ -22,6 +22,7 @@ namespace WixBinding.Tests.Utils @@ -22,6 +22,7 @@ namespace WixBinding.Tests.Utils
{
ISolution solution = MockRepository.GenerateStrictMock<ISolution>();
solution.Stub(s => s.MSBuildProjectCollection).Return(new ProjectCollection());
solution.Stub(s => s.ActiveConfiguration).Return(new ConfigurationAndPlatform("Debug", "Any CPU"));
return solution;
}
}

5
src/AddIns/BackendBindings/WixBinding/Test/Utils/WixBindingTestsHelper.cs

@ -46,12 +46,9 @@ namespace WixBinding.Tests.Utils @@ -46,12 +46,9 @@ namespace WixBinding.Tests.Utils
InitMSBuildEngine();
// create the project.
ProjectCreateInformation info = new ProjectCreateInformation();
info.Solution = MockRepository.GenerateStub<ISolution>();
ProjectCreateInformation info = new ProjectCreateInformation(MockRepository.GenerateStub<ISolution>(), new FileName(@"C:\Projects\Test\Test.wixproj"));
info.Solution.Stub(s => s.MSBuildProjectCollection).Return(new ProjectCollection());
info.ConfigurationMapping = MockRepository.GenerateStub<IConfigurationMapping>();
info.ProjectName = "Test";
info.OutputProjectFileName = new FileName(@"C:\Projects\Test\Test.wixproj");
return new DummyWixProject(info);
}

2
src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlCompletionItem.cs

@ -80,7 +80,7 @@ namespace ICSharpCode.XmlEditor @@ -80,7 +80,7 @@ namespace ICSharpCode.XmlEditor
public override int GetHashCode()
{
return base.GetHashCode();
return dataType.GetHashCode() ^ Text.GetHashCode();
}
public override bool Equals(object obj)

8
src/AddIns/Misc/PackageManagement/Project/Src/NewProjectsCreated.cs

@ -30,12 +30,16 @@ namespace ICSharpCode.PackageManagement @@ -30,12 +30,16 @@ namespace ICSharpCode.PackageManagement
public IEnumerable<MSBuildBasedProject> GetProjects()
{
foreach (IProject project in createInfo.CreatedProjects) {
// ProjectCreateInformation is no longer used to collect the results of the whole solution creation,
// there now is a separate instance per project.
#warning Reimplement PackageManagement.NewProjectsCreated
throw new NotImplementedException();
/*foreach (IProject project in createInfo.CreatedProjects) {
MSBuildBasedProject openProject = FindProject(project.Name);
if (openProject != null) {
yield return openProject;
}
}
}*/
}
MSBuildBasedProject FindProject(string name)

9
src/AddIns/Misc/PackageManagement/Test/Src/Helpers/ProjectHelper.cs

@ -20,6 +20,7 @@ namespace PackageManagement.Tests.Helpers @@ -20,6 +20,7 @@ namespace PackageManagement.Tests.Helpers
ISolution solution = MockRepository.GenerateStrictMock<ISolution>();
solution.Stub(s => s.MSBuildProjectCollection).Return(new Microsoft.Build.Evaluation.ProjectCollection());
solution.Stub(s => s.Projects).Return(new SimpleModelCollection<IProject>());
solution.Stub(s => s.ActiveConfiguration).Return(new ConfigurationAndPlatform("Debug", "Any CPU"));
//solution.Stub(s => s.FileName).Return(FileName.Create(@"d:\projects\Test\TestSolution.sln"));
return solution;
}
@ -41,13 +42,7 @@ namespace PackageManagement.Tests.Helpers @@ -41,13 +42,7 @@ namespace PackageManagement.Tests.Helpers
string name,
string fileName = null)
{
ProjectCreateInformation createInfo = new ProjectCreateInformation();
createInfo.Solution = parentSolution;
createInfo.ConfigurationMapping = MockRepository.GenerateStub<IConfigurationMapping>();
createInfo.ProjectName = name;
createInfo.SolutionPath = DirectoryName.Create(@"d:\projects\Test");
createInfo.ProjectBasePath = DirectoryName.Create(@"d:\projects\Test\TestProject");
createInfo.OutputProjectFileName = new FileName(fileName ?? (@"d:\projects\Test\TestProject\" + name + ".csproj"));
ProjectCreateInformation createInfo = new ProjectCreateInformation(parentSolution, new FileName(fileName ?? (@"d:\projects\Test\TestProject\" + name + ".csproj")));
var project = new TestableProject(createInfo);
((ICollection<IProject>)parentSolution.Projects).Add(project);

11
src/AddIns/Misc/PackageManagement/Test/Src/InstallProjectTemplatePackagesCommandTests.cs

@ -37,12 +37,13 @@ namespace PackageManagement.Tests @@ -37,12 +37,13 @@ namespace PackageManagement.Tests
void RunCommandWithProjectCreateInfoAsOwner(List<TestableProject> projects)
{
var createInfo = new ProjectCreateInformation(projects);
throw new NotImplementedException();
/*var createInfo = new ProjectCreateInformation(projects);
createInfo.Solution = projects[0].ParentSolution;
command.FakeProjectService.AllProjects.Inputs.Add(new ReadOnlyModelCollection<IProject>(projects));
RunCommandWithProjectCreateInfoAsOwner(createInfo);
RunCommandWithProjectCreateInfoAsOwner(createInfo);*/
}
void RunCommandWithProjectCreateInfoAsOwner(ProjectCreateInformation createInfo)
@ -79,7 +80,9 @@ namespace PackageManagement.Tests @@ -79,7 +80,9 @@ namespace PackageManagement.Tests
TestableProject createInfoProject = CreateFakeProject("Test");
var projects = new List<IProject>();
projects.Add(createInfoProject);
var createInfo = new ProjectCreateInformation(projects);
throw new NotImplementedException();
/*var createInfo = new ProjectCreateInformation(projects);
TestableProject expectedProject = ProjectHelper.CreateTestProject("TEST");
command.FakeProjectService.AddProject(expectedProject);
@ -88,7 +91,7 @@ namespace PackageManagement.Tests @@ -88,7 +91,7 @@ namespace PackageManagement.Tests
MSBuildBasedProject project = command.ProjectPassedToCreatePackageReferencesForProject;
Assert.AreEqual(expectedProject, project);
Assert.AreEqual(expectedProject, project);*/
}
[Test]

5
src/AddIns/Misc/PackageManagement/Test/Src/NewProjectsCreatedTests.cs

@ -12,7 +12,7 @@ using PackageManagement.Tests.Helpers; @@ -12,7 +12,7 @@ using PackageManagement.Tests.Helpers;
namespace PackageManagement.Tests
{
[TestFixture]
[TestFixture, IgnoreAttribute("NewProjectsCreated currently not implemented")]
public class NewProjectsCreatedTests
{
FakePackageManagementProjectService fakeProjectService;
@ -32,7 +32,8 @@ namespace PackageManagement.Tests @@ -32,7 +32,8 @@ namespace PackageManagement.Tests
ProjectCreateInformation CreateProjectCreateInfo(IEnumerable<MSBuildBasedProject> projects)
{
return new ProjectCreateInformation(projects);
throw new NotImplementedException();
//return new ProjectCreateInformation(projects);
}
void CreateNewProjectsCreated(ProjectCreateInformation createInfo)

6
src/AddIns/Misc/TextTemplating/Test/Helpers/ProjectHelper.cs

@ -14,12 +14,8 @@ namespace TextTemplating.Tests.Helpers @@ -14,12 +14,8 @@ namespace TextTemplating.Tests.Helpers
{
public static TestableProject CreateProject()
{
var info = new ProjectCreateInformation();
info.Solution = MockRepository.GenerateStub<ISolution>();
var info = new ProjectCreateInformation(MockRepository.GenerateStub<ISolution>(), FileName.Create(@"d:\projects\MyProject\MyProject.csproj"));
info.Solution.Stub(s => s.MSBuildProjectCollection).Return(new ProjectCollection());
info.ConfigurationMapping = MockRepository.GenerateStub<IConfigurationMapping>();
info.OutputProjectFileName = FileName.Create(@"d:\projects\MyProject\MyProject.csproj");
info.ProjectName = "MyProject";
return new TestableProject(info);
}
}

5
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -154,12 +154,13 @@ @@ -154,12 +154,13 @@
<Compile Include="Project\Build\ProjectBuildOptions.cs" />
<Compile Include="Project\Configuration\ConfigurationAndPlatform.cs" />
<Compile Include="Project\Configuration\IConfigurable.cs" />
<Compile Include="Project\Configuration\IConfigurationMapping.cs" />
<Compile Include="Project\Configuration\ConfigurationMapping.cs" />
<Compile Include="Project\Configuration\IConfigurationOrPlatformNameCollection.cs" />
<Compile Include="Project\IProjectService.cs" />
<Compile Include="Project\ISolution.cs" />
<Compile Include="Project\ISolutionFolder.cs" />
<Compile Include="Project\ISolutionItem.cs" />
<Compile Include="Project\ProjectInformation.cs" />
<Compile Include="Project\Project_TypeGuids.cs" />
<Compile Include="Project\SolutionEventArgs.cs" />
<Compile Include="Project\SolutionSection.cs" />
@ -490,7 +491,6 @@ @@ -490,7 +491,6 @@
<Compile Include="Project\PortableLibrary\SupportedFramework.cs" />
<Compile Include="Src\Project\ProjectChangeWatcher.cs" />
<Compile Include="Src\Project\ProjectCustomToolOptions.cs" />
<Compile Include="Src\Project\ProjectLoadInformation.cs" />
<Compile Include="Src\Project\ProjectStartException.cs" />
<Compile Include="Src\Project\ProjectLoadException.cs" />
<Compile Include="Src\Project\ProjectPropertyChangedEventArgs.cs" />
@ -528,7 +528,6 @@ @@ -528,7 +528,6 @@
<Compile Include="Src\Services\Tasks\TaskService.cs" />
<Compile Include="Src\Internal\ExternalTool\ToolLoader.cs" />
<Compile Include="Src\Services\ProjectBinding\IProjectBinding.cs" />
<Compile Include="Src\Internal\Templates\Project\ProjectCreateInformation.cs" />
<Compile Include="Src\Services\ProjectBinding\ProjectBindingService.cs" />
<Compile Include="Src\Internal\ConditionEvaluators\CombineOpenEvaluator.cs" />
<Compile Include="Src\Services\ProjectBinding\ProjectBindingDoozer.cs" />

116
src/Main/Base/Project/Project/Configuration/ConfigurationMapping.cs

@ -0,0 +1,116 @@ @@ -0,0 +1,116 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
namespace ICSharpCode.SharpDevelop.Project
{
/// <summary>
/// Represents a mapping between solution and project configurations.
/// </summary>
/// <remarks>
/// This is a simple storage class - just a dictionary of the mappings.
/// This class is thread-safe.
/// </remarks>
public class ConfigurationMapping
{
class Entry
{
public ConfigurationAndPlatform Config;
public bool Build = true;
public Entry(ConfigurationAndPlatform config)
{
this.Config = config;
}
}
/// <summary>
/// The configuration mapping was changed.
/// </summary>
public event EventHandler Changed;
Dictionary<ConfigurationAndPlatform, Entry> dict = new Dictionary<ConfigurationAndPlatform, Entry>();
Entry GetOrCreateEntry(ConfigurationAndPlatform solutionConfiguration)
{
Entry entry;
if (!dict.TryGetValue(solutionConfiguration, out entry)) {
var config = new ConfigurationAndPlatform(solutionConfiguration.Configuration, MSBuildInternals.FixPlatformNameForProject(solutionConfiguration.Platform));
entry = new Entry(config);
dict.Add(solutionConfiguration, entry);
}
return entry;
}
/// <summary>
/// Gets the project configuration corresponding to the given solution configuration.
/// </summary>
public ConfigurationAndPlatform GetProjectConfiguration(ConfigurationAndPlatform solutionConfiguration)
{
lock (dict) {
Entry entry;
if (dict.TryGetValue(solutionConfiguration, out entry)) {
return entry.Config;
} else {
return new ConfigurationAndPlatform(solutionConfiguration.Configuration, MSBuildInternals.FixPlatformNameForProject(solutionConfiguration.Platform));
}
}
}
/// <summary>
/// Sets the project configuration corresponding to the given solution configuration.
/// </summary>
public void SetProjectConfiguration(ConfigurationAndPlatform solutionConfiguration, ConfigurationAndPlatform projectConfiguration)
{
if (string.IsNullOrEmpty(projectConfiguration.Configuration))
throw new ArgumentException("Invalid project configuration");
if (string.IsNullOrEmpty(projectConfiguration.Platform) || projectConfiguration.Platform == "Any CPU")
throw new ArgumentException("Invalid project platform");
lock (dict) {
GetOrCreateEntry(solutionConfiguration).Config = projectConfiguration;
}
Changed(this, EventArgs.Empty);
}
/// <summary>
/// Gets whether building the project is enabled in the given solution configuration.
/// </summary>
public bool IsBuildEnabled(ConfigurationAndPlatform solutionConfiguration)
{
lock (dict) {
Entry entry;
if (dict.TryGetValue(solutionConfiguration, out entry)) {
return entry.Build;
} else {
return true;
}
}
}
/// <summary>
/// Sets whether building the project is enabled in the given solution configuration.
/// </summary>
public void SetBuildEnabled(ConfigurationAndPlatform solutionConfiguration, bool value)
{
lock (dict) {
GetOrCreateEntry(solutionConfiguration).Build = value;
}
Changed(this, EventArgs.Empty);
}
/// <summary>
/// Removes all data stored about the specified solution configuration.
/// </summary>
public void Remove(ConfigurationAndPlatform solutionConfiguration)
{
bool result;
lock (dict) {
result = dict.Remove(solutionConfiguration);
}
if (result)
Changed(this, EventArgs.Empty);
}
}
}

33
src/Main/Base/Project/Project/Configuration/IConfigurationMapping.cs

@ -1,33 +0,0 @@ @@ -1,33 +0,0 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace ICSharpCode.SharpDevelop.Project
{
/// <summary>
/// Represents a mapping between solution and project configurations.
/// </summary>
public interface IConfigurationMapping
{
/// <summary>
/// Gets the project configuration corresponding to the given solution configuration.
/// </summary>
ConfigurationAndPlatform GetProjectConfiguration(ConfigurationAndPlatform solutionConfiguration);
/// <summary>
/// Sets the project configuration corresponding to the given solution configuration.
/// </summary>
void SetProjectConfiguration(ConfigurationAndPlatform solutionConfiguration, ConfigurationAndPlatform projectConfiguration);
/// <summary>
/// Gets whether building the project is enabled in the given solution configuration.
/// </summary>
bool IsBuildEnabled(ConfigurationAndPlatform solutionConfiguration);
/// <summary>
/// Sets whether building the project is enabled in the given solution configuration.
/// </summary>
void SetBuildEnabled(ConfigurationAndPlatform solutionConfiguration, bool value);
}
}

11
src/Main/Base/Project/Project/ISolution.cs

@ -8,7 +8,7 @@ using ICSharpCode.SharpDevelop.Dom; @@ -8,7 +8,7 @@ using ICSharpCode.SharpDevelop.Dom;
namespace ICSharpCode.SharpDevelop.Project
{
public enum SolutionFormatVersion // TODO: change IProject.MinimumSolutionFormatVersion to this enum type
public enum SolutionFormatVersion
{
VS2005 = 9,
VS2008 = 10,
@ -91,13 +91,4 @@ namespace ICSharpCode.SharpDevelop.Project @@ -91,13 +91,4 @@ namespace ICSharpCode.SharpDevelop.Project
/// </summary>
void Save();
}
/// <summary>
/// This is a HACK to make project creation work; I don't think we should expose this method.
/// Maybe make IConfigurationMapping a concrete class and use an event for setting the solution's dirty flag?
/// </summary>
internal interface ISolutionInternal : ISolution
{
IConfigurationMapping CreateMappingForNewProject();
}
}

96
src/Main/Base/Project/Project/ProjectInformation.cs

@ -0,0 +1,96 @@ @@ -0,0 +1,96 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using ICSharpCode.Core;
namespace ICSharpCode.SharpDevelop.Project
{
/// <summary>
/// Base class for <see cref="ProjectCreateInformation"/> and <see cref="ProjectLoadInformation"/>.
/// </summary>
public class ProjectInformation
{
public ProjectInformation(ISolution solution, FileName fileName)
{
if (solution == null)
throw new ArgumentNullException("solution");
if (fileName == null)
throw new ArgumentNullException("fileName");
this.Solution = solution;
this.FileName = fileName;
this.ProjectName = fileName.GetFileNameWithoutExtension();
this.ProjectSections = new List<SolutionSection>();
this.ConfigurationMapping = new ConfigurationMapping();
var solutionConfig = solution.ActiveConfiguration;
// In unit tests, ActiveConfiguration mayb return null
if (solutionConfig.Configuration != null && solutionConfig.Platform != null)
this.ActiveProjectConfiguration = this.ConfigurationMapping.GetProjectConfiguration(solution.ActiveConfiguration);
else
this.ActiveProjectConfiguration = new ConfigurationAndPlatform("Debug", "AnyCPU");
}
public ISolution Solution { get; private set; }
public FileName FileName { get; private set; }
public ConfigurationMapping ConfigurationMapping { get; set; }
public ConfigurationAndPlatform ActiveProjectConfiguration { get; set; }
public IList<SolutionSection> ProjectSections { get; private set; }
public string ProjectName { get; set; }
public Guid IdGuid { get; set; }
public Guid TypeGuid { get; set; }
}
/// <summary>
/// Parameter object for loading an existing project.
/// </summary>
public class ProjectLoadInformation : ProjectInformation
{
internal bool? upgradeToolsVersion;
IProgressMonitor progressMonitor = new DummyProgressMonitor();
/// <summary>
/// Gets/Sets the progress monitor used during the load.
/// This property never returns null.
/// </summary>
public IProgressMonitor ProgressMonitor {
get { return progressMonitor; }
set {
if (value == null)
throw new ArgumentNullException();
progressMonitor = value;
}
}
public ProjectLoadInformation(ISolution parentSolution, FileName fileName, string projectName)
: base(parentSolution, fileName)
{
if (projectName == null)
throw new ArgumentNullException("projectName");
this.ProjectName = projectName;
}
}
/// <summary>
/// This class holds all information the language binding need to create
/// a predefined project for their language, if no project template for a
/// specific language is avaiable, the language binding shouldn't care about
/// this stuff.
/// </summary>
public class ProjectCreateInformation : ProjectInformation
{
public ProjectCreateInformation(ISolution solution, FileName outputFileName)
: base(solution, outputFileName)
{
this.IdGuid = Guid.NewGuid();
this.RootNamespace = string.Empty;
}
public string RootNamespace { get; set; }
public TargetFramework TargetFramework { get; set; }
public bool InitializeTypeSystem { get; set; }
}
}

56
src/Main/Base/Project/Project/SolutionSection.cs

@ -14,7 +14,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -14,7 +14,7 @@ namespace ICSharpCode.SharpDevelop.Project
/// </summary>
public class SolutionSection : IReadOnlyDictionary<string, string>
{
// TODO: expose some change event so that the solution can be marked as dirty when a section is changed
public event EventHandler Changed = delegate { };
static readonly char[] forbiddenChars = { '\n', '\r', '\0', '=' };
@ -30,23 +30,47 @@ namespace ICSharpCode.SharpDevelop.Project @@ -30,23 +30,47 @@ namespace ICSharpCode.SharpDevelop.Project
throw new ArgumentException("value contains invalid characters", "value");
}
string sectionName;
string sectionType;
List<KeyValuePair<string, string>> entries = new List<KeyValuePair<string, string>>();
public SolutionSection(string sectionName, string sectionType)
{
Validate(sectionName, sectionType);
this.sectionName = sectionName;
this.sectionType = sectionType;
}
/// <summary>
/// Gets/Sets the section name
/// </summary>
public string SectionName { get; set; }
public string SectionName {
get {
return sectionName;
}
set {
if (sectionName != value) {
Validate(value, sectionType);
sectionName = value;
Changed(this, EventArgs.Empty);
}
}
}
/// <summary>
/// Gets/Sets the section type (e.g. 'preProject'/'postProject'/'preSolution'/'postSolution')
/// </summary>
public string SectionType { get; set; }
List<KeyValuePair<string, string>> entries = new List<KeyValuePair<string, string>>();
public SolutionSection(string sectionName, string sectionType)
{
Validate(sectionName, sectionType);
this.SectionName = sectionName;
this.SectionType = sectionType;
public string SectionType {
get {
return sectionType;
}
set {
if (sectionType != value) {
Validate(sectionName, value);
sectionType = value;
Changed(this, EventArgs.Empty);
}
}
}
public int Count {
@ -57,16 +81,23 @@ namespace ICSharpCode.SharpDevelop.Project @@ -57,16 +81,23 @@ namespace ICSharpCode.SharpDevelop.Project
{
Validate(key, value);
entries.Add(new KeyValuePair<string, string>(key, value));
Changed(this, EventArgs.Empty);
}
public bool Remove(string key)
{
return entries.RemoveAll(e => e.Key == key) > 0;
if (entries.RemoveAll(e => e.Key == key) > 0) {
Changed(this, EventArgs.Empty);
return true;
} else {
return false;
}
}
public void Clear()
{
entries.Clear();
Changed(this, EventArgs.Empty);
}
public bool ContainsKey(string key)
@ -104,6 +135,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -104,6 +135,7 @@ namespace ICSharpCode.SharpDevelop.Project
for (int i = 0; i < entries.Count; i++) {
if (entries[i].Key == key) {
entries[i] = new KeyValuePair<string, string>(key, value);
Changed(this, EventArgs.Empty);
return;
}
}

34
src/Main/Base/Project/Src/Gui/Dialogs/NewProjectDialog.cs

@ -333,13 +333,13 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs @@ -333,13 +333,13 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs
return;
}
ProjectCreateInformation cinfo = new ProjectCreateInformation();
ProjectCreateOptions cinfo = new ProjectCreateOptions();
if (!createNewSolution) {
cinfo.Solution = ProjectService.OpenSolution;
cinfo.SolutionPath = cinfo.Solution.Directory;
cinfo.SolutionName = cinfo.Solution.Name;
cinfo.SolutionPath = ProjectService.OpenSolution.Directory;
cinfo.SolutionName = ProjectService.OpenSolution.Name;
} else {
cinfo.SolutionPath = DirectoryName.Create(NewSolutionDirectory);
cinfo.SolutionName = solution;
}
if (item.Template.HasSupportedTargetFrameworks) {
@ -348,21 +348,27 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs @@ -348,21 +348,27 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs
}
cinfo.ProjectBasePath = DirectoryName.Create(NewProjectDirectory);
cinfo.SolutionName = solution;
cinfo.ProjectName = name;
NewSolutionLocation = item.Template.CreateProject(cinfo);
if (NewSolutionLocation == null) {
return;
}
NewProjectLocation = cinfo.createdProjects.Count > 0 ? cinfo.createdProjects[0].FileName : null;
NewSolutionLocation = null;
NewProjectLocation = null;
if (createNewSolution) {
SD.ProjectService.OpenSolutionOrProject(NewSolutionLocation);
using (ISolution createdSolution = item.Template.CreateSolution(cinfo)) {
if (createdSolution != null)
NewSolutionLocation = createdSolution.FileName;
}
if (NewSolutionLocation != null)
SD.ProjectService.OpenSolutionOrProject(NewSolutionLocation);
} else {
SolutionFolderNode.Folder.AddExistingProject(NewProjectLocation);
ProjectService.SaveSolution();
using (IProject project = item.Template.CreateProject(SD.ProjectService.CurrentSolution, cinfo)) {
NewProjectLocation = project.FileName;
}
if (NewProjectLocation != null) {
SolutionFolderNode.Folder.AddExistingProject(NewProjectLocation);
ProjectService.SaveSolution();
}
}
item.Template.RunOpenActions(cinfo);
DialogResult = DialogResult.OK;

57
src/Main/Base/Project/Src/Internal/Templates/Project/ProjectCreateInformation.cs

@ -1,57 +0,0 @@ @@ -1,57 +0,0 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.SharpDevelop.Internal.Templates
{
/// <summary>
/// This class holds all information the language binding need to create
/// a predefined project for their language, if no project template for a
/// specific language is avaiable, the language binding shouldn't care about
/// this stuff.
/// </summary>
public class ProjectCreateInformation
{
internal List<IProject> createdProjects = new List<IProject>();
public ProjectCreateInformation()
: this(new IProject[0])
{
}
public ProjectCreateInformation(IEnumerable<IProject> projects)
{
this.ProjectConfiguration = new ConfigurationAndPlatform("Debug", "AnyCPU");
createdProjects.AddRange(projects);
}
public IReadOnlyList<IProject> CreatedProjects {
get { return createdProjects.AsReadOnly(); }
}
public FileName OutputProjectFileName { get; set; }
public IConfigurationMapping ConfigurationMapping { get; set; }
public ConfigurationAndPlatform ProjectConfiguration { get; set; }
public string ProjectName { get; set; }
public string SolutionName { get; set; }
public string RootNamespace { get; set; }
public DirectoryName SolutionPath { get; set; }
public DirectoryName ProjectBasePath { get; set; }
public TargetFramework TargetFramework { get; set; }
public ISolution Solution { get; set; }
/// <summary>
/// Whether to initialize the type system for the newly created project.
/// The default is <c>false</c> because SharpDevelop saves and re-loads newly created projects,
/// so we don't need a type system if we're going to re-load it anyways.
/// </summary>
public bool InitializeTypeSystem { get; set; }
}
}

77
src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs

@ -43,7 +43,6 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -43,7 +43,6 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
}
string name;
string relativePath;
string defaultPlatform;
/// <summary>
@ -78,11 +77,6 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -78,11 +77,6 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
} else {
name = "${ProjectName}";
}
if (element.HasAttribute("directory")) {
relativePath = element.GetAttribute("directory");
} else {
relativePath = ".";
}
languageName = element.GetAttribute("language");
if (string.IsNullOrEmpty(languageName)) {
ProjectTemplate.WarnAttributeMissing(element, "language");
@ -270,18 +264,12 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -270,18 +264,12 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
#region Create new project from template
//Show prompt, create files from template, create project, execute command, save project
public IProject CreateProject(ProjectCreateInformation projectCreateInformation, string defaultLanguage)
public IProject CreateProject(ISolution parentSolution, ProjectCreateOptions projectCreateOptions, string defaultLanguage)
{
// remember old outerProjectBasePath
var outerProjectBasePath = projectCreateInformation.ProjectBasePath;
var outerProjectName = projectCreateInformation.ProjectName;
IProject project = null;
bool success = false;
try
{
projectCreateInformation.ProjectBasePath = DirectoryName.Create(Path.Combine(projectCreateInformation.ProjectBasePath, GetRelativePath(projectCreateInformation)));
if (!Directory.Exists(projectCreateInformation.ProjectBasePath)) {
Directory.CreateDirectory(projectCreateInformation.ProjectBasePath);
}
string language = string.IsNullOrEmpty(languageName) ? defaultLanguage : languageName;
ProjectBindingDescriptor descriptor = ProjectBindingService.GetCodonPerLanguageName(language);
IProjectBinding languageinfo = (descriptor != null) ? descriptor.Binding : null;
@ -293,10 +281,12 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -293,10 +281,12 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
return null;
}
string newProjectName = StringParser.Parse(name, new StringTagPair("ProjectName", projectCreateInformation.ProjectName));
string projectLocation = Path.GetFullPath(Path.Combine(projectCreateInformation.ProjectBasePath,
newProjectName + ProjectBindingService.GetProjectFileExtension(language)));
DirectoryName projectBasePath = projectCreateOptions.ProjectBasePath;
string newProjectName = StringParser.Parse(name, new StringTagPair("ProjectName", projectCreateOptions.ProjectName));
Directory.CreateDirectory(projectBasePath);
FileName projectLocation = FileName.Create(Path.Combine(projectBasePath,
newProjectName + ProjectBindingService.GetProjectFileExtension(language)));
ProjectCreateInformation info = new ProjectCreateInformation(parentSolution, projectLocation);
StringBuilder standardNamespace = new StringBuilder();
// filter 'illegal' chars from standard namespace
@ -323,15 +313,14 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -323,15 +313,14 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
}
}
projectCreateInformation.OutputProjectFileName = FileName.Create(projectLocation);
projectCreateInformation.RootNamespace = standardNamespace.ToString();
projectCreateInformation.ProjectName = newProjectName;
info.RootNamespace = standardNamespace.ToString();
info.ProjectName = newProjectName;
if (!string.IsNullOrEmpty(defaultPlatform))
projectCreateInformation.ProjectConfiguration = new ConfigurationAndPlatform("Debug", defaultPlatform);
info.ActiveProjectConfiguration = new ConfigurationAndPlatform("Debug", defaultPlatform);
RunPreCreateActions(projectCreateInformation);
RunPreCreateActions(info);
StringParserPropertyContainer.FileCreation["StandardNamespace"] = projectCreateInformation.RootNamespace;
StringParserPropertyContainer.FileCreation["StandardNamespace"] = info.RootNamespace;
if (File.Exists(projectLocation))
{
@ -349,7 +338,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -349,7 +338,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
StringBuilder existingFileNames = new StringBuilder();
foreach (FileDescriptionTemplate file in files)
{
string fileName = Path.Combine(projectCreateInformation.ProjectBasePath, StringParser.Parse(file.Name, new StringTagPair("ProjectName", projectCreateInformation.ProjectName)));
string fileName = Path.Combine(projectBasePath, StringParser.Parse(file.Name, new StringTagPair("ProjectName", info.ProjectName)));
if (File.Exists(fileName))
{
@ -376,7 +365,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -376,7 +365,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
#region Copy files to target directory
foreach (FileDescriptionTemplate file in files)
{
string fileName = Path.Combine(projectCreateInformation.ProjectBasePath, StringParser.Parse(file.Name, new StringTagPair("ProjectName", projectCreateInformation.ProjectName)));
string fileName = Path.Combine(projectBasePath, StringParser.Parse(file.Name, new StringTagPair("ProjectName", info.ProjectName)));
if (File.Exists(fileName) && !overwriteFiles)
{
continue;
@ -393,10 +382,10 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -393,10 +382,10 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
} else {
// Textual content
StreamWriter sr = new StreamWriter(File.Create(fileName), SD.FileService.DefaultFileEncoding);
string fileContent = StringParser.Parse(file.Content,
new StringTagPair("ProjectName", projectCreateInformation.ProjectName),
new StringTagPair("SolutionName", projectCreateInformation.SolutionName),
new StringTagPair("FileName", fileName));
string fileContent = StringParser.Parse(file.Content,
new StringTagPair("ProjectName", projectCreateOptions.ProjectName),
new StringTagPair("SolutionName", projectCreateOptions.SolutionName),
new StringTagPair("FileName", fileName));
fileContent = StringParser.Parse(fileContent);
if (SD.EditorControlService.GlobalOptions.IndentationString != "\t") {
fileContent = fileContent.Replace("\t", SD.EditorControlService.GlobalOptions.IndentationString);
@ -413,10 +402,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -413,10 +402,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
#endregion
#region Create Project
IProject project;
try {
projectCreateInformation.ConfigurationMapping = ((ISolutionInternal)projectCreateInformation.Solution).CreateMappingForNewProject();
project = languageinfo.CreateProject(projectCreateInformation);
project = languageinfo.CreateProject(info);
} catch (ProjectLoadException ex) {
MessageService.ShowError(ex.Message);
return null;
@ -432,8 +419,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -432,8 +419,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
project,
StringParser.Parse(projectItem.ItemType.ItemName),
StringParser.Parse(projectItem.Include,
new StringTagPair("ProjectName", projectCreateInformation.ProjectName),
new StringTagPair("SolutionName", projectCreateInformation.SolutionName))
new StringTagPair("ProjectName", projectCreateOptions.ProjectName),
new StringTagPair("SolutionName", projectCreateOptions.SolutionName))
);
foreach (string metadataName in projectItem.MetadataNames) {
string metadataValue = projectItem.GetMetadata(metadataName);
@ -498,7 +485,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -498,7 +485,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
if (project is IProjectItemListProvider) {
foreach (FileDescriptionTemplate file in files) {
string fileName = Path.Combine(projectCreateInformation.ProjectBasePath, StringParser.Parse(file.Name, new StringTagPair("ProjectName", projectCreateInformation.ProjectName)));
string fileName = Path.Combine(projectBasePath, StringParser.Parse(file.Name, new StringTagPair("ProjectName", projectCreateOptions.ProjectName)));
FileProjectItem projectFile = new FileProjectItem(project, project.GetDefaultItemType(fileName));
projectFile.Include = FileUtility.GetRelativePath(project.Directory, fileName);
@ -519,21 +506,13 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -519,21 +506,13 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
project.Save();
projectCreateInformation.createdProjects.Add(project);
ProjectService.OnProjectCreated(new ProjectEventArgs(project));
success = true;
return project;
} finally {
if (project != null && !success)
project.Dispose();
}
finally
{
// set back outerProjectBasePath
projectCreateInformation.ProjectBasePath = outerProjectBasePath;
projectCreateInformation.ProjectName = outerProjectName;
}
}
string GetRelativePath(ProjectCreateInformation projectCreateInformation)
{
return StringParser.Parse(this.relativePath, new StringTagPair("ProjectName", projectCreateInformation.ProjectName));
}
void RunPreCreateActions(ProjectCreateInformation projectCreateInformation)

65
src/Main/Base/Project/Src/Internal/Templates/Project/ProjectTemplate.cs

@ -19,6 +19,15 @@ using ICSharpCode.SharpDevelop.Project; @@ -19,6 +19,15 @@ using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.SharpDevelop.Internal.Templates
{
public class ProjectCreateOptions
{
public DirectoryName SolutionPath { get; set; }
public DirectoryName ProjectBasePath { get; set; }
public string SolutionName { get; set; }
public string ProjectName { get; set; }
public TargetFramework TargetFramework { get; set; }
}
/// <summary>
/// This class defines and holds the new project templates.
/// </summary>
@ -80,7 +89,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -80,7 +89,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
bool newProjectDialogVisible = true;
List<Action<ProjectCreateInformation>> openActions = new List<Action<ProjectCreateInformation>>();
List<Action<ProjectCreateOptions>> openActions = new List<Action<ProjectCreateOptions>>();
SolutionDescriptor solutionDescriptor = null;
ProjectDescriptor projectDescriptor = null;
@ -231,14 +240,14 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -231,14 +240,14 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
// Read Actions;
if (templateElement["Actions"] != null) {
foreach (XmlElement el in templateElement["Actions"]) {
Action<ProjectCreateInformation> action = ReadAction(el);
Action<ProjectCreateOptions> action = ReadAction(el);
if (action != null)
openActions.Add(action);
}
}
}
static Action<ProjectCreateInformation> ReadAction(XmlElement el)
static Action<ProjectCreateOptions> ReadAction(XmlElement el)
{
switch (el.Name) {
case "Open":
@ -299,42 +308,44 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -299,42 +308,44 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
// string startupProject = null;
public FileName CreateProject(ProjectCreateInformation projectCreateInformation)
public ISolution CreateSolution(ProjectCreateOptions projectCreateInformation)
{
LoggingService.Info("Creating project from template '" + this.Category + "/" + this.Subcategory + "/" + this.Name + "'");
LoggingService.Info("Creating solution from template '" + this.Category + "/" + this.Subcategory + "/" + this.Name + "'");
if (solutionDescriptor != null) {
return FileName.Create(solutionDescriptor.CreateSolution(projectCreateInformation, this.languagename));
} else if (projectDescriptor != null) {
bool createNewSolution = projectCreateInformation.Solution == null;
if (createNewSolution) {
FileName fileName = FileName.Create(Path.Combine(projectCreateInformation.SolutionPath, projectCreateInformation.SolutionName + ".sln"));
projectCreateInformation.Solution = SD.ProjectService.CreateEmptySolutionFile(fileName);
}
IProject project = projectDescriptor.CreateProject(projectCreateInformation, this.languagename);
return solutionDescriptor.CreateSolution(projectCreateInformation, this.languagename);
} else {
FileName fileName = FileName.Create(Path.Combine(projectCreateInformation.SolutionPath, projectCreateInformation.SolutionName + ".sln"));
ISolution solution = SD.ProjectService.CreateEmptySolutionFile(fileName);
IProject project = projectDescriptor.CreateProject(solution, projectCreateInformation, this.languagename);
if (project != null) {
FileName solutionLocation = projectCreateInformation.Solution.FileName;
if (createNewSolution) {
projectCreateInformation.Solution.Items.Add(project);
projectCreateInformation.Solution.Save();
ProjectService.OnSolutionCreated(new SolutionEventArgs(projectCreateInformation.Solution));
projectCreateInformation.Solution.Dispose();
} else {
project.Dispose();
}
return solutionLocation;
solution.Items.Add(project);
solution.Save();
ProjectService.OnSolutionCreated(new SolutionEventArgs(solution));
return solution;
} else {
if (createNewSolution)
projectCreateInformation.Solution.Dispose();
solution.Dispose();
return null;
}
}
}
public IProject CreateProject(ISolution solution, ProjectCreateOptions projectCreateInformation)
{
if (solution == null) {
throw new ArgumentNullException("solution");
}
if (solutionDescriptor != null) {
throw new InvalidOperationException("Cannot create an individual project from a solution template");
} else if (projectDescriptor != null) {
return projectDescriptor.CreateProject(solution, projectCreateInformation, this.languagename);
} else {
return null;
}
}
public void RunOpenActions(ProjectCreateInformation projectCreateInformation)
public void RunOpenActions(ProjectCreateOptions projectCreateInformation)
{
foreach (Action<ProjectCreateInformation> action in openActions) {
foreach (var action in openActions) {
action(projectCreateInformation);
}
}

25
src/Main/Base/Project/Src/Internal/Templates/Project/SolutionDescriptor.cs

@ -36,15 +36,16 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -36,15 +36,16 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
}
}
internal bool AddContents(ISolution solution, ProjectCreateInformation projectCreateInformation, string defaultLanguage, ISolutionFolder parentFolder)
internal bool AddContents(ISolutionFolder parentFolder, ProjectCreateOptions projectCreateOptions, string defaultLanguage)
{
// Create sub projects
foreach (SolutionFolderDescriptor folderDescriptor in solutionFoldersDescriptors) {
ISolutionFolder folder = parentFolder.CreateFolder(folderDescriptor.name);
folderDescriptor.AddContents(solution, projectCreateInformation, defaultLanguage, folder);
if (!folderDescriptor.AddContents(folder, projectCreateOptions, defaultLanguage))
return false;
}
foreach (ProjectDescriptor projectDescriptor in projectDescriptors) {
IProject newProject = projectDescriptor.CreateProject(projectCreateInformation, defaultLanguage);
IProject newProject = projectDescriptor.CreateProject(parentFolder.ParentSolution, projectCreateOptions, defaultLanguage);
if (newProject == null)
return false;
parentFolder.Items.Add(newProject);
@ -65,7 +66,6 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -65,7 +66,6 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
string name;
string startupProject = null;
string relativeDirectory = null;
#region public properties
public string StartupProject {
@ -86,21 +86,15 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -86,21 +86,15 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
this.name = name;
}
public string CreateSolution(ProjectCreateInformation projectCreateInformation, string defaultLanguage)
public ISolution CreateSolution(ProjectCreateOptions projectCreateInformation, string defaultLanguage)
{
if (relativeDirectory != null && relativeDirectory.Length > 0 && relativeDirectory != ".") {
string path = Path.Combine(projectCreateInformation.SolutionPath, relativeDirectory);
Directory.CreateDirectory(path);
}
string newSolutionName = StringParser.Parse(name, new StringTagPair("ProjectName", projectCreateInformation.SolutionName));
string solutionLocation = Path.Combine(projectCreateInformation.SolutionPath, newSolutionName + ".sln");
ISolution newSolution = SD.ProjectService.CreateEmptySolutionFile(FileName.Create(solutionLocation));
projectCreateInformation.Solution = newSolution;
if (!mainFolder.AddContents(newSolution, projectCreateInformation, defaultLanguage, newSolution)) {
if (!mainFolder.AddContents(newSolution, projectCreateInformation, defaultLanguage)) {
newSolution.Dispose();
return null;
}
@ -117,18 +111,13 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -117,18 +111,13 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
newSolution.Save();
}
ProjectService.OnSolutionCreated(new SolutionEventArgs(newSolution));
newSolution.Dispose();
return solutionLocation;
return newSolution;
}
public static SolutionDescriptor CreateSolutionDescriptor(XmlElement element, string hintPath)
{
SolutionDescriptor solutionDescriptor = new SolutionDescriptor(element.Attributes["name"].InnerText);
if (element.Attributes["directory"] != null) {
solutionDescriptor.relativeDirectory = element.Attributes["directory"].InnerText;
}
if (element["Options"] != null && element["Options"]["StartupProject"] != null) {
solutionDescriptor.startupProject = element["Options"]["StartupProject"].InnerText;
}

23
src/Main/Base/Project/Src/Project/AbstractProject.cs

@ -33,28 +33,15 @@ namespace ICSharpCode.SharpDevelop.Project @@ -33,28 +33,15 @@ namespace ICSharpCode.SharpDevelop.Project
// Member documentation: see IProject members.
readonly ISolution parentSolution;
readonly IConfigurationMapping configurationMapping;
readonly ConfigurationMapping configurationMapping;
protected AbstractProject(ProjectCreateInformation information)
protected AbstractProject(ProjectInformation information)
{
if (information == null)
throw new ArgumentNullException("information");
this.parentSolution = information.Solution;
this.configurationMapping = information.ConfigurationMapping;
this.activeConfiguration = information.ProjectConfiguration;
this.Name = information.ProjectName;
this.FileName = information.OutputProjectFileName;
this.idGuid = Guid.NewGuid();
Debug.Assert(configurationMapping != null);
}
protected AbstractProject(ProjectLoadInformation information)
{
if (information == null)
throw new ArgumentNullException("information");
this.parentSolution = information.Solution;
this.configurationMapping = information.ConfigurationMapping;
this.activeConfiguration = information.ProjectConfiguration;
this.activeConfiguration = information.ActiveProjectConfiguration;
this.configurationMapping = information.ConfigurationMapping ?? new ConfigurationMapping();
this.Name = information.ProjectName;
this.FileName = information.FileName;
this.idGuid = information.IdGuid;
@ -260,7 +247,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -260,7 +247,7 @@ namespace ICSharpCode.SharpDevelop.Project
}
}
public IConfigurationMapping ConfigurationMapping {
public ConfigurationMapping ConfigurationMapping {
get { return configurationMapping; }
}
#endregion

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

@ -65,7 +65,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -65,7 +65,7 @@ namespace ICSharpCode.SharpDevelop.Project
/// </summary>
protected readonly ISet<string> reparseCodeSensitiveProperties = new SortedSet<string>();
protected CompilableProject(ICSharpCode.SharpDevelop.Internal.Templates.ProjectCreateInformation information)
protected CompilableProject(ProjectCreateInformation information)
: base(information)
{
this.OutputType = OutputType.Exe;

12
src/Main/Base/Project/Src/Project/Converter/LanguageConverter.cs

@ -29,17 +29,15 @@ namespace ICSharpCode.SharpDevelop.Project.Converter @@ -29,17 +29,15 @@ namespace ICSharpCode.SharpDevelop.Project.Converter
protected virtual IProject CreateProject(DirectoryName targetProjectDirectory, IProject sourceProject)
{
ProjectCreateInformation info = new ProjectCreateInformation();
info.Solution = sourceProject.ParentSolution;
info.ProjectBasePath = targetProjectDirectory;
info.ProjectName = sourceProject.Name + ".Converted";
info.RootNamespace = sourceProject.RootNamespace;
ProjectBindingDescriptor descriptor = ProjectBindingService.GetCodonPerLanguageName(TargetLanguageName);
if (descriptor == null || descriptor.Binding == null)
throw new InvalidOperationException("Cannot get Language Binding for " + TargetLanguageName);
info.OutputProjectFileName = FileName.Create(Path.Combine(targetProjectDirectory, info.ProjectName + descriptor.ProjectFileExtension));
string projectName = sourceProject.Name + ".Converted";
FileName fileName = FileName.Create(Path.Combine(targetProjectDirectory, projectName + descriptor.ProjectFileExtension));
ProjectCreateInformation info = new ProjectCreateInformation(sourceProject.ParentSolution, fileName);
info.RootNamespace = sourceProject.RootNamespace;
return descriptor.Binding.CreateProject(info);
}

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

@ -149,7 +149,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -149,7 +149,7 @@ namespace ICSharpCode.SharpDevelop.Project
/// <summary>
/// Gets the configuration mapping.
/// </summary>
IConfigurationMapping ConfigurationMapping { get; }
ConfigurationMapping ConfigurationMapping { get; }
/// <summary>
/// Saves the project using its current file name.

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

@ -157,16 +157,16 @@ namespace ICSharpCode.SharpDevelop.Project @@ -157,16 +157,16 @@ namespace ICSharpCode.SharpDevelop.Project
this.projectFile = ProjectRootElement.Create(MSBuildProjectCollection);
this.userProjectFile = ProjectRootElement.Create(MSBuildProjectCollection);
projectFile.FullPath = information.OutputProjectFileName;
projectFile.FullPath = information.FileName;
projectFile.ToolsVersion = "4.0";
projectFile.DefaultTargets = "Build";
userProjectFile.FullPath = information.OutputProjectFileName + ".user";
userProjectFile.FullPath = information.FileName + ".user";
projectFile.AddProperty(ProjectGuidPropertyName, IdGuid.ToString("B").ToUpperInvariant());
AddGuardedProperty("Configuration", information.ProjectConfiguration.Configuration);
AddGuardedProperty("Platform", information.ProjectConfiguration.Platform);
AddGuardedProperty("Configuration", information.ActiveProjectConfiguration.Configuration);
AddGuardedProperty("Platform", information.ActiveProjectConfiguration.Platform);
string platform = information.ProjectConfiguration.Platform;
string platform = information.ActiveProjectConfiguration.Platform;
if (platform == "x86")
SetProperty(null, platform, "PlatformTarget", "x86", PropertyStorageLocations.PlatformSpecific, false);
else

55
src/Main/Base/Project/Src/Project/ProjectLoadInformation.cs

@ -1,55 +0,0 @@ @@ -1,55 +0,0 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using ICSharpCode.Core;
namespace ICSharpCode.SharpDevelop.Project
{
/// <summary>
/// Parameter object for loading an existing project.
/// </summary>
public class ProjectLoadInformation
{
public ISolution Solution { get; private set; }
public FileName FileName { get; private set; }
public IConfigurationMapping ConfigurationMapping { get; set; }
public ConfigurationAndPlatform ProjectConfiguration { get; set; }
public List<SolutionSection> ProjectSections { get; set; }
public string ProjectName { get; private set; }
public Guid IdGuid { get; set; }
public Guid TypeGuid { get; set; }
internal bool? upgradeToolsVersion;
IProgressMonitor progressMonitor = new DummyProgressMonitor();
/// <summary>
/// Gets/Sets the progress monitor used during the load.
/// This property never returns null.
/// </summary>
public IProgressMonitor ProgressMonitor {
get { return progressMonitor; }
set {
if (value == null)
throw new ArgumentNullException();
progressMonitor = value;
}
}
public ProjectLoadInformation(ISolution parentSolution, FileName fileName, string projectName)
{
if (parentSolution == null)
throw new ArgumentNullException("parentSolution");
if (fileName == null)
throw new ArgumentNullException("fileName");
if (projectName == null)
throw new ArgumentNullException("projectName");
this.Solution = parentSolution;
this.FileName = fileName;
this.ProjectName = projectName;
this.ProjectSections = new List<SolutionSection>();
}
}
}

7
src/Main/Base/Test/WebReferences/WebReferenceTestHelper.cs

@ -28,12 +28,7 @@ namespace ICSharpCode.SharpDevelop.Tests.WebReferences @@ -28,12 +28,7 @@ namespace ICSharpCode.SharpDevelop.Tests.WebReferences
bool readOnly = false;
public TestProject(string languageName)
: base(new ProjectCreateInformation {
Solution = MockSolution.Create(),
ConfigurationMapping = MockRepository.GenerateStub<IConfigurationMapping>(),
ProjectName = "TestProject",
OutputProjectFileName = FileName.Create("c:\\temp\\TestProject.csproj")
})
: base(new ProjectCreateInformation(MockSolution.Create(), FileName.Create("c:\\temp\\TestProject.csproj")))
{
this.languageName = languageName;
}

85
src/Main/SharpDevelop/Project/Configuration/ConfigurationMapping.cs

@ -1,85 +0,0 @@ @@ -1,85 +0,0 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics;
using System.Linq;
namespace ICSharpCode.SharpDevelop.Project
{
class ConfigurationMapping : IConfigurationMapping
{
class Entry
{
public ConfigurationAndPlatform Config;
public bool Build = true;
public Entry(ConfigurationAndPlatform config)
{
this.Config = config;
}
}
readonly Solution parentSolution;
Dictionary<ConfigurationAndPlatform, Entry> dict = new Dictionary<ConfigurationAndPlatform, Entry>();
public ConfigurationMapping(Solution parentSolution)
{
this.parentSolution = parentSolution;
}
Entry GetEntry(ConfigurationAndPlatform solutionConfiguration)
{
Entry entry;
lock (dict) {
if (!dict.TryGetValue(solutionConfiguration, out entry)) {
var config = new ConfigurationAndPlatform(solutionConfiguration.Configuration, MSBuildInternals.FixPlatformNameForProject(solutionConfiguration.Platform));
entry = new Entry(config);
dict.Add(solutionConfiguration, entry);
}
}
return entry;
}
#region IConfigurationMapping implementation
public ConfigurationAndPlatform GetProjectConfiguration(ConfigurationAndPlatform solutionConfiguration)
{
return GetEntry(solutionConfiguration).Config;
}
public void SetProjectConfiguration(ConfigurationAndPlatform solutionConfiguration, ConfigurationAndPlatform projectConfiguration)
{
Debug.Assert(projectConfiguration.Platform != "Any CPU");
GetEntry(solutionConfiguration).Config = projectConfiguration;
if (parentSolution != null)
parentSolution.IsDirty = true;
}
public bool IsBuildEnabled(ConfigurationAndPlatform solutionConfiguration)
{
return GetEntry(solutionConfiguration).Build;
}
public void SetBuildEnabled(ConfigurationAndPlatform solutionConfiguration, bool value)
{
GetEntry(solutionConfiguration).Build = value;
if (parentSolution != null)
parentSolution.IsDirty = true;
}
#endregion
public void RenameSolutionConfig(string oldName, string newName, bool isPlatform)
{
throw new NotImplementedException();
lock (dict) {
foreach (var pair in dict.ToArray()) {
if (oldName == (isPlatform ? pair.Key.Platform : pair.Key.Configuration)) {
}
}
}
}
}
}

3
src/Main/SharpDevelop/Project/Configuration/SolutionConfigurationOrPlatformNameCollection.cs

@ -66,7 +66,8 @@ namespace ICSharpCode.SharpDevelop.Project @@ -66,7 +66,8 @@ namespace ICSharpCode.SharpDevelop.Project
if (pos < 0)
throw new ArgumentException();
foreach (var project in solution.Projects) {
((ConfigurationMapping)project.ConfigurationMapping).RenameSolutionConfig(oldName, newName, isPlatform);
throw new NotImplementedException();
//project.ConfigurationMapping.RenameSolutionConfig(oldName, newName, isPlatform);
}
this[pos] = newName;
}

11
src/Main/SharpDevelop/Project/Solution.cs

@ -12,7 +12,7 @@ using ICSharpCode.SharpDevelop.Workbench; @@ -12,7 +12,7 @@ using ICSharpCode.SharpDevelop.Workbench;
namespace ICSharpCode.SharpDevelop.Project
{
class Solution : SolutionFolder, ISolution, ISolutionInternal
class Solution : SolutionFolder, ISolution
{
FileName fileName;
DirectoryName directory;
@ -475,15 +475,6 @@ namespace ICSharpCode.SharpDevelop.Project @@ -475,15 +475,6 @@ namespace ICSharpCode.SharpDevelop.Project
}
#endregion
#region ISolutionInternal implementation
IConfigurationMapping ISolutionInternal.CreateMappingForNewProject()
{
return new ConfigurationMapping(this);
}
#endregion
public override string ToString()
{
return "[Solution " + fileName + " with " + projects.Count + " projects]";

2
src/Main/SharpDevelop/Project/SolutionFolder.cs

@ -135,8 +135,6 @@ namespace ICSharpCode.SharpDevelop.Project @@ -135,8 +135,6 @@ namespace ICSharpCode.SharpDevelop.Project
public IProject AddExistingProject(FileName fileName)
{
ProjectLoadInformation loadInfo = new ProjectLoadInformation(parentSolution, fileName, fileName.GetFileNameWithoutExtension());
loadInfo.ConfigurationMapping = new ConfigurationMapping(parentSolution);
loadInfo.ProjectConfiguration = loadInfo.ConfigurationMapping.GetProjectConfiguration(parentSolution.ActiveConfiguration);
var descriptor = ProjectBindingService.GetCodonPerProjectFile(fileName);
if (descriptor != null) {
loadInfo.TypeGuid = descriptor.Guid;

5
src/Main/SharpDevelop/Project/SolutionLoader.cs

@ -136,7 +136,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -136,7 +136,7 @@ namespace ICSharpCode.SharpDevelop.Project
solutionItem = solutionFolderDict[projectInfo.IdGuid];
} else {
// Load project:
projectInfo.ProjectConfiguration = projectInfo.ConfigurationMapping.GetProjectConfiguration(solution.ActiveConfiguration);
projectInfo.ActiveProjectConfiguration = projectInfo.ConfigurationMapping.GetProjectConfiguration(solution.ActiveConfiguration);
progress.TaskName = "Loading " + projectInfo.ProjectName;
using (projectInfo.ProgressMonitor = progress.CreateSubTask(1.0 / projectCount)) {
solutionItem = ProjectBindingService.LoadProject(projectInfo);
@ -229,7 +229,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -229,7 +229,7 @@ namespace ICSharpCode.SharpDevelop.Project
#region ReadProjectEntry
static readonly Regex projectLinePattern = new Regex("^\\s*Project\\(\"(?<TypeGuid>.*)\"\\)\\s+=\\s+\"(?<Title>.*)\",\\s*\"(?<Location>.*)\",\\s*\"(?<IdGuid>.*)\"\\s*$");
public ProjectLoadInformation ReadProjectEntry(Solution parentSolution)
public ProjectLoadInformation ReadProjectEntry(ISolution parentSolution)
{
if (currentLine == null)
return null;
@ -243,7 +243,6 @@ namespace ICSharpCode.SharpDevelop.Project @@ -243,7 +243,6 @@ namespace ICSharpCode.SharpDevelop.Project
var loadInformation = new ProjectLoadInformation(parentSolution, projectFileName, title);
loadInformation.TypeGuid = Guid.Parse(match.Groups["TypeGuid"].Value);
loadInformation.IdGuid = Guid.Parse(match.Groups["IdGuid"].Value);
loadInformation.ConfigurationMapping = new ConfigurationMapping(parentSolution);
SolutionSection section;
while ((section = ReadSection(isGlobal: false)) != null) {
loadInformation.ProjectSections.Add(section);

1
src/Main/SharpDevelop/SharpDevelop.csproj

@ -128,7 +128,6 @@ @@ -128,7 +128,6 @@
<Compile Include="Project\Configuration\AddNewConfigurationDialog.Designer.cs">
<DependentUpon>AddNewConfigurationDialog.cs</DependentUpon>
</Compile>
<Compile Include="Project\Configuration\ConfigurationMapping.cs" />
<Compile Include="Project\Configuration\EditAvailableConfigurationsDialog.cs" />
<Compile Include="Project\Configuration\EditAvailableConfigurationsDialog.Designer.cs">
<DependentUpon>EditAvailableConfigurationsDialog.cs</DependentUpon>

Loading…
Cancel
Save