Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'net45' into master.

We decided to add the .NET 4.5 support to SharpDevelop 4.2
instead of SharpDevelop 4.3.

This merge reverts commit 599f60c "Set version number to 4.3".
  • Loading branch information...
commit db7fec5e5b5f86f8050fb7329f12630ebe25f186 2 parents 05d79e0 + d783e3f
@dgrunwald dgrunwald authored
Showing with 339 additions and 110 deletions.
  1. +1 −1  SharpDevelop.sln
  2. +7 −1 samples/ILAsmBinding/ILAsmBinding.sln
  3. +16 −1 {src/Libraries/ICSharpCode.Build.Tasks/Project → samples/ILAsmBinding/ILAsmBuildTask}/ILAsm.cs
  4. +64 −0 samples/ILAsmBinding/ILAsmBuildTask/ILAsmBuildTask.csproj
  5. +31 −0 samples/ILAsmBinding/ILAsmBuildTask/Properties/AssemblyInfo.cs
  6. +2 −2 ...SharpCode.Build.Tasks/Project → samples/ILAsmBinding/ILAsmBuildTask}/SharpDevelop.Build.Common.targets
  7. +3 −3 ...ICSharpCode.Build.Tasks/Project → samples/ILAsmBinding/ILAsmBuildTask}/SharpDevelop.Build.MSIL.targets
  8. +8 −4 samples/ILAsmBinding/Project/ILAsmBinding.addin
  9. +1 −8 samples/ILAsmBinding/Project/Resources/ILAsm-Mode.xshd
  10. +1 −1  samples/ILAsmBinding/Project/Src/ILAsmProject.cs
  11. +8 −2 src/AddIns/BackendBindings/CSharpBinding/Project/Src/Project/CSharpProject.cs
  12. +2 −1  src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataCollector.csproj
  13. +0 −13 src/Libraries/ICSharpCode.Build.Tasks/Project/Constants.cs
  14. +11 −13 src/Libraries/ICSharpCode.Build.Tasks/Project/ICSharpCode.Build.Tasks.csproj
  15. +2 −1  src/Libraries/ICSharpCode.Build.Tasks/Project/ICSharpCode.Build.Tasks.csproj.user
  16. +0 −26 src/Libraries/ICSharpCode.Build.Tasks/Project/MyToolTask.cs
  17. +2 −0  src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  18. +1 −1  src/Main/Base/Project/Src/Gui/Dialogs/NewProjectDialog.cs
  19. +1 −1  src/Main/Base/Project/Src/Project/Behaviors/DefaultProjectBehavior.cs
  20. +7 −1 src/Main/Base/Project/Src/Project/Behaviors/DotNetStartBehavior.cs
  21. +2 −0  src/Main/Base/Project/Src/Project/Converter/IUpgradableProject.cs
  22. +13 −10 src/Main/Base/Project/Src/Project/Converter/UpgradeView.xaml.cs
  23. +51 −1 src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs
  24. +6 −1 src/Main/Base/Project/Src/Project/MSBuildEngine/MSBuildEngine.cs
  25. +2 −0  src/Main/Base/Project/Src/Project/ProjectLoadInformation.cs
  26. +31 −0 src/Main/Base/Project/Src/Project/ProjectUpgradeException.cs
  27. +29 −3 src/Main/Base/Project/Src/Project/TargetFramework.cs
  28. +29 −0 src/Main/Base/Project/Src/Util/DotnetDetection.cs
  29. +1 −3 src/Setup/Files.wxs
  30. +0 −6 src/Setup/Setup.wxs
  31. +4 −3 src/Tools/UpdateAssemblyInfo/UpdateAssemblyInfo.csproj
  32. +3 −3 src/Tools/UpdateAssemblyInfo/UpdateAssemblyInfo.sln
View
2  SharpDevelop.sln
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
-# SharpDevelop 4.3.0.8538-net45-alpha
+# SharpDevelop 4.2.0.8590-beta
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Main", "Main", "{256F5C28-532C-44C0-8AB8-D8EC5E492E01}"
ProjectSection(SolutionItems) = postProject
EndProjectSection
View
8 samples/ILAsmBinding/ILAsmBinding.sln
@@ -1,9 +1,11 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
-# SharpDevelop 4.0.0.6209
+# SharpDevelop 4.2.0.8590-beta
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ILAsmBinding", "Project\ILAsmBinding.csproj", "{6e59af58-f635-459a-9a35-c9ac41c00339}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ILAsmBuildTask", "ILAsmBuildTask\ILAsmBuildTask.csproj", "{77827AD7-1023-4352-A7E8-5CC3CE8FB133}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -20,5 +22,9 @@ Global
{6E59AF58-F635-459A-9A35-C9AC41C00339}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6E59AF58-F635-459A-9A35-C9AC41C00339}.Release|Any CPU.Build.0 = Release|Any CPU
{6E59AF58-F635-459A-9A35-C9AC41C00339}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {77827AD7-1023-4352-A7E8-5CC3CE8FB133}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {77827AD7-1023-4352-A7E8-5CC3CE8FB133}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {77827AD7-1023-4352-A7E8-5CC3CE8FB133}.Release|Any CPU.Build.0 = Release|Any CPU
+ {77827AD7-1023-4352-A7E8-5CC3CE8FB133}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
EndGlobal
View
17 ...ibraries/ICSharpCode.Build.Tasks/Project/ILAsm.cs → samples/ILAsmBinding/ILAsmBuildTask/ILAsm.cs
@@ -2,13 +2,14 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
+using System.Globalization;
using System.IO;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace ICSharpCode.Build.Tasks
{
- public sealed class ILAsm : MyToolTask
+ public sealed class ILAsm : ToolTask
{
ITaskItem outputAssembly;
ITaskItem[] sources;
@@ -116,6 +117,20 @@ public sealed class ILAsm : MyToolTask
}
}
+ protected override string GenerateFullPathToTool()
+ {
+ string path = ToolLocationHelper.GetPathToDotNetFrameworkFile(ToolName, TargetDotNetFrameworkVersion.VersionLatest);
+ if (path == null) {
+ base.Log.LogErrorWithCodeFromResources("General.FrameworksFileNotFound", ToolName, ToolLocationHelper.GetDotNetFrameworkVersionFolderPrefix(TargetDotNetFrameworkVersion.VersionLatest));
+ }
+ return path;
+ }
+
+ void AppendIntegerSwitch(CommandLineBuilder commandLine, string @switch, int value)
+ {
+ commandLine.AppendSwitchUnquotedIfNotNull(@switch, value.ToString(NumberFormatInfo.InvariantInfo));
+ }
+
protected override string GenerateCommandLineCommands()
{
CommandLineBuilder commandLine = new CommandLineBuilder();
View
64 samples/ILAsmBinding/ILAsmBuildTask/ILAsmBuildTask.csproj
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
+ <PropertyGroup>
+ <ProjectGuid>{77827AD7-1023-4352-A7E8-5CC3CE8FB133}</ProjectGuid>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <OutputType>Library</OutputType>
+ <RootNamespace>ILAsmBuildTask</RootNamespace>
+ <AssemblyName>ILAsmBuildTask</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <OutputPath>..\..\..\AddIns\Samples\ILAsmBinding\</OutputPath>
+ <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
+ <NoStdLib>False</NoStdLib>
+ <WarningLevel>4</WarningLevel>
+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <RegisterForComInterop>False</RegisterForComInterop>
+ <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
+ <BaseAddress>4194304</BaseAddress>
+ <FileAlignment>4096</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>Full</DebugType>
+ <Optimize>False</Optimize>
+ <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
+ <DebugSymbols>False</DebugSymbols>
+ <DebugType>None</DebugType>
+ <Optimize>True</Optimize>
+ <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
+ <DefineConstants>TRACE</DefineConstants>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.Build.Framework" />
+ <Reference Include="Microsoft.Build.Utilities.v4.0" />
+ <Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="ILAsm.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="SharpDevelop.Build.Common.targets">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="SharpDevelop.Build.MSIL.targets">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
+</Project>
View
31 samples/ILAsmBinding/ILAsmBuildTask/Properties/AssemblyInfo.cs
@@ -0,0 +1,31 @@
+#region Using directives
+
+using System;
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+#endregion
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("ILAsmBuildTask")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("ILAsmBuildTask")]
+[assembly: AssemblyCopyright("Copyright 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// This sets the default COM visibility of types in the assembly to invisible.
+// If you need to expose a type to COM, use [ComVisible(true)] on that type.
+[assembly: ComVisible(false)]
+
+// The assembly version has following format :
+//
+// Major.Minor.Build.Revision
+//
+// You can specify all the values or you can use the default the Revision and
+// Build Numbers by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.*")]
View
4 ...d.Tasks/Project/SharpDevelop.Build.Common.targets → .../ILAsmBuildTask/SharpDevelop.Build.Common.targets
@@ -1,10 +1,10 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Base file for compilers in custom backend bindinds -->
- <UsingTask TaskName="Microsoft.Build.Tasks.CreateVisualBasicManifestResourceName" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
+ <UsingTask TaskName="Microsoft.Build.Tasks.CreateVisualBasicManifestResourceName" AssemblyName="Microsoft.Build.Tasks, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<PropertyGroup>
- <MSBuildAllProjects>$(MSBuildAllProjects);$(SharpDevelopBuildBinPath)\SharpDevelop.Build.Common.targets</MSBuildAllProjects>
+ <MSBuildAllProjects>$(MSBuildAllProjects);$(ILAsmAddInPath)\SharpDevelop.Build.Common.targets</MSBuildAllProjects>
</PropertyGroup>
<PropertyGroup>
View
6 ...ild.Tasks/Project/SharpDevelop.Build.MSIL.targets → ...ng/ILAsmBuildTask/SharpDevelop.Build.MSIL.targets
@@ -1,8 +1,8 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <UsingTask TaskName="ICSharpCode.Build.Tasks.ILAsm" AssemblyFile="$(SharpDevelopBinPath)\ICSharpCode.Build.Tasks.dll"/>
+ <UsingTask TaskName="ICSharpCode.Build.Tasks.ILAsm" AssemblyFile="$(ILAsmAddInPath)\ILAsmBuildTask.dll"/>
<PropertyGroup>
- <MSBuildAllProjects>$(MSBuildAllProjects);$(SharpDevelopBinPath)\SharpDevelop.Build.MSIL.targets</MSBuildAllProjects>
+ <MSBuildAllProjects>$(MSBuildAllProjects);$(ILAsmAddInPath)\SharpDevelop.Build.MSIL.targets</MSBuildAllProjects>
<DefaultLanguageSourceExtension>.il</DefaultLanguageSourceExtension>
<Language>ILAsm</Language>
</PropertyGroup>
@@ -37,5 +37,5 @@
/>
</Target>
- <Import Project="$(SharpDevelopBinPath)\SharpDevelop.Build.Common.targets" />
+ <Import Project="$(ILAsmAddInPath)\SharpDevelop.Build.Common.targets" />
</Project>
View
12 samples/ILAsmBinding/Project/ILAsmBinding.addin
@@ -28,6 +28,10 @@
extensions = "*.ilproj"/>
</Path>
+ <Path name = "/SharpDevelop/MSBuildEngine/AdditionalProperties">
+ <String id="ILAsmAddInPath" text = "${AddInPath:ICSharpCode.ILAsmBinding}"/>
+ </Path>
+
<Path name = "/SharpDevelop/MSBuildEngine/CompileTaskNames">
<!-- Makes SharpDevelop show the text 'Compiling ProjectName...' when the task is started -->
<String id="ilasm" text = "ilasm"/>
@@ -59,9 +63,9 @@
<Path name = "/SharpDevelop/Workbench/ProjectBindings">
<ProjectBinding id = "ILAsm"
- guid = "{12B76EC0-1D7B-4FA7-A7D0-C524288B48A1}"
- supportedextensions = ".il"
- projectfileextension = ".ilproj"
- class = "ICSharpCode.ILAsmBinding.ILAsmProjectBinding" />
+ guid = "{12B76EC0-1D7B-4FA7-A7D0-C524288B48A1}"
+ supportedextensions = ".il"
+ projectfileextension = ".ilproj"
+ class = "ICSharpCode.ILAsmBinding.ILAsmProjectBinding" />
</Path>
</AddIn>
View
9 samples/ILAsmBinding/Project/Resources/ILAsm-Mode.xshd
@@ -1,9 +1,6 @@
<SyntaxDefinition name="ILAsm" extensions=".il" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
<Color name="Comment" foreground="Green" exampleText="// comment" />
<Color name="String" foreground="Magenta" exampleText="&quot;Hello, World!&quot;" />
- <Color name="Punctuation" foreground="DarkGreen" exampleText="a(b.c);" />
- <Color name="NumberLiteral" foreground="DarkBlue" exampleText="3.1415" />
- <Color name="MethodCall" foreground="MidnightBlue" fontWeight="bold" exampleText="o.ToString();" />
<Color name="Instructions" foreground="Blue" exampleText="nop;" />
<Color name="Keywords" foreground="Blue" fontWeight="bold" exampleText="true" />
<Color name="Directives" foreground="Green" fontWeight="bold" exampleText=".class" />
@@ -351,6 +348,7 @@
<Word>tls</Word>
<Word>true</Word>
<Word>false</Word>
+ <Word>strict</Word>
</Keywords>
<Keywords color="Directives">
<Word>.class</Word>
@@ -506,11 +504,6 @@
<Begin>"</Begin>
<End>"</End>
</Span>
- <Rule color="MethodCall">[\d\w_]+(?=(\s*\())</Rule>
- <Rule color="NumberLiteral">\b0[xX][0-9a-fA-F]+|\b(\d+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?</Rule>
- <!--<Rule color="Punctuation">
- [?,.;()\[\]{}+\-/%*&lt;&gt;^+~!|&amp;]+
- </Rule>-->
</RuleSet>
<RuleSet name="CommentMarkerSet" ignoreCase="false">
<Keywords foreground="#FFFF0000" fontWeight="bold">
View
2  samples/ILAsmBinding/Project/Src/ILAsmProject.cs
@@ -23,7 +23,7 @@ public ILAsmProject(ProjectLoadInformation info)
public ILAsmProject(ProjectCreateInformation info)
: base(info)
{
- this.AddImport(@"$(SharpDevelopBinPath)\SharpDevelop.Build.MSIL.Targets", null);
+ this.AddImport(@"$(ILAsmAddInPath)\SharpDevelop.Build.MSIL.Targets", null);
}
public override string Language {
View
10 src/AddIns/BackendBindings/CSharpBinding/Project/Src/Project/CSharpProject.cs
@@ -82,7 +82,7 @@ public override void StartBuild(ProjectBuildOptions options, IBuildFeedbackSink
static readonly CompilerVersion msbuild20 = new CompilerVersion(new Version(2, 0), "C# 2.0");
static readonly CompilerVersion msbuild35 = new CompilerVersion(new Version(3, 5), "C# 3.0");
- static readonly CompilerVersion msbuild40 = new CompilerVersion(new Version(4, 0), "C# 4.0");
+ static readonly CompilerVersion msbuild40 = new CompilerVersion(new Version(4, 0), DotnetDetection.IsDotnet45Installed() ? "C# 5.0" : "C# 4.0");
public override CompilerVersion CurrentCompilerVersion {
get {
@@ -101,7 +101,13 @@ public override void StartBuild(ProjectBuildOptions options, IBuildFeedbackSink
public override IEnumerable<CompilerVersion> GetAvailableCompilerVersions()
{
- return new[] { msbuild20, msbuild35, msbuild40 };
+ List<CompilerVersion> versions = new List<CompilerVersion>();
+ if (DotnetDetection.IsDotnet35SP1Installed()) {
+ versions.Add(msbuild20);
+ versions.Add(msbuild35);
+ }
+ versions.Add(msbuild40);
+ return versions;
}
/*
View
3  src/AddIns/Misc/UsageDataCollector/UsageDataCollector/UsageDataCollector.csproj
@@ -7,7 +7,7 @@
<OutputType>Library</OutputType>
<RootNamespace>ICSharpCode.UsageDataCollector</RootNamespace>
<AssemblyName>UsageDataCollector</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<OutputPath>..\..\..\..\..\AddIns\Misc\UsageDataCollector\</OutputPath>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
@@ -15,6 +15,7 @@
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<DocumentationFile>..\..\..\..\..\AddIns\Misc\UsageDataCollector\UsageDataCollector.xml</DocumentationFile>
<NoWarn>1591</NoWarn>
+ <TargetFrameworkProfile>Client</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<PlatformTarget>x86</PlatformTarget>
View
13 src/Libraries/ICSharpCode.Build.Tasks/Project/Constants.cs
@@ -1,13 +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 Microsoft.Build.Utilities;
-
-namespace ICSharpCode.Build.Tasks
-{
- public class Constants
- {
- public const TargetDotNetFrameworkVersion DefaultFramework = TargetDotNetFrameworkVersion.Version20;
- }
-}
View
24 src/Libraries/ICSharpCode.Build.Tasks/Project/ICSharpCode.Build.Tasks.csproj
@@ -19,7 +19,9 @@
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<RunCodeAnalysis>False</RunCodeAnalysis>
<SourceAnalysisOverrideSettingsFile>C:\Users\Daniel\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis</SourceAnalysisOverrideSettingsFile>
- <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <TargetFrameworkProfile>
+ </TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>..\..\..\..\bin\</OutputPath>
@@ -40,25 +42,21 @@
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="Microsoft.Build.Framework" />
+ <Reference Include="Microsoft.Build.Utilities.v4.0" />
<Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
<Reference Include="System.Xml" />
- <Reference Include="Microsoft.Build.Framework" />
- <Reference Include="Microsoft.Build.Utilities" />
- <Reference Include="Microsoft.Build.Tasks" />
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="CopyLocalWorkaround.cs" />
- <Compile Include="ILAsm.cs" />
- <None Include="SharpDevelop.Build.MSIL.targets">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <None Include="SharpDevelop.Build.Common.targets">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- <Compile Include="Constants.cs" />
<Compile Include="KnownFrameworkAssemblies.cs" />
- <Compile Include="MyToolTask.cs" />
<Compile Include="..\..\..\Main\GlobalAssemblyInfo.cs">
<Link>GlobalAssemblyInfo.cs</Link>
</Compile>
View
3  src/Libraries/ICSharpCode.Build.Tasks/Project/ICSharpCode.Build.Tasks.csproj.user
@@ -1 +1,2 @@
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
+<?xml version="1.0" encoding="utf-8"?>
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0" />
View
26 src/Libraries/ICSharpCode.Build.Tasks/Project/MyToolTask.cs
@@ -1,26 +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.Globalization;
-using Microsoft.Build.Utilities;
-
-namespace ICSharpCode.Build.Tasks
-{
- public abstract class MyToolTask : ToolTask
- {
- protected override string GenerateFullPathToTool()
- {
- string path = ToolLocationHelper.GetPathToDotNetFrameworkFile(ToolName, Constants.DefaultFramework);
- if (path == null) {
- base.Log.LogErrorWithCodeFromResources("General.FrameworksFileNotFound", ToolName, ToolLocationHelper.GetDotNetFrameworkVersionFolderPrefix(Constants.DefaultFramework));
- }
- return path;
- }
-
- protected void AppendIntegerSwitch(CommandLineBuilder commandLine, string @switch, int value)
- {
- commandLine.AppendSwitchUnquotedIfNotNull(@switch, value.ToString(NumberFormatInfo.InvariantInfo));
- }
- }
-}
View
2  src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
@@ -371,6 +371,7 @@
<Compile Include="Src\Project\ProjectStartException.cs" />
<Compile Include="Src\Project\ProjectLoadException.cs" />
<Compile Include="Src\Project\ProjectPropertyChangedEventArgs.cs" />
+ <Compile Include="Src\Project\ProjectUpgradeException.cs" />
<Compile Include="Src\Project\Solution\Project_TypeGuids.cs" />
<Compile Include="Src\Project\TargetFramework.cs" />
<Compile Include="Src\Services\Debugger\BreakpointBookmark.cs" />
@@ -792,6 +793,7 @@
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\AsyncDiscoveryState.cs" />
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\DiscoveryNetworkCredential.cs" />
<Compile Include="Src\Services\ProjectService\ProjectLoader.cs" />
+ <Compile Include="Src\Util\DotnetDetection.cs" />
<Compile Include="Src\Util\FakeXmlViewContent.cs" />
<Compile Include="Src\Util\ReactiveExtensions.cs" />
<Compile Include="Src\Util\TreeNode.cs" />
View
2  src/Main/Base/Project/Src/Gui/Dialogs/NewProjectDialog.cs
@@ -164,7 +164,7 @@ protected void CategoryChange(object sender, TreeViewEventArgs e)
targetFrameworkComboBox.Items.Clear();
if (categoryTreeView.SelectedNode != null) {
foreach (TargetFramework fx in TargetFramework.TargetFrameworks) {
- if (fx.DisplayName == null)
+ if (fx.DisplayName == null || !fx.IsAvailable())
continue;
foreach (TemplateItem item in ((Category)categoryTreeView.SelectedNode).Templates) {
if (item.Template.HasSupportedTargetFrameworks && item.Template.SupportsTargetFramework(fx)) {
View
2  src/Main/Base/Project/Src/Project/Behaviors/DefaultProjectBehavior.cs
@@ -74,7 +74,7 @@ public override void ProjectCreationComplete()
public override IEnumerable<CompilerVersion> GetAvailableCompilerVersions()
{
- yield break;
+ return Enumerable.Empty<CompilerVersion>();
}
public override void UpgradeProject(CompilerVersion newVersion, TargetFramework newFramework)
View
8 src/Main/Base/Project/Src/Project/Behaviors/DotNetStartBehavior.cs
@@ -126,7 +126,13 @@ public override ItemType GetDefaultItemType(string fileName)
public override IEnumerable<CompilerVersion> GetAvailableCompilerVersions()
{
- return new[] { CompilerVersion.MSBuild20, CompilerVersion.MSBuild35, CompilerVersion.MSBuild40 };
+ List<CompilerVersion> versions = new List<CompilerVersion>();
+ if (DotnetDetection.IsDotnet35SP1Installed()) {
+ versions.Add(CompilerVersion.MSBuild20);
+ versions.Add(CompilerVersion.MSBuild35);
+ }
+ versions.Add(CompilerVersion.MSBuild40);
+ return versions;
}
public override void UpgradeProject(CompilerVersion newVersion, TargetFramework newFramework)
View
2  src/Main/Base/Project/Src/Project/Converter/IUpgradableProject.cs
@@ -43,6 +43,7 @@ public interface IUpgradableProject
/// </summary>
/// <param name="newVersion">The new compiler version. If this property is null, the compiler version is not changed.</param>
/// <param name="newFramework">The new target framework. If this property is null, the target framework is not changed.</param>
+ /// <exception cref="ProjectUpgradeException">Upgrading the project failed.</exception>
void UpgradeProject(CompilerVersion newVersion, TargetFramework newFramework);
}
@@ -60,6 +61,7 @@ public virtual IEnumerable<TargetFramework> GetSupportedTargetFrameworks()
return from fx in TargetFramework.TargetFrameworks
where fx.MinimumMSBuildVersion != null
where MSBuildVersion >= fx.MinimumMSBuildVersion
+ where fx.IsAvailable()
select fx;
}
View
23 src/Main/Base/Project/Src/Project/Converter/UpgradeView.xaml.cs
@@ -7,7 +7,6 @@
using System.Linq;
using System.Windows;
using System.Windows.Controls;
-
using ICSharpCode.Core.Presentation;
namespace ICSharpCode.SharpDevelop.Project.Converter
@@ -130,16 +129,13 @@ void UpdateTargetFrameworkComboBox()
// -> available target frameworks is the intersection of all compiler's target framework,
// and "Do not change" is always available
- var supportedTargetFrameworks =
+ availableFrameworks = (
from Entry entry in listView.SelectedItems
where entry.CompilerVersion != null
- select entry.CompilerVersion.GetSupportedTargetFrameworks();
+ from fx in entry.CompilerVersion.GetSupportedTargetFrameworks()
+ select fx
+ ).Distinct().ToList();
- if (supportedTargetFrameworks.Any()) {
- availableFrameworks = supportedTargetFrameworks.Aggregate((a, b) => a.Intersect(b)).ToList();
- } else {
- availableFrameworks = new List<TargetFramework>();
- }
doNotChangeAllowed = true;
} else {
// Specific compiler version is selected
@@ -181,7 +177,8 @@ void UpdateTargetFrameworkComboBox()
TargetFramework oldSelectedFramework = newFrameworkComboBox.SelectedValue as TargetFramework;
if (!newFrameworkSelectionSetByUser || oldSelectedFramework == null) {
newFrameworkSelectionSetByUser = false;
- newFrameworkComboBox.SelectedValue = frameworkUsedByAllProjects;
+ if (availableFrameworks.Contains(frameworkUsedByAllProjects))
+ newFrameworkComboBox.SelectedValue = frameworkUsedByAllProjects;
}
newFrameworkSelectionChangingByCode = false;
UpdateConvertButtonEnabled();
@@ -233,8 +230,14 @@ void convertButton_Click(object sender, RoutedEventArgs e)
foreach (Entry entry in listView.SelectedItems) {
- entry.UpgradeProject(selectedCompiler, selectedFramework);
+ try {
+ entry.UpgradeProject(selectedCompiler, selectedFramework);
+ } catch (ProjectUpgradeException ex) {
+ Core.MessageService.ShowError("Cannot upgrade '" + entry.Name + "': " + ex.Message);
+ break;
+ }
}
+
solution.Save();
UpdateCompilerComboBox();
}
View
52 src/Main/Base/Project/Src/Project/MSBuildBasedProject.cs
@@ -125,6 +125,7 @@ protected internal void SetToolsVersion(string newToolsVersion)
projectFile.ToolsVersion = newToolsVersion;
userProjectFile.ToolsVersion = newToolsVersion;
});
+
if (MinimumSolutionVersionChanged != null)
MinimumSolutionVersionChanged(this, EventArgs.Empty);
}
@@ -1157,7 +1158,13 @@ public MSBuildBasedProject(ProjectLoadInformation loadInformation)
this.Name = loadInformation.ProjectName;
isLoading = true;
try {
- LoadProjectInternal(loadInformation);
+ try {
+ LoadProjectInternal(loadInformation);
+ } catch (InvalidProjectFileException ex) {
+ if (!(ex.ErrorCode == "MSB4132" && UpgradeToolsVersion(loadInformation))) {
+ throw;
+ }
+ }
} catch (InvalidProjectFileException ex) {
LoggingService.Warn(ex);
LoggingService.Warn("ErrorCode = " + ex.ErrorCode);
@@ -1168,6 +1175,46 @@ public MSBuildBasedProject(ProjectLoadInformation loadInformation)
}
}
+ const string autoUpgradeNewToolsVersion = "4.0";
+
+ bool UpgradeToolsVersion(ProjectLoadInformation loadInformation)
+ {
+ if (loadInformation.upgradeToolsVersion != null)
+ return false;
+ if (!CanUpgradeToolsVersion())
+ return false;
+ loadInformation.ProgressMonitor.ShowingDialog = true;
+ StringTagPair[] tags = {
+ new StringTagPair("ProjectName", loadInformation.ProjectName),
+ new StringTagPair("OldToolsVersion", projectFile.ToolsVersion),
+ new StringTagPair("NewToolsVersion", autoUpgradeNewToolsVersion)
+ };
+ string message = StringParser.Parse("${res:ICSharpCode.SharpDevelop.Project.UpgradeView.UpdateOnLoadDueToMissingMSBuild}", tags);
+ string upgradeButton = StringParser.Parse("${res:ICSharpCode.SharpDevelop.Project.UpgradeView.UpdateToMSBuildButton}", tags);
+ int result = MessageService.ShowCustomDialog(
+ "${res:ICSharpCode.SharpDevelop.Project.UpgradeView.Title}",
+ message,
+ 0, 1, upgradeButton, "${res:Global.CancelButtonText}");
+ loadInformation.ProgressMonitor.ShowingDialog = false;
+ if (result == 0) {
+ loadInformation.upgradeToolsVersion = true;
+ LoadProjectInternal(loadInformation);
+ return true;
+ } else {
+ loadInformation.upgradeToolsVersion = false;
+ return false;
+ }
+ }
+
+ bool CanUpgradeToolsVersion()
+ {
+ if (projectFile == null)
+ return false;
+ if (string.IsNullOrEmpty(projectFile.ToolsVersion))
+ return true;
+ return projectFile.ToolsVersion == "2.0" || projectFile.ToolsVersion == "3.5";
+ }
+
void LoadProjectInternal(ProjectLoadInformation loadInformation)
{
this.projectCollection = loadInformation.ParentSolution.MSBuildProjectCollection;
@@ -1175,6 +1222,9 @@ void LoadProjectInternal(ProjectLoadInformation loadInformation)
this.ActivePlatform = loadInformation.Platform;
projectFile = ProjectRootElement.Open(loadInformation.FileName, projectCollection);
+ if (loadInformation.upgradeToolsVersion == true && CanUpgradeToolsVersion()) {
+ projectFile.ToolsVersion = autoUpgradeNewToolsVersion;
+ }
string userFileName = loadInformation.FileName + ".user";
if (File.Exists(userFileName)) {
View
7 src/Main/Base/Project/Src/Project/MSBuildEngine/MSBuildEngine.cs
@@ -265,7 +265,12 @@ void StartBuild()
}
if (projectMinimumSolutionVersion <= Solution.SolutionVersionVS2008) {
- BuildWorkerManager.MSBuild35.RunBuildJob(job, loggerChain, OnDone, feedbackSink.ProgressMonitor.CancellationToken);
+ if (DotnetDetection.IsDotnet35SP1Installed()) {
+ BuildWorkerManager.MSBuild35.RunBuildJob(job, loggerChain, OnDone, feedbackSink.ProgressMonitor.CancellationToken);
+ } else {
+ loggerChain.HandleError(new BuildError(job.ProjectFileName, ".NET 3.5 SP1 is required to build this project."));
+ OnDone(false);
+ }
} else {
BuildWorkerManager.MSBuild40.RunBuildJob(job, loggerChain, OnDone, feedbackSink.ProgressMonitor.CancellationToken);
}
View
2  src/Main/Base/Project/Src/Project/ProjectLoadInformation.cs
@@ -19,6 +19,8 @@ public class ProjectLoadInformation
public IList<ProjectSection> ProjectSections {get; set;}
internal string Guid { get; set; }
+ internal bool? upgradeToolsVersion;
+
Gui.IProgressMonitor progressMonitor = new Gui.DummyProgressMonitor();
/// <summary>
View
31 src/Main/Base/Project/Src/Project/ProjectUpgradeException.cs
@@ -0,0 +1,31 @@
+// 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.Runtime.Serialization;
+
+namespace ICSharpCode.SharpDevelop.Project
+{
+ /// <summary>
+ /// This exception occurs when upgrading a project fails.
+ /// </summary>
+ [Serializable]
+ public class ProjectUpgradeException : Exception
+ {
+ public ProjectUpgradeException() : base()
+ {
+ }
+
+ public ProjectUpgradeException(string message) : base(message)
+ {
+ }
+
+ public ProjectUpgradeException(string message, Exception innerException) : base(message, innerException)
+ {
+ }
+
+ protected ProjectUpgradeException(SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ }
+ }
+}
View
32 src/Main/Base/Project/Src/Project/TargetFramework.cs
@@ -9,7 +9,9 @@ public class TargetFramework
{
public readonly static TargetFramework Net20 = new TargetFramework("v2.0", ".NET Framework 2.0") {
SupportedRuntimeVersion = "v2.0.50727",
- MinimumMSBuildVersion = new Version(2, 0)
+ MinimumMSBuildVersion = new Version(2, 0),
+ // .NET 2.0/3.0/3.5 can only be used if .NET 3.5 SP1 is installed
+ IsAvailable = DotnetDetection.IsDotnet35SP1Installed
};
public readonly static TargetFramework Net30 = new TargetFramework("v3.0", ".NET Framework 3.0") {
SupportedRuntimeVersion = "v2.0.50727",
@@ -28,14 +30,26 @@ public class TargetFramework
BasedOn = Net35,
MinimumMSBuildVersion = new Version(4, 0),
SupportedSku = ".NETFramework,Version=v4.0",
- RequiresAppConfigEntry = true
+ RequiresAppConfigEntry = true,
+ IsAvailable = DotnetDetection.IsDotnet40Installed
};
public readonly static TargetFramework Net40Client = new ClientProfileTargetFramework(Net40) {
BasedOn = Net35Client
};
+ public readonly static TargetFramework Net45 = new TargetFramework("v4.5", ".NET Framework 4.5") {
+ BasedOn = Net40,
+ MinimumMSBuildVersion = new Version(4, 0),
+ SupportedRuntimeVersion = "v4.0",
+ SupportedSku = ".NETFramework,Version=v4.5",
+ RequiresAppConfigEntry = true,
+ IsAvailable = DotnetDetection.IsDotnet45Installed
+ };
+ public readonly static TargetFramework Net45Client = new ClientProfileTargetFramework(Net45) {
+ BasedOn = Net40Client
+ };
public readonly static TargetFramework[] TargetFrameworks = {
- Net40, Net40Client, Net35, Net35Client, Net30, Net20
+ Net45, Net45Client, Net40, Net40Client, Net35, Net35Client, Net30, Net20
};
public readonly static TargetFramework DefaultTargetFramework = Net40Client;
@@ -56,6 +70,12 @@ public TargetFramework(string name, string displayName)
this.name = name;
this.displayName = displayName;
this.SupportedRuntimeVersion = name;
+ this.IsAvailable = delegate {
+ if (this.BasedOn != null)
+ return this.BasedOn.IsAvailable();
+ else
+ return true;
+ };
}
public string Name {
@@ -67,6 +87,11 @@ public TargetFramework(string name, string displayName)
}
/// <summary>
+ /// Function that determines if this target framework is available.
+ /// </summary>
+ public Func<bool> IsAvailable { get; set; }
+
+ /// <summary>
/// Supported runtime version string for app.config
/// </summary>
public string SupportedRuntimeVersion { get; set; }
@@ -118,6 +143,7 @@ public ClientProfileTargetFramework(TargetFramework fullFramework)
this.FullFramework = fullFramework;
this.SupportedRuntimeVersion = fullFramework.SupportedRuntimeVersion;
this.MinimumMSBuildVersion = fullFramework.MinimumMSBuildVersion;
+ this.IsAvailable = fullFramework.IsAvailable;
if (fullFramework.SupportedSku != null)
this.SupportedSku = fullFramework.SupportedSku + ",Profile=Client";
else
View
29 src/Main/Base/Project/Src/Util/DotnetDetection.cs
@@ -0,0 +1,29 @@
+// 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 Microsoft.Win32;
+
+namespace ICSharpCode.SharpDevelop
+{
+ public class DotnetDetection
+ {
+ public static bool IsDotnet35SP1Installed()
+ {
+ using (var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5")) {
+ return key != null && (key.GetValue("SP") as int?) >= 1;
+ }
+ }
+
+ public static bool IsDotnet40Installed()
+ {
+ return true; // required for SD to run
+ }
+
+ public static bool IsDotnet45Installed()
+ {
+ Version dotnet45Beta = new Version(4, 0, 30319, 17379);
+ return Environment.Version >= dotnet45Beta;
+ }
+ }
+}
View
4 src/Setup/Files.wxs
@@ -153,9 +153,7 @@
<Component Id="ICSharpCodeBuildTasksDll" Guid="E94FCC8C-9741-45EF-AFDA-9F9CF02BF3F7" DiskId="1">
<File Source="..\..\bin\ICSharpCode.Build.Tasks.dll" Id="ICSharpCode.Build.Tasks.dll" Name="ICSharpCode.Build.Tasks.dll" Assembly=".net" AssemblyApplication="ICSharpCode.Build.Tasks.dll" AssemblyManifest="ICSharpCode.Build.Tasks.dll" KeyPath="yes" />
</Component>
- <Component Id="BuildTasksTargetFiles" DiskId="1" Guid="55F82461-DEED-43BB-8A79-7243B762EA60">
- <File Source="..\..\bin\SharpDevelop.Build.Common.targets" Id="SharpDevelop.Build.Common.targets" Name="SharpDevelop.Build.Common.targets" />
- <File Source="..\..\bin\SharpDevelop.Build.MSIL.targets" Id="SharpDevelop.Build.MSIL.targets" Name="SharpDevelop.Build.MSIL.targets" />
+ <Component Id="BuildTasksTargetFiles" DiskId="1" Guid="8BA49EB8-394B-4357-8CB8-638A1AB83E54">
<File Source="..\..\bin\SharpDevelop.CodeAnalysis.targets" Id="SharpDevelop.CodeAnalysis.targets" Name="SharpDevelop.CodeAnalysis.targets" />
<File Source="..\..\bin\SharpDevelop.CheckMSBuild35Features.targets" Id="SharpDevelop.CheckMSBuild35Features.targets" Name="SharpDevelop.CheckMSBuild35Features.targets" />
<File Source="..\..\bin\SharpDevelop.TargetingPack.targets" Id="SharpDevelop.TargetingPack.targets" Name="SharpDevelop.TargetingPack.targets" />
View
6 src/Setup/Setup.wxs
@@ -68,12 +68,6 @@
Installed OR NETFRAMEWORK40FULL
</Condition>
- <!-- Unfortunately we also require .NET 3.5 SP1 at the moment -->
- <PropertyRef Id="NETFRAMEWORK35_SP_LEVEL" />
- <Condition Message="This setup requires the .NET Framework 3.5 SP1 to be installed (Yes, you need both .NET 4.0 and 3.5 SP1. Sorry.)">
- Installed OR NETFRAMEWORK35_SP_LEVEL = "#1"
- </Condition>
-
<!--
Check for C++ 2008 Runtime (we accept any 2008 runtime version).
We only need the VC9 CRT, but unfortunately I couldn't find any way to detect if that is installed.
View
7 src/Tools/UpdateAssemblyInfo/UpdateAssemblyInfo.csproj
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<OutputType>Exe</OutputType>
<RootNamespace>UpdateAssemblyInfo</RootNamespace>
@@ -18,9 +18,10 @@
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<NoWarn>1607</NoWarn>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<SourceAnalysisOverrideSettingsFile>C:\Users\Daniel\AppData\Roaming\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis</SourceAnalysisOverrideSettingsFile>
<StartArguments>--REVISION</StartArguments>
+ <TargetFrameworkProfile>Client</TargetFrameworkProfile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
@@ -59,5 +60,5 @@
<Compile Include="Main.cs" />
<None Include="Readme.txt" />
</ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSHARP.Targets" />
</Project>
View
6 src/Tools/UpdateAssemblyInfo/UpdateAssemblyInfo.sln
@@ -1,7 +1,7 @@

-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-# SharpDevelop 3.0.0.2967
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+# SharpDevelop 4.2.0.8004-alpha
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UpdateAssemblyInfo", "UpdateAssemblyInfo.csproj", "{605C8CDB-F0AD-4A21-9F4A-959B8DECB0F3}"
EndProject
Global
Please sign in to comment.
Something went wrong with that request. Please try again.