Browse Source

Create library projects as AnyCPU; use x86 only for applications.

pull/24/merge
Daniel Grunwald 13 years ago
parent
commit
10161f9647
  1. 2
      data/templates/project/CSharp/ConsoleProject.xpt
  2. 2
      data/templates/project/CSharp/FormsProject.xpt
  3. 2
      data/templates/project/CSharp/NotifyIcon.xpt
  4. 2
      data/templates/project/CSharp/Service.xpt
  5. 2
      data/templates/project/CSharp/WPFApplication.xpt
  6. 2
      data/templates/project/CSharp/WPFNavigationApplication.xpt
  7. 24
      data/templates/project/ComplexExample.xpt.test
  8. 2
      data/templates/project/VB/ConsoleProject.xpt
  9. 2
      data/templates/project/VB/FormsProject.xpt
  10. 2
      data/templates/project/VB/NotifyIcon.xpt
  11. 2
      data/templates/project/VB/Service.xpt
  12. 2
      data/templates/project/VB/WPFApplication.xpt
  13. 2
      data/templates/project/VB/WPFNavigationApplication.xpt
  14. 2
      src/Main/Base/Project/Src/Internal/Templates/Project/ProjectCreateInformation.cs
  15. 4
      src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs
  16. 5
      src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs

2
data/templates/project/CSharp/ConsoleProject.xpt

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
</Actions>
<!-- Template Content -->
<Project language = "C#">
<Project language = "C#" defaultPlatform="x86">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />

2
data/templates/project/CSharp/FormsProject.xpt

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
<Open filename = "MainForm.cs"/>
</Actions>
<Project language = "C#">
<Project language = "C#" defaultPlatform="x86">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />

2
data/templates/project/CSharp/NotifyIcon.xpt

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
<Open filename = "NotificationIcon.cs"/>
</Actions>
<Project language="C#">
<Project language="C#" defaultPlatform="x86">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />

2
data/templates/project/CSharp/Service.xpt

@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
</Actions>
<!-- Template Content -->
<Project language = "C#">
<Project language = "C#" defaultPlatform="x86">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Configuration.Install" />

2
data/templates/project/CSharp/WPFApplication.xpt

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
<Open filename = "Window1.xaml"/>
</Actions>
<Project language = "C#">
<Project language = "C#" defaultPlatform="x86">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />

2
data/templates/project/CSharp/WPFNavigationApplication.xpt

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
<Open filename = "Page1.xaml"/>
</Actions>
<Project language = "C#">
<Project language = "C#" defaultPlatform="x86">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />

24
data/templates/project/ComplexExample.xpt.test

@ -16,6 +16,8 @@ @@ -16,6 +16,8 @@
<!-- Actions -->
<Actions>
<Open filename = "Main.cs"/>
<!-- Runs a command from the AddIn Tree. ICommand.Owner will be the ProjectCreateInformation -->
<RunCommand path = "/SharpDevelop/BackendBindings/TemplateCommands/PostCreationAction"/>
</Actions>
<!-- Template Content -->
@ -33,7 +35,17 @@ @@ -33,7 +35,17 @@
<!-- Solution folders can contain: nested solution folders and projects -->
<SolutionFolder name = "Nested Sub Folder"/>
<Project name = "VBNetProject" directory = "VBNetSubProject" language="VBNet">
<Project name = "VBNetProject" directory = "VBNetSubProject" language="VBNet" defaultPlatform="x86">
<!-- Actions that get executed before the project is created. ICommand.Owner will be the ProjectCreateInformation. -->
<PreCreateActions>
<RunCommand path = "/SharpDevelop/BackendBindings/TemplateCommands/CheckPortableLibraryInstalled"/>
</PreCreateActions>
<!-- Actions that get executed after the project was created. ICommand.Owner will be the IProject. -->
<CreateActions>
<RunCommand path = "/SharpDevelop/BackendBindings/TemplateCommands/PostCreationAction"/>
</CreateActions>
<!-- add a PropertyGroup to the project to set MSBuild properties -->
<PropertyGroup>
<OutputType>WinExe</OutputType>
@ -123,15 +135,7 @@ End Class @@ -123,15 +135,7 @@ End Class
</Project>
</SolutionFolder>
<Project name = "${ProjectName}" directory = "." language = "C#">
<PreCreateActions>
<RunCommand path = "/SharpDevelop/BackendBindings/TemplateCommands/CheckPortableLibraryInstalled"/>
</PreCreateActions>
<CreateActions>
<RunCommand path = "/SharpDevelop/BackendBindings/TemplateCommands/PostCreationAction_Owner_Is_IProject"/>
</CreateActions>
<Project name = "${ProjectName}" directory = "." language = "C#" defaultPlatform="AnyCPU">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />

2
data/templates/project/VB/ConsoleProject.xpt

@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
<!-- Template Content -->
<Project language = "VBNet">
<Project language = "VBNet" defaultPlatform="x86">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />

2
data/templates/project/VB/FormsProject.xpt

@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
</Actions>
<!-- Template Content -->
<Project language="VBNet">
<Project language="VBNet" defaultPlatform="x86">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>

2
data/templates/project/VB/NotifyIcon.xpt

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
<Open filename = "NotificationIcon.vb"/>
</Actions>
<Project language="VBNet">
<Project language="VBNet" defaultPlatform="x86">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />

2
data/templates/project/VB/Service.xpt

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
<Open filename = "${ProjectName}.vb"/>
</Actions>
<Project language="VBNet">
<Project language="VBNet" defaultPlatform="x86">
<PropertyGroup>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>

2
data/templates/project/VB/WPFApplication.xpt

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
<Open filename = "Window1.xaml"/>
</Actions>
<Project language = "VBNet">
<Project language = "VBNet" defaultPlatform="x86">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />

2
data/templates/project/VB/WPFNavigationApplication.xpt

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
<Open filename = "Page1.xaml"/>
</Actions>
<Project language = "VBNet">
<Project language = "VBNet" defaultPlatform="x86">
<ProjectItems>
<Reference Include="System" />
<Reference Include="System.Data" />

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

@ -27,7 +27,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -27,7 +27,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
public ProjectCreateInformation(IEnumerable<IProject> projects)
{
Platform = "x86";
Platform = "AnyCPU";
createdProjects.AddRange(projects);
}

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

@ -42,6 +42,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -42,6 +42,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
string name;
string relativePath;
string defaultPlatform;
/// <summary>
/// The language of the project.
@ -84,6 +85,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -84,6 +85,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
if (string.IsNullOrEmpty(languageName)) {
ProjectTemplate.WarnAttributeMissing(element, "language");
}
defaultPlatform = element.GetAttribute("defaultPlatform");
LoadElementChildren(element, hintPath);
}
@ -323,6 +325,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates @@ -323,6 +325,8 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates
projectCreateInformation.OutputProjectFileName = projectLocation;
projectCreateInformation.RootNamespace = standardNamespace.ToString();
projectCreateInformation.ProjectName = newProjectName;
if (!string.IsNullOrEmpty(defaultPlatform))
projectCreateInformation.Platform = defaultPlatform;
RunPreCreateActions(projectCreateInformation);

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

@ -177,7 +177,10 @@ namespace ICSharpCode.SharpDevelop.Project @@ -177,7 +177,10 @@ namespace ICSharpCode.SharpDevelop.Project
this.ActiveConfiguration = "Debug";
this.ActivePlatform = information.Platform;
SetProperty(null, information.Platform, "PlatformTarget", "x86", PropertyStorageLocations.PlatformSpecific, false);
if (information.Platform == "x86")
SetProperty(null, information.Platform, "PlatformTarget", "x86", PropertyStorageLocations.PlatformSpecific, false);
else
SetProperty(null, information.Platform, "PlatformTarget", "AnyCPU", PropertyStorageLocations.PlatformSpecific, false);
}
/// <summary>

Loading…
Cancel
Save