From 5d68029091ee1be13c1311b7834fd2d40db4e567 Mon Sep 17 00:00:00 2001 From: Matt Ward Date: Mon, 9 Jan 2006 23:34:50 +0000 Subject: [PATCH] Added support for Mono's GAC. Added Gtk# and Glade# project templates. Project templates can now clear any imports added by default. Improved code completion for Mono GAC assemblies with dependencies. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@983 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../file/CSharp/CSharp.Gtk.Window.xft | 45 +++ .../templates/project/CSharp/GladeProject.xpt | 139 ++++++++ data/templates/project/CSharp/GtkProject.xpt | 110 ++++++ .../templates/project/ComplexExample.xpt.test | 3 +- .../BooBinding/Project/Src/AssemblyInfo.cs | 2 +- .../Project/AssemblyInfo.cs | 2 +- .../Boo/StandaloneConverter/AssemblyInfo.cs | 2 +- .../CPPNetBinding/Project/Src/AssemblyInfo.cs | 2 +- .../Project/Configuration/AssemblyInfo.cs | 2 +- .../ILAsmBinding/Project/Src/AssemblyInfo.cs | 2 +- .../Project/Configuration/AssemblyInfo.cs | 2 +- .../WixBinding/Project/Src/AssemblyInfo.cs | 2 +- .../Project/Configuration/AssemblyInfo.cs | 2 +- .../Project/Configuration/AssemblyInfo.cs | 2 +- .../Project/Configuration/AssemblyInfo.cs | 2 +- .../Project/Configuration/AssemblyInfo.cs | 2 +- .../XmlEditor/Test/AssemblyInfo.cs | 2 +- .../Project/Configuration/AssemblyInfo.cs | 2 +- .../AddinScout/Project/Src/AssemblyInfo.cs | 2 +- .../Project/Configuration/AssemblyInfo.cs | 2 +- .../Project/Configuration/AssemblyInfo.cs | 2 +- .../Project/Configuration/AssemblyInfo.cs | 2 +- .../Project/Configuration/AssemblyInfo.cs | 2 +- .../Project/Configuration/AssemblyInfo.cs | 2 +- .../Project/Configuration/AssemblyInfo.cs | 2 +- .../Project/Configuration/AssemblyInfo.cs | 2 +- src/AddIns/Misc/MonoAddIn/MonoAddIn.sln | 58 ++++ .../Project/Configuration/AssemblyInfo.cs | 39 +++ .../Misc/MonoAddIn/Project/MonoAddIn.addin | 36 ++ .../Misc/MonoAddIn/Project/MonoAddIn.csproj | 81 +++++ .../Project/Src/AddMonoReferenceCommand.cs | 49 +++ .../Project/Src/IsMonoInstalledCondition.cs | 24 ++ .../Project/Src/IsMonoProjectCondition.cs | 29 ++ .../Project/Src/MonoGacReferencePanel.cs | 30 ++ .../Project/Src/MonoProjectContentLoader.cs | 134 ++++++++ .../Project/Src/SelectMonoReferenceDialog.cs | 314 ++++++++++++++++++ .../Project/Configuration/AssemblyInfo.cs | 39 +++ .../Project/MonoReflectionLoader.csproj | 63 ++++ .../Project/Src/MonoReflectionLoader.cs | 73 ++++ .../Misc/NAntAddIn/ConsoleApp/AssemblyInfo.cs | 2 +- .../Project/Configuration/AssemblyInfo.cs | 2 +- .../Misc/NAntAddIn/Test/AssemblyInfo.cs | 2 +- .../Project/Configuration/AssemblyInfo.cs | 2 +- .../Project/Configuration/AssemblyInfo.cs | 2 +- .../Project/Configuration/AssemblyInfo.cs | 2 +- .../Project/Configuration/AssemblyInfo.cs | 2 +- .../Project/AddMonoAssemblySearchPaths.cs | 123 +++++++ .../Project/AssemblyInfo.cs | 2 +- .../Project/GetMonoFrameworkPath.cs | 81 +++++ .../Project/GetMonoFrameworkSdkPath.cs | 47 +++ .../Project/ICSharpCode.Build.Tasks.csproj | 7 + .../Project/MonoAssemblyName.cs | 196 +++++++++++ .../Project/MonoGacDirectory.cs | 119 +++++++ .../Project/MonoGlobalAssemblyCache.cs | 122 +++++++ .../Project/MonoToolLocationHelper.cs | 120 ++++++- .../SharpDevelop.Build.Mono.Gmcs.targets | 56 +++- .../SharpDevelop.Build.Mono.Mcs.targets | 62 +++- .../Project/TargetMonoFrameworkVersion.cs | 18 + .../Test/AssemblyInfo.cs | 2 +- .../Project/Configuration/AssemblyInfo.cs | 2 +- .../Test/AssemblyInfo.cs | 2 +- .../NRefactoryASTGenerator/AssemblyInfo.cs | 2 +- .../Project/Configuration/AssemblyInfo.cs | 2 +- src/Libraries/NRefactory/Test/AssemblyInfo.cs | 2 +- .../Project/Configuration/AssemblyInfo.cs | 2 +- .../ReferenceDialog/AssemblyReferencePanel.cs | 4 +- .../ReferenceDialog/COMReferencePanel.cs | 4 +- .../ReferenceDialog/GacReferencePanel.cs | 6 +- .../ReferenceDialog/ProjectReferencePanel.cs | 4 +- .../ReferenceDialog/SelectReferenceDialog.cs | 7 +- .../Templates/Project/ProjectDescriptor.cs | 7 + .../ParserService/ProjectContentRegistry.cs | 8 + src/Main/Base/Test/AssemblyInfo.cs | 2 +- .../Project/Configuration/AssemblyInfo.cs | 2 +- src/Main/Core/Test/AssemblyInfo.cs | 2 +- .../StartUp/Project/SharpDevelop.exe.config | 8 +- src/SharpDevelop.sln | 16 +- 77 files changed, 2282 insertions(+), 79 deletions(-) create mode 100644 data/templates/file/CSharp/CSharp.Gtk.Window.xft create mode 100644 data/templates/project/CSharp/GladeProject.xpt create mode 100644 data/templates/project/CSharp/GtkProject.xpt create mode 100644 src/AddIns/Misc/MonoAddIn/MonoAddIn.sln create mode 100644 src/AddIns/Misc/MonoAddIn/Project/Configuration/AssemblyInfo.cs create mode 100644 src/AddIns/Misc/MonoAddIn/Project/MonoAddIn.addin create mode 100644 src/AddIns/Misc/MonoAddIn/Project/MonoAddIn.csproj create mode 100644 src/AddIns/Misc/MonoAddIn/Project/Src/AddMonoReferenceCommand.cs create mode 100644 src/AddIns/Misc/MonoAddIn/Project/Src/IsMonoInstalledCondition.cs create mode 100644 src/AddIns/Misc/MonoAddIn/Project/Src/IsMonoProjectCondition.cs create mode 100644 src/AddIns/Misc/MonoAddIn/Project/Src/MonoGacReferencePanel.cs create mode 100644 src/AddIns/Misc/MonoAddIn/Project/Src/MonoProjectContentLoader.cs create mode 100644 src/AddIns/Misc/MonoAddIn/Project/Src/SelectMonoReferenceDialog.cs create mode 100644 src/AddIns/Misc/MonoReflectionLoader/Project/Configuration/AssemblyInfo.cs create mode 100644 src/AddIns/Misc/MonoReflectionLoader/Project/MonoReflectionLoader.csproj create mode 100644 src/AddIns/Misc/MonoReflectionLoader/Project/Src/MonoReflectionLoader.cs create mode 100644 src/Libraries/ICSharpCode.Build.Tasks/Project/AddMonoAssemblySearchPaths.cs create mode 100644 src/Libraries/ICSharpCode.Build.Tasks/Project/GetMonoFrameworkPath.cs create mode 100644 src/Libraries/ICSharpCode.Build.Tasks/Project/GetMonoFrameworkSdkPath.cs create mode 100644 src/Libraries/ICSharpCode.Build.Tasks/Project/MonoAssemblyName.cs create mode 100644 src/Libraries/ICSharpCode.Build.Tasks/Project/MonoGacDirectory.cs create mode 100644 src/Libraries/ICSharpCode.Build.Tasks/Project/MonoGlobalAssemblyCache.cs create mode 100644 src/Libraries/ICSharpCode.Build.Tasks/Project/TargetMonoFrameworkVersion.cs diff --git a/data/templates/file/CSharp/CSharp.Gtk.Window.xft b/data/templates/file/CSharp/CSharp.Gtk.Window.xft new file mode 100644 index 0000000000..a31b2fae2a --- /dev/null +++ b/data/templates/file/CSharp/CSharp.Gtk.Window.xft @@ -0,0 +1,45 @@ + + diff --git a/data/templates/project/CSharp/GladeProject.xpt b/data/templates/project/CSharp/GladeProject.xpt new file mode 100644 index 0000000000..24eb30fb09 --- /dev/null +++ b/data/templates/project/CSharp/GladeProject.xpt @@ -0,0 +1,139 @@ + + diff --git a/data/templates/project/CSharp/GtkProject.xpt b/data/templates/project/CSharp/GtkProject.xpt new file mode 100644 index 0000000000..f5667dfe30 --- /dev/null +++ b/data/templates/project/CSharp/GtkProject.xpt @@ -0,0 +1,110 @@ + + diff --git a/data/templates/project/ComplexExample.xpt.test b/data/templates/project/ComplexExample.xpt.test index 09e4f40fad..4925bb14d7 100644 --- a/data/templates/project/ComplexExample.xpt.test +++ b/data/templates/project/ComplexExample.xpt.test @@ -63,7 +63,8 @@ - + + diff --git a/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/AssemblyInfo.cs b/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/AssemblyInfo.cs index b58c325882..a91cb789c7 100644 --- a/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/AssemblyInfo.cs +++ b/src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/AssemblyInfo.cs @@ -30,4 +30,4 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] diff --git a/src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Project/AssemblyInfo.cs b/src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Project/AssemblyInfo.cs index 38d4b5b744..5b18337589 100644 --- a/src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Project/AssemblyInfo.cs +++ b/src/AddIns/BackendBindings/Boo/NRefactoryToBooConverter/Project/AssemblyInfo.cs @@ -29,4 +29,4 @@ using System.Runtime.CompilerServices; // // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] diff --git a/src/AddIns/BackendBindings/Boo/StandaloneConverter/AssemblyInfo.cs b/src/AddIns/BackendBindings/Boo/StandaloneConverter/AssemblyInfo.cs index 73b51df727..8041b3302e 100644 --- a/src/AddIns/BackendBindings/Boo/StandaloneConverter/AssemblyInfo.cs +++ b/src/AddIns/BackendBindings/Boo/StandaloneConverter/AssemblyInfo.cs @@ -30,4 +30,4 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] diff --git a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/AssemblyInfo.cs b/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/AssemblyInfo.cs index 3ee3fc7ef1..55b7720d4f 100644 --- a/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/AssemblyInfo.cs +++ b/src/AddIns/BackendBindings/CPPNetBinding/Project/Src/AssemblyInfo.cs @@ -23,7 +23,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/Configuration/AssemblyInfo.cs b/src/AddIns/BackendBindings/CSharpBinding/Project/Configuration/AssemblyInfo.cs index a55c472b34..1619b14cc0 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/Configuration/AssemblyInfo.cs +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/Configuration/AssemblyInfo.cs @@ -30,7 +30,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/AddIns/BackendBindings/ILAsmBinding/Project/Src/AssemblyInfo.cs b/src/AddIns/BackendBindings/ILAsmBinding/Project/Src/AssemblyInfo.cs index 0949e98b6a..187579f283 100644 --- a/src/AddIns/BackendBindings/ILAsmBinding/Project/Src/AssemblyInfo.cs +++ b/src/AddIns/BackendBindings/ILAsmBinding/Project/Src/AssemblyInfo.cs @@ -23,7 +23,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/AddIns/BackendBindings/VBNetBinding/Project/Configuration/AssemblyInfo.cs b/src/AddIns/BackendBindings/VBNetBinding/Project/Configuration/AssemblyInfo.cs index 46f5f23799..2ca06f1a60 100644 --- a/src/AddIns/BackendBindings/VBNetBinding/Project/Configuration/AssemblyInfo.cs +++ b/src/AddIns/BackendBindings/VBNetBinding/Project/Configuration/AssemblyInfo.cs @@ -30,7 +30,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/AddIns/BackendBindings/WixBinding/Project/Src/AssemblyInfo.cs b/src/AddIns/BackendBindings/WixBinding/Project/Src/AssemblyInfo.cs index fa918ce8bc..236d812cae 100644 --- a/src/AddIns/BackendBindings/WixBinding/Project/Src/AssemblyInfo.cs +++ b/src/AddIns/BackendBindings/WixBinding/Project/Src/AssemblyInfo.cs @@ -23,7 +23,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/AddIns/DisplayBindings/AssemblyScout/Project/Configuration/AssemblyInfo.cs b/src/AddIns/DisplayBindings/AssemblyScout/Project/Configuration/AssemblyInfo.cs index 55f1b1d07a..1787221895 100644 --- a/src/AddIns/DisplayBindings/AssemblyScout/Project/Configuration/AssemblyInfo.cs +++ b/src/AddIns/DisplayBindings/AssemblyScout/Project/Configuration/AssemblyInfo.cs @@ -22,7 +22,7 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] diff --git a/src/AddIns/DisplayBindings/FormsDesigner/Project/Configuration/AssemblyInfo.cs b/src/AddIns/DisplayBindings/FormsDesigner/Project/Configuration/AssemblyInfo.cs index a791b82d4c..b392d36848 100644 --- a/src/AddIns/DisplayBindings/FormsDesigner/Project/Configuration/AssemblyInfo.cs +++ b/src/AddIns/DisplayBindings/FormsDesigner/Project/Configuration/AssemblyInfo.cs @@ -30,7 +30,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/AddIns/DisplayBindings/ResourceEditor/Project/Configuration/AssemblyInfo.cs b/src/AddIns/DisplayBindings/ResourceEditor/Project/Configuration/AssemblyInfo.cs index 9aaa66cc2a..ea9ffd00c2 100644 --- a/src/AddIns/DisplayBindings/ResourceEditor/Project/Configuration/AssemblyInfo.cs +++ b/src/AddIns/DisplayBindings/ResourceEditor/Project/Configuration/AssemblyInfo.cs @@ -30,7 +30,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/AddIns/DisplayBindings/XmlEditor/Project/Configuration/AssemblyInfo.cs b/src/AddIns/DisplayBindings/XmlEditor/Project/Configuration/AssemblyInfo.cs index 6a55c44982..15fc605e09 100644 --- a/src/AddIns/DisplayBindings/XmlEditor/Project/Configuration/AssemblyInfo.cs +++ b/src/AddIns/DisplayBindings/XmlEditor/Project/Configuration/AssemblyInfo.cs @@ -30,7 +30,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/AddIns/DisplayBindings/XmlEditor/Test/AssemblyInfo.cs b/src/AddIns/DisplayBindings/XmlEditor/Test/AssemblyInfo.cs index f2a377273b..52e01af718 100644 --- a/src/AddIns/DisplayBindings/XmlEditor/Test/AssemblyInfo.cs +++ b/src/AddIns/DisplayBindings/XmlEditor/Test/AssemblyInfo.cs @@ -30,7 +30,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/AddIns/Misc/AddInManager/Project/Configuration/AssemblyInfo.cs b/src/AddIns/Misc/AddInManager/Project/Configuration/AssemblyInfo.cs index 34b17aa3a2..dc3efb1977 100644 --- a/src/AddIns/Misc/AddInManager/Project/Configuration/AssemblyInfo.cs +++ b/src/AddIns/Misc/AddInManager/Project/Configuration/AssemblyInfo.cs @@ -30,4 +30,4 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] diff --git a/src/AddIns/Misc/AddinScout/Project/Src/AssemblyInfo.cs b/src/AddIns/Misc/AddinScout/Project/Src/AssemblyInfo.cs index 84bd67a7bb..5e99c1083a 100644 --- a/src/AddIns/Misc/AddinScout/Project/Src/AssemblyInfo.cs +++ b/src/AddIns/Misc/AddinScout/Project/Src/AssemblyInfo.cs @@ -30,7 +30,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Configuration/AssemblyInfo.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Configuration/AssemblyInfo.cs index 8d9146de58..148a312159 100644 --- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Configuration/AssemblyInfo.cs +++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Configuration/AssemblyInfo.cs @@ -33,7 +33,7 @@ using System.Runtime.CompilerServices; // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // // In order to sign your assembly you must specify a key to use. Refer to the diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Configuration/AssemblyInfo.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Configuration/AssemblyInfo.cs index 23ca3c44f4..0958f18a92 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Configuration/AssemblyInfo.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Configuration/AssemblyInfo.cs @@ -33,7 +33,7 @@ using System.Runtime.CompilerServices; // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // // In order to sign your assembly you must specify a key to use. Refer to the diff --git a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Configuration/AssemblyInfo.cs b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Configuration/AssemblyInfo.cs index 7bb422b90d..f274be794f 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Configuration/AssemblyInfo.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Tests/Project/Configuration/AssemblyInfo.cs @@ -30,4 +30,4 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] diff --git a/src/AddIns/Misc/FiletypeRegisterer/Project/Configuration/AssemblyInfo.cs b/src/AddIns/Misc/FiletypeRegisterer/Project/Configuration/AssemblyInfo.cs index 00bf05c6d2..320186451b 100644 --- a/src/AddIns/Misc/FiletypeRegisterer/Project/Configuration/AssemblyInfo.cs +++ b/src/AddIns/Misc/FiletypeRegisterer/Project/Configuration/AssemblyInfo.cs @@ -30,7 +30,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/AddIns/Misc/HighlightingEditor/Project/Configuration/AssemblyInfo.cs b/src/AddIns/Misc/HighlightingEditor/Project/Configuration/AssemblyInfo.cs index c7928bbb68..d37673ec72 100644 --- a/src/AddIns/Misc/HighlightingEditor/Project/Configuration/AssemblyInfo.cs +++ b/src/AddIns/Misc/HighlightingEditor/Project/Configuration/AssemblyInfo.cs @@ -30,7 +30,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/AddIns/Misc/HtmlHelp2/Project/Configuration/AssemblyInfo.cs b/src/AddIns/Misc/HtmlHelp2/Project/Configuration/AssemblyInfo.cs index a19839cdf5..5bf2e61a61 100644 --- a/src/AddIns/Misc/HtmlHelp2/Project/Configuration/AssemblyInfo.cs +++ b/src/AddIns/Misc/HtmlHelp2/Project/Configuration/AssemblyInfo.cs @@ -31,7 +31,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/AddIns/Misc/MbUnitPad/Project/Configuration/AssemblyInfo.cs b/src/AddIns/Misc/MbUnitPad/Project/Configuration/AssemblyInfo.cs index a4f2e24bbe..f3ada4b442 100644 --- a/src/AddIns/Misc/MbUnitPad/Project/Configuration/AssemblyInfo.cs +++ b/src/AddIns/Misc/MbUnitPad/Project/Configuration/AssemblyInfo.cs @@ -30,4 +30,4 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] diff --git a/src/AddIns/Misc/MonoAddIn/MonoAddIn.sln b/src/AddIns/Misc/MonoAddIn/MonoAddIn.sln new file mode 100644 index 0000000000..d2e1b75e8f --- /dev/null +++ b/src/AddIns/Misc/MonoAddIn/MonoAddIn.sln @@ -0,0 +1,58 @@ +Microsoft Visual Studio Solution File, Format Version 9.00 +# SharpDevelop 2.0.0.960 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoAddIn", "Project\MonoAddIn.csproj", "{082DCD64-EE32-4151-A50F-E139CF754CC0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoReflectionLoader", "..\MonoReflectionLoader\Project\MonoReflectionLoader.csproj", "{8C52FFA5-35AF-4E28-8498-2DC2F168A241}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Build.Tasks", "..\..\..\Libraries\ICSharpCode.Build.Tasks\Project\ICSharpCode.Build.Tasks.csproj", "{4139CCF6-FB49-4A9D-B2CF-331E9EA3198D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core", "..\..\..\Main\Core\Project\ICSharpCode.Core.csproj", "{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop", "..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj", "{2748AD25-9C63-4E12-877B-4DCE96FBED54}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRefactory", "..\..\..\Libraries\NRefactory\Project\NRefactory.csproj", "{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.TextEditor", "..\..\..\Libraries\ICSharpCode.TextEditor\Project\ICSharpCode.TextEditor.csproj", "{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsUI", "..\..\..\Libraries\DockPanel_Src\WinFormsUI\WinFormsUI.csproj", "{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {082DCD64-EE32-4151-A50F-E139CF754CC0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {082DCD64-EE32-4151-A50F-E139CF754CC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {082DCD64-EE32-4151-A50F-E139CF754CC0}.Release|Any CPU.Build.0 = Release|Any CPU + {082DCD64-EE32-4151-A50F-E139CF754CC0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8C52FFA5-35AF-4E28-8498-2DC2F168A241}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8C52FFA5-35AF-4E28-8498-2DC2F168A241}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8C52FFA5-35AF-4E28-8498-2DC2F168A241}.Release|Any CPU.Build.0 = Release|Any CPU + {8C52FFA5-35AF-4E28-8498-2DC2F168A241}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4139CCF6-FB49-4A9D-B2CF-331E9EA3198D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4139CCF6-FB49-4A9D-B2CF-331E9EA3198D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4139CCF6-FB49-4A9D-B2CF-331E9EA3198D}.Release|Any CPU.Build.0 = Release|Any CPU + {4139CCF6-FB49-4A9D-B2CF-331E9EA3198D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Release|Any CPU.Build.0 = Release|Any CPU + {35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2748AD25-9C63-4E12-877B-4DCE96FBED54}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2748AD25-9C63-4E12-877B-4DCE96FBED54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2748AD25-9C63-4E12-877B-4DCE96FBED54}.Release|Any CPU.Build.0 = Release|Any CPU + {2748AD25-9C63-4E12-877B-4DCE96FBED54}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Release|Any CPU.Build.0 = Release|Any CPU + {3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Release|Any CPU.Build.0 = Release|Any CPU + {2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Release|Any CPU.Build.0 = Release|Any CPU + {D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}.Release|Any CPU.ActiveCfg = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/src/AddIns/Misc/MonoAddIn/Project/Configuration/AssemblyInfo.cs b/src/AddIns/Misc/MonoAddIn/Project/Configuration/AssemblyInfo.cs new file mode 100644 index 0000000000..60054198f8 --- /dev/null +++ b/src/AddIns/Misc/MonoAddIn/Project/Configuration/AssemblyInfo.cs @@ -0,0 +1,39 @@ +// +// +// +// +// $Revision$ +// + +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following +// attributes. +// +// change them to the information which is associated with the assembly +// you compile. + +[assembly: AssemblyTitle("MonoAddIn")] +[assembly: AssemblyDescription("Mono-AddIn for SharpDevelop")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("ic#code")] +[assembly: AssemblyProduct("SharpDevelop")] +[assembly: AssemblyCopyright("2004-2005 AlphaSierraPapa")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has following format : +// +// Major.Minor.Build.Revision +// +// You can specify all values by your own or you can build default build and revision +// numbers with the '*' character (the default): + +[assembly: AssemblyVersion("2.0.0.982")] + +// The following attributes specify the key for the sign of your assembly. See the +// .NET Framework documentation for more information about signing. +// This is not required, if you don't want signing let these attributes like they're. +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] diff --git a/src/AddIns/Misc/MonoAddIn/Project/MonoAddIn.addin b/src/AddIns/Misc/MonoAddIn/Project/MonoAddIn.addin new file mode 100644 index 0000000000..af2be1189f --- /dev/null +++ b/src/AddIns/Misc/MonoAddIn/Project/MonoAddIn.addin @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/AddIns/Misc/MonoAddIn/Project/MonoAddIn.csproj b/src/AddIns/Misc/MonoAddIn/Project/MonoAddIn.csproj new file mode 100644 index 0000000000..82165fc163 --- /dev/null +++ b/src/AddIns/Misc/MonoAddIn/Project/MonoAddIn.csproj @@ -0,0 +1,81 @@ + + + Library + MonoAddIn + MonoAddIn + Debug + AnyCPU + {082DCD64-EE32-4151-A50F-E139CF754CC0} + False + False + False + Auto + 4194304 + AnyCPU + 4096 + 4 + false + + + ..\..\..\..\..\AddIns\AddIns\Misc\MonoAddIn\ + False + DEBUG;TRACE + true + Full + True + + + ..\..\..\..\..\AddIns\AddIns\Misc\MonoAddIn\ + True + TRACE + false + None + False + + + + + + + + + + + Always + + + + + + + + + + + + {8C52FFA5-35AF-4E28-8498-2DC2F168A241} + MonoReflectionLoader + False + False + + + {2748AD25-9C63-4E12-877B-4DCE96FBED54} + ICSharpCode.SharpDevelop + False + False + + + {35CEF10F-2D4C-45F2-9DD1-161E0FEC583C} + ICSharpCode.Core + False + False + + + {4139CCF6-FB49-4A9D-B2CF-331E9EA3198D} + ICSharpCode.Build.Tasks + False + False + + + + \ No newline at end of file diff --git a/src/AddIns/Misc/MonoAddIn/Project/Src/AddMonoReferenceCommand.cs b/src/AddIns/Misc/MonoAddIn/Project/Src/AddMonoReferenceCommand.cs new file mode 100644 index 0000000000..1881656473 --- /dev/null +++ b/src/AddIns/Misc/MonoAddIn/Project/Src/AddMonoReferenceCommand.cs @@ -0,0 +1,49 @@ +// +// +// +// +// $Revision$ +// + +using ICSharpCode.Build.Tasks; +using ICSharpCode.Core; +using ICSharpCode.SharpDevelop.Gui; +using ICSharpCode.SharpDevelop.Project; +using System; +using System.IO; +using System.Windows.Forms; + +namespace ICSharpCode.MonoAddIn +{ + /// + /// Displays the AddMonoReference dialog allowing the user to add + /// a Mono GAC reference to the project + /// + public class AddMonoReferenceCommand : AbstractMenuCommand + { + public override void Run() + { + AbstractProjectBrowserTreeNode node = Owner as AbstractProjectBrowserTreeNode; + IProject project = (node != null) ? node.Project : ProjectService.CurrentProject; + if (project == null) { + return; + } + using (SelectMonoReferenceDialog selDialog = new SelectMonoReferenceDialog(project)) { + if (selDialog.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) { + + MonoProjectContentLoader.CreateMonoProjectContent(project); + + foreach (ReferenceProjectItem gacReference in selDialog.GacReferences) { + MonoProjectContentLoader.AddGacReference(gacReference.Include); + } + + foreach (ReferenceProjectItem reference in selDialog.ReferenceInformations) { + ProjectService.AddProjectItem(project, reference); + } + + project.Save(); + } + } + } + } +} diff --git a/src/AddIns/Misc/MonoAddIn/Project/Src/IsMonoInstalledCondition.cs b/src/AddIns/Misc/MonoAddIn/Project/Src/IsMonoInstalledCondition.cs new file mode 100644 index 0000000000..a9043e9438 --- /dev/null +++ b/src/AddIns/Misc/MonoAddIn/Project/Src/IsMonoInstalledCondition.cs @@ -0,0 +1,24 @@ +// +// +// +// +// $Revision$ +// + +using ICSharpCode.Build.Tasks; +using ICSharpCode.Core; +using System; + +namespace ICSharpCode.MonoAddIn +{ + /// + /// Determines whether Mono is installed. + /// + public class IsMonoInstalledCondition : IConditionEvaluator + { + public bool IsValid(object caller, Condition condition) + { + return MonoToolLocationHelper.IsMonoInstalled; + } + } +} diff --git a/src/AddIns/Misc/MonoAddIn/Project/Src/IsMonoProjectCondition.cs b/src/AddIns/Misc/MonoAddIn/Project/Src/IsMonoProjectCondition.cs new file mode 100644 index 0000000000..93a3b96276 --- /dev/null +++ b/src/AddIns/Misc/MonoAddIn/Project/Src/IsMonoProjectCondition.cs @@ -0,0 +1,29 @@ +// +// +// +// +// $Revision$ +// + +using ICSharpCode.Build.Tasks; +using ICSharpCode.Core; +using ICSharpCode.SharpDevelop.Project; +using System; + +namespace ICSharpCode.MonoAddIn +{ + /// + /// Determines whether the selected project is set to target the Mono framework. + /// + public class IsMonoProjectCondition : IConditionEvaluator + { + public bool IsValid(object caller, Condition condition) + { + IProject project = ProjectService.CurrentProject; + if (project == null) { + return false; + } + return MonoProjectContentLoader.IsMonoProject(project as MSBuildProject); + } + } +} diff --git a/src/AddIns/Misc/MonoAddIn/Project/Src/MonoGacReferencePanel.cs b/src/AddIns/Misc/MonoAddIn/Project/Src/MonoGacReferencePanel.cs new file mode 100644 index 0000000000..d56f5ce41e --- /dev/null +++ b/src/AddIns/Misc/MonoAddIn/Project/Src/MonoGacReferencePanel.cs @@ -0,0 +1,30 @@ +// +// +// +// +// $Revision$ +// + +using ICSharpCode.Build.Tasks; +using ICSharpCode.SharpDevelop.Gui; +using System; +using System.Windows.Forms; + +namespace ICSharpCode.MonoAddIn +{ + public class MonoGacReferencePanel : GacReferencePanel + { + public MonoGacReferencePanel(ISelectReferenceDialog selectDialog) : base(selectDialog) + { + } + + protected override void PrintCache() + { + foreach (MonoAssemblyName assemblyName in MonoGlobalAssemblyCache.GetAssemblyNames()) { + ListViewItem item = new ListViewItem(new string[] {assemblyName.Name, assemblyName.Version.ToString(), assemblyName.Directory}); + item.Tag = assemblyName.FullName; + Items.Add(item); + } + } + } +} diff --git a/src/AddIns/Misc/MonoAddIn/Project/Src/MonoProjectContentLoader.cs b/src/AddIns/Misc/MonoAddIn/Project/Src/MonoProjectContentLoader.cs new file mode 100644 index 0000000000..e27a51cbdd --- /dev/null +++ b/src/AddIns/Misc/MonoAddIn/Project/Src/MonoProjectContentLoader.cs @@ -0,0 +1,134 @@ +// +// +// +// +// $Revision$ +// + +using ICSharpCode.Core; +using ICSharpCode.Build.Tasks; +using ICSharpCode.SharpDevelop.Dom; +using ICSharpCode.SharpDevelop.Project; +using System; +using System.IO; +using System.Reflection; + +namespace ICSharpCode.MonoAddIn +{ + /// + /// Adds Mono specific GAC assembly references to the project content registry. + /// + public class MonoProjectContentLoader + { + string fileName = String.Empty; + string include = String.Empty; + + MonoProjectContentLoader(string fileName, string include) + { + this.fileName = fileName; + this.include = include; + } + + public static bool IsMonoProject(MSBuildProject project) + { + if (project != null) { + PropertyStorageLocations location; + foreach (string configuration in project.GetConfigurationNames()) { + foreach (string platform in project.GetPlatformNames()) { + string propertyValue = project.GetProperty(configuration, platform, "TargetFrameworkVersion", String.Empty, out location); + if (propertyValue != null && propertyValue.StartsWith("Mono", StringComparison.InvariantCultureIgnoreCase)) { + return true; + } + } + } + } + return false; + } + + /// + /// Adds the Mono Gac reference to the Dom Cache. + /// + /// The full name of the Gac assembly. + public static void AddGacReference(string name) + { + try { + MonoAssemblyName assemblyName = MonoGlobalAssemblyCache.FindAssemblyName(name); + if (assemblyName != null) { + CreateMonoProjectContent(assemblyName.FileName, name); + } + } catch (Exception ex) { + LoggingService.Debug(ex.ToString()); + } + } + + /// + /// Creates any missing Dom cache items for the project. + /// + public static void CreateMonoProjectContent(IProject project) + { + foreach (ProjectItem item in project.Items) { + ReferenceProjectItem referenceItem = item as ReferenceProjectItem; + if (item.ItemType == ItemType.Reference) { + CreateMonoProjectContent(item.FileName, item.Include); + } + } + } + + static void CreateMonoProjectContent(string fileName, string include) + { + MonoProjectContentLoader loader = new MonoProjectContentLoader(fileName, include); + ProjectContentRegistry.RunLocked(loader.CreateMonoProjectContent); + } + + static bool IsProjectContentAdded(string fileName, string include) + { + AssemblyName assemblyName = new AssemblyName(include); + if (assemblyName == null) { + return true; + } + + if (ProjectContentRegistry.GetExistingProjectContent(assemblyName) != null) { + return true; + } + + ReflectionProjectContent pc = DomPersistence.LoadProjectContentByAssemblyName(fileName); + if (pc != null) { + return true; + } + + pc = DomPersistence.LoadProjectContentByAssemblyName(include); + if (pc != null) { + return true; + } + + return false; + } + + void CreateMonoProjectContent() + { + if (IsProjectContentAdded(fileName, include)) { + return; + } + + AppDomainSetup setup = new AppDomainSetup(); + setup.DisallowCodeDownload = true; + setup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory; + AppDomain domain = AppDomain.CreateDomain("MonoAssemblyLoadingDomain", AppDomain.CurrentDomain.Evidence, setup); + try { + object o = domain.CreateInstanceAndUnwrap(typeof(MonoReflectionLoader).Assembly.FullName, typeof(MonoReflectionLoader).FullName); + MonoReflectionLoader loader = (MonoReflectionLoader)o; + string database = loader.LoadAndCreateDatabase(fileName, include); + if (database != null) { + ReflectionProjectContent content = DomPersistence.LoadProjectContent(database); + if (content != null) { + DomPersistence.SaveProjectContent(content); + } + } + } catch (Exception ex) { + LoggingService.Debug("Error loading " + include + " from " + fileName + ": " + ex.ToString()); + } finally { + AppDomain.Unload(domain); + } + } + } +} diff --git a/src/AddIns/Misc/MonoAddIn/Project/Src/SelectMonoReferenceDialog.cs b/src/AddIns/Misc/MonoAddIn/Project/Src/SelectMonoReferenceDialog.cs new file mode 100644 index 0000000000..96fd3b79d8 --- /dev/null +++ b/src/AddIns/Misc/MonoAddIn/Project/Src/SelectMonoReferenceDialog.cs @@ -0,0 +1,314 @@ +// +// +// +// +// $Revision$ +// + +using ICSharpCode.Build.Tasks; +using ICSharpCode.Core; +using ICSharpCode.SharpDevelop.Gui; +using ICSharpCode.SharpDevelop.Project; +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Collections; +using System.ComponentModel; +using System.Windows.Forms; + +namespace ICSharpCode.MonoAddIn +{ + public class SelectMonoReferenceDialog : System.Windows.Forms.Form, ISelectReferenceDialog + { + private System.Windows.Forms.ListView referencesListView; + private System.Windows.Forms.Button selectButton; + private System.Windows.Forms.Button removeButton; + private System.Windows.Forms.TabPage gacTabPage; + private System.Windows.Forms.TabPage projectTabPage; + private System.Windows.Forms.TabPage browserTabPage; + private System.Windows.Forms.Label referencesLabel; + private System.Windows.Forms.ColumnHeader referenceHeader; + private System.Windows.Forms.ColumnHeader typeHeader; + private System.Windows.Forms.ColumnHeader locationHeader; + private System.Windows.Forms.TabControl referenceTabControl; + private System.Windows.Forms.Button okButton; + private System.Windows.Forms.Button cancelButton; + private System.Windows.Forms.Button helpButton; + private System.ComponentModel.Container components = null; + + List gacReferences = new List(); + IProject configureProject; + + public ArrayList ReferenceInformations { + get { + ArrayList referenceInformations = new ArrayList(); + foreach (ListViewItem item in referencesListView.Items) { + System.Diagnostics.Debug.Assert(item.Tag != null); + referenceInformations.Add(item.Tag); + } + return referenceInformations; + } + } + + public List GacReferences { + get { + return gacReferences; + } + } + + public SelectMonoReferenceDialog(IProject configureProject) + { + this.configureProject = configureProject; + + InitializeComponent(); + + gacTabPage.Controls.Add(new MonoGacReferencePanel(this)); + projectTabPage.Controls.Add(new ProjectReferencePanel(this)); + browserTabPage.Controls.Add(new AssemblyReferencePanel(this)); + } + + public void AddReference(ReferenceType referenceType, string referenceName, string referenceLocation, object tag) + { + foreach (ListViewItem item in referencesListView.Items) { + if (referenceLocation == item.SubItems[2].Text && referenceName == item.Text ) { + return; + } + } + + ListViewItem newItem = new ListViewItem(new string[] {referenceName, referenceType.ToString(), referenceLocation}); + switch (referenceType) { + case ReferenceType.Project: + newItem.Tag = new ProjectReferenceProjectItem(configureProject, (IProject)tag); + break; + case ReferenceType.Gac: + ReferenceProjectItem gacReference = new ReferenceProjectItem(configureProject); + gacReference.Include = referenceLocation; + gacReferences.Add(gacReference); + // Add hint path so we can build against Microsoft's Csc too. + gacReference.HintPath = FileUtility.GetRelativePath(configureProject.Directory, GetAssemblyLocation(referenceLocation)); + gacReference.SpecificVersion = false; + newItem.Tag = gacReference; + break; + case ReferenceType.Assembly: + ReferenceProjectItem assemblyReference = new ReferenceProjectItem(configureProject); + assemblyReference.Include = Path.GetFileNameWithoutExtension(referenceLocation); + assemblyReference.HintPath = FileUtility.GetRelativePath(configureProject.Directory, referenceLocation); + assemblyReference.SpecificVersion = false; + newItem.Tag = assemblyReference; + break; + default: + throw new System.NotSupportedException("Unknown reference type:" + referenceType); + } + + referencesListView.Items.Add(newItem); + } + + void SelectReference(object sender, EventArgs e) + { + IReferencePanel refPanel = (IReferencePanel)referenceTabControl.SelectedTab.Controls[0]; + refPanel.AddReference(null, null); + } + + void RemoveReference(object sender, EventArgs e) + { + ArrayList itemsToDelete = new ArrayList(); + + foreach (ListViewItem item in referencesListView.SelectedItems) { + itemsToDelete.Add(item); + } + + foreach (ListViewItem item in itemsToDelete) { + referencesListView.Items.Remove(item); + ReferenceProjectItem referenceItem = item.Tag as ReferenceProjectItem; + if (referenceItem != null) { + gacReferences.Remove(referenceItem); + } + } + } + + string GetAssemblyLocation(string name) + { + MonoAssemblyName assemblyName = MonoGlobalAssemblyCache.FindAssemblyName(name); + if (assemblyName != null) { + return assemblyName.FileName; + } + return String.Empty; + } + + /// + /// Clean up any resources being used. + /// + protected override void Dispose(bool disposing) + { + if (disposing) { + if (components != null) { + components.Dispose(); + } + } + base.Dispose( disposing ); + } + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.referenceTabControl = new System.Windows.Forms.TabControl(); + this.referencesListView = new System.Windows.Forms.ListView(); + this.selectButton = new System.Windows.Forms.Button(); + this.removeButton = new System.Windows.Forms.Button(); + this.gacTabPage = new System.Windows.Forms.TabPage(); + this.projectTabPage = new System.Windows.Forms.TabPage(); + this.browserTabPage = new System.Windows.Forms.TabPage(); + this.referencesLabel = new System.Windows.Forms.Label(); + this.referenceHeader = new System.Windows.Forms.ColumnHeader(); + this.typeHeader = new System.Windows.Forms.ColumnHeader(); + this.locationHeader = new System.Windows.Forms.ColumnHeader(); + this.okButton = new System.Windows.Forms.Button(); + this.cancelButton = new System.Windows.Forms.Button(); + this.helpButton = new System.Windows.Forms.Button(); + this.referenceTabControl.SuspendLayout(); + this.SuspendLayout(); + // + // referenceTabControl + // + this.referenceTabControl.Controls.AddRange(new System.Windows.Forms.Control[] { + this.gacTabPage, + this.projectTabPage, + this.browserTabPage, + }); + this.referenceTabControl.Location = new System.Drawing.Point(8, 8); + this.referenceTabControl.SelectedIndex = 0; + this.referenceTabControl.Size = new System.Drawing.Size(472, 224); + this.referenceTabControl.TabIndex = 0; + // + // referencesListView + // + this.referencesListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.referenceHeader, + this.typeHeader, + this.locationHeader}); + this.referencesListView.Location = new System.Drawing.Point(8, 256); + this.referencesListView.Size = new System.Drawing.Size(472, 97); + this.referencesListView.TabIndex = 3; + this.referencesListView.View = System.Windows.Forms.View.Details; + this.referencesListView.FullRowSelect = true; + + + // + // selectButton + // + this.selectButton.Location = new System.Drawing.Point(488, 32); + this.selectButton.TabIndex = 1; + this.selectButton.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.SelectButton"); + this.selectButton.Click += new EventHandler(SelectReference); + this.selectButton.FlatStyle = FlatStyle.System; + + // + // removeButton + // + this.removeButton.Location = new System.Drawing.Point(488, 256); + this.removeButton.TabIndex = 4; + this.removeButton.Text = ResourceService.GetString("Global.RemoveButtonText"); + this.removeButton.Click += new EventHandler(RemoveReference); + this.removeButton.FlatStyle = FlatStyle.System; + + // + // gacTabPage + // + this.gacTabPage.Location = new System.Drawing.Point(4, 22); + this.gacTabPage.Size = new System.Drawing.Size(464, 198); + this.gacTabPage.TabIndex = 0; + this.gacTabPage.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.GacTabPage"); + this.gacTabPage.UseVisualStyleBackColor = true; + // + // projectTabPage + // + this.projectTabPage.Location = new System.Drawing.Point(4, 22); + this.projectTabPage.Size = new System.Drawing.Size(464, 198); + this.projectTabPage.TabIndex = 1; + this.projectTabPage.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.ProjectTabPage"); + this.projectTabPage.UseVisualStyleBackColor = true; + // + // browserTabPage + // + this.browserTabPage.Location = new System.Drawing.Point(4, 22); + this.browserTabPage.Size = new System.Drawing.Size(464, 198); + this.browserTabPage.TabIndex = 2; + this.browserTabPage.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.BrowserTabPage"); + this.browserTabPage.UseVisualStyleBackColor = true; + // + // referencesLabel + // + this.referencesLabel.Location = new System.Drawing.Point(8, 240); + this.referencesLabel.Size = new System.Drawing.Size(472, 16); + this.referencesLabel.TabIndex = 2; + this.referencesLabel.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.ReferencesLabel"); + // + // referenceHeader + // + this.referenceHeader.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.ReferenceHeader"); + this.referenceHeader.Width = 183; + // + // typeHeader + // + this.typeHeader.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.TypeHeader"); + this.typeHeader.Width = 57; + // + // locationHeader + // + this.locationHeader.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.LocationHeader"); + this.locationHeader.Width = 228; + // + // okButton + // + this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; + this.okButton.Location = new System.Drawing.Point(312, 368); + this.okButton.TabIndex = 5; + this.okButton.Text = ResourceService.GetString("Global.OKButtonText"); + this.okButton.FlatStyle = FlatStyle.System; + + // + // cancelButton + // + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.Location = new System.Drawing.Point(400, 368); + this.cancelButton.TabIndex = 6; + this.cancelButton.Text = ResourceService.GetString("Global.CancelButtonText"); + this.cancelButton.FlatStyle = FlatStyle.System; + + // + // helpButton + // + this.helpButton.Location = new System.Drawing.Point(488, 368); + this.helpButton.TabIndex = 7; + this.helpButton.Text = ResourceService.GetString("Global.HelpButtonText"); + this.helpButton.FlatStyle = FlatStyle.System; + + // + // SelectReferenceDialog + // + this.AcceptButton = this.okButton; + this.CancelButton = this.cancelButton; + this.ClientSize = new System.Drawing.Size(570, 399); + this.Controls.AddRange(new System.Windows.Forms.Control[] { + this.helpButton, + this.cancelButton, + this.okButton, + this.referencesLabel, + this.removeButton, + this.selectButton, + this.referencesListView, + this.referenceTabControl}); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.ShowInTaskbar = false; + this.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.DialogName"); + this.referenceTabControl.ResumeLayout(false); + this.ResumeLayout(false); + } + } +} diff --git a/src/AddIns/Misc/MonoReflectionLoader/Project/Configuration/AssemblyInfo.cs b/src/AddIns/Misc/MonoReflectionLoader/Project/Configuration/AssemblyInfo.cs new file mode 100644 index 0000000000..ec81391660 --- /dev/null +++ b/src/AddIns/Misc/MonoReflectionLoader/Project/Configuration/AssemblyInfo.cs @@ -0,0 +1,39 @@ +// +// +// +// +// $Revision$ +// + +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following +// attributes. +// +// change them to the information which is associated with the assembly +// you compile. + +[assembly: AssemblyTitle("MonoReflectionLoader")] +[assembly: AssemblyDescription("MonoReflectionLoader for SharpDevelop")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("ic#code")] +[assembly: AssemblyProduct("SharpDevelop")] +[assembly: AssemblyCopyright("2004-2005 AlphaSierraPapa")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has following format : +// +// Major.Minor.Build.Revision +// +// You can specify all values by your own or you can build default build and revision +// numbers with the '*' character (the default): + +[assembly: AssemblyVersion("2.0.0.982")] + +// The following attributes specify the key for the sign of your assembly. See the +// .NET Framework documentation for more information about signing. +// This is not required, if you don't want signing let these attributes like they're. +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] diff --git a/src/AddIns/Misc/MonoReflectionLoader/Project/MonoReflectionLoader.csproj b/src/AddIns/Misc/MonoReflectionLoader/Project/MonoReflectionLoader.csproj new file mode 100644 index 0000000000..5867980427 --- /dev/null +++ b/src/AddIns/Misc/MonoReflectionLoader/Project/MonoReflectionLoader.csproj @@ -0,0 +1,63 @@ + + + Library + MonoReflectionLoader + MonoReflectionLoader + Debug + AnyCPU + {8C52FFA5-35AF-4E28-8498-2DC2F168A241} + False + False + False + Auto + 4194304 + AnyCPU + 4096 + 4 + false + + + ..\..\..\..\..\bin\ + False + DEBUG;TRACE + true + Full + True + + + ..\..\..\..\..\bin\ + True + TRACE + false + None + False + + + + + + + + + + + {2748AD25-9C63-4E12-877B-4DCE96FBED54} + ICSharpCode.SharpDevelop + False + False + + + {35CEF10F-2D4C-45F2-9DD1-161E0FEC583C} + ICSharpCode.Core + False + False + + + {4139CCF6-FB49-4A9D-B2CF-331E9EA3198D} + ICSharpCode.Build.Tasks + False + False + + + + \ No newline at end of file diff --git a/src/AddIns/Misc/MonoReflectionLoader/Project/Src/MonoReflectionLoader.cs b/src/AddIns/Misc/MonoReflectionLoader/Project/Src/MonoReflectionLoader.cs new file mode 100644 index 0000000000..ba329a54a9 --- /dev/null +++ b/src/AddIns/Misc/MonoReflectionLoader/Project/Src/MonoReflectionLoader.cs @@ -0,0 +1,73 @@ +// +// +// +// +// $Revision$ +// + +using ICSharpCode.Build.Tasks; +using ICSharpCode.Core; +using ICSharpCode.SharpDevelop.Dom; +using System; +using System.IO; +using System.Reflection; + +namespace ICSharpCode.MonoAddIn +{ + public sealed class MonoReflectionLoader : MarshalByRefObject + { + public MonoReflectionLoader() + { + } + + public string LoadAndCreateDatabase(string fileName, string include) + { + try { + LoggingService.Debug("MonoReflectionLoader: Load: " + include); + ReflectionProjectContent content = LoadProjectContent(fileName, include); + if (content == null) + return null; + return DomPersistence.SaveProjectContent(content); + } catch (Exception ex) { + LoggingService.Error(ex); + return null; + } + } + + ReflectionProjectContent LoadProjectContent(string fileName, string include) + { + fileName = Path.GetFullPath(fileName); + Assembly assembly; + AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += AssemblyResolve; + try { + if (File.Exists(fileName)) { + assembly = Assembly.ReflectionOnlyLoadFrom(fileName); + return new ReflectionProjectContent(assembly, fileName); + } + assembly = LoadMonoGacAssembly(include); + if (assembly != null) + return new ReflectionProjectContent(assembly); + else + return null; + } catch (BadImageFormatException) { + return null; + } finally { + AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve -= AssemblyResolve; + } + } + + Assembly AssemblyResolve(object sender, ResolveEventArgs e) + { + return LoadMonoGacAssembly(e.Name); + } + + Assembly LoadMonoGacAssembly(string name) + { + MonoAssemblyName assemblyName = MonoGlobalAssemblyCache.FindAssemblyName(name); + if (assemblyName != null && assemblyName.FileName != null) { + return Assembly.ReflectionOnlyLoadFrom(assemblyName.FileName); + } + return null; + } + } +} diff --git a/src/AddIns/Misc/NAntAddIn/ConsoleApp/AssemblyInfo.cs b/src/AddIns/Misc/NAntAddIn/ConsoleApp/AssemblyInfo.cs index a9f97766a1..8ec5fff5b3 100644 --- a/src/AddIns/Misc/NAntAddIn/ConsoleApp/AssemblyInfo.cs +++ b/src/AddIns/Misc/NAntAddIn/ConsoleApp/AssemblyInfo.cs @@ -30,7 +30,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/AddIns/Misc/NAntAddIn/Project/Configuration/AssemblyInfo.cs b/src/AddIns/Misc/NAntAddIn/Project/Configuration/AssemblyInfo.cs index 8ce40d5f1c..b8cd10a61a 100644 --- a/src/AddIns/Misc/NAntAddIn/Project/Configuration/AssemblyInfo.cs +++ b/src/AddIns/Misc/NAntAddIn/Project/Configuration/AssemblyInfo.cs @@ -30,7 +30,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/AddIns/Misc/NAntAddIn/Test/AssemblyInfo.cs b/src/AddIns/Misc/NAntAddIn/Test/AssemblyInfo.cs index f2a377273b..52e01af718 100644 --- a/src/AddIns/Misc/NAntAddIn/Test/AssemblyInfo.cs +++ b/src/AddIns/Misc/NAntAddIn/Test/AssemblyInfo.cs @@ -30,7 +30,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/AddIns/Misc/PInvokeAddIn/Project/Configuration/AssemblyInfo.cs b/src/AddIns/Misc/PInvokeAddIn/Project/Configuration/AssemblyInfo.cs index 4564271684..ba98df217c 100644 --- a/src/AddIns/Misc/PInvokeAddIn/Project/Configuration/AssemblyInfo.cs +++ b/src/AddIns/Misc/PInvokeAddIn/Project/Configuration/AssemblyInfo.cs @@ -30,7 +30,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/AddIns/Misc/RegExpTk/Project/Configuration/AssemblyInfo.cs b/src/AddIns/Misc/RegExpTk/Project/Configuration/AssemblyInfo.cs index 5f71f8f10f..5dfa302d83 100644 --- a/src/AddIns/Misc/RegExpTk/Project/Configuration/AssemblyInfo.cs +++ b/src/AddIns/Misc/RegExpTk/Project/Configuration/AssemblyInfo.cs @@ -30,7 +30,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/AddIns/Misc/StartPage/Project/Configuration/AssemblyInfo.cs b/src/AddIns/Misc/StartPage/Project/Configuration/AssemblyInfo.cs index 7d5354c6f0..78bc4aac90 100644 --- a/src/AddIns/Misc/StartPage/Project/Configuration/AssemblyInfo.cs +++ b/src/AddIns/Misc/StartPage/Project/Configuration/AssemblyInfo.cs @@ -30,7 +30,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/AddIns/Misc/SubversionAddIn/Project/Configuration/AssemblyInfo.cs b/src/AddIns/Misc/SubversionAddIn/Project/Configuration/AssemblyInfo.cs index f472c619c6..af5e27c866 100644 --- a/src/AddIns/Misc/SubversionAddIn/Project/Configuration/AssemblyInfo.cs +++ b/src/AddIns/Misc/SubversionAddIn/Project/Configuration/AssemblyInfo.cs @@ -30,7 +30,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/Libraries/ICSharpCode.Build.Tasks/Project/AddMonoAssemblySearchPaths.cs b/src/Libraries/ICSharpCode.Build.Tasks/Project/AddMonoAssemblySearchPaths.cs new file mode 100644 index 0000000000..2fc44db4a5 --- /dev/null +++ b/src/Libraries/ICSharpCode.Build.Tasks/Project/AddMonoAssemblySearchPaths.cs @@ -0,0 +1,123 @@ +// +// +// +// +// $Revision$ +// + +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; +using System; +using System.Collections.Generic; + +namespace ICSharpCode.Build.Tasks +{ + /// + /// Adds GAC folders to the assembly search path for any GAC references. + /// + public class AddMonoAssemblySearchPaths : Task + { + /// + /// String used in the AssemblySearchPath property to specify where + /// Mono GAC folder items should be added. + /// + public const string MonoGacSearchPathIndicator = "{MonoGAC}"; + + string[] paths; + ITaskItem[] assemblies; + + public AddMonoAssemblySearchPaths() + { + } + + /// + /// Gets or sets the Mono assembly search paths. + /// + [Required] + [Output] + public string[] Paths { + get { + return paths; + } + set { + paths = value; + } + } + + /// + /// These are the assembly references in the project being built. This + /// set of items is also passed to the ResolveAssemblyReference task. + /// + [Required] + public ITaskItem[] Assemblies { + get { + return assemblies; + } + set { + assemblies = value; + } + } + + /// + /// Replaces the {MonoGAC} entry in the AssemblySearchPaths. + /// + public override bool Execute() + { + List updatedSearchPaths = new List(); + List monoGacSearchPaths = new List(); + + if (assemblies != null) { + foreach (ITaskItem item in assemblies) { + string monoGacFolder = GetMonoGacFolder(item); + if (monoGacFolder != null) { + monoGacSearchPaths.Add(monoGacFolder); + } + } + } + + // Add Mono GAC search paths to existing search paths. + foreach (string path in paths) { + if (path.Equals(MonoGacSearchPathIndicator, StringComparison.InvariantCultureIgnoreCase)) { + updatedSearchPaths.AddRange(monoGacSearchPaths); + } else { + updatedSearchPaths.Add(path); + } + } + paths = new string[updatedSearchPaths.Count]; + updatedSearchPaths.CopyTo(paths); + + return true; + } + + /// + /// Gets the corresponding Mono GAC folder for the task item. + /// + /// + /// Basic logic is: + /// + /// 1) If the Gac reference has a full specified assembly name + /// (e.g. name, version, culture, public key token) then just generate + /// the expected Gac folder. + /// 2) If the Gac reference is a short name, then look in Mono's gac for + /// latest version (i.e. highest version number) of the assembly and + /// adds it folder. + /// + /// Extra possiblities: + /// + /// 1) Verify the assembly actually exists and take action accordingly. + /// 2) Allow partial assembly names (i.e short + version and nothing else). + /// 3) Check the hint path actually resolves to an assembly otherwise add + /// a possible GAC folder. + /// + /// if no GAC folder can be found + /// for the task item. + string GetMonoGacFolder(ITaskItem item) + { + MonoAssemblyName assemblyName = MonoGlobalAssemblyCache.FindAssemblyName(item.ItemSpec); + if (assemblyName != null) { + return assemblyName.Directory; + } + return null; + } + } +} diff --git a/src/Libraries/ICSharpCode.Build.Tasks/Project/AssemblyInfo.cs b/src/Libraries/ICSharpCode.Build.Tasks/Project/AssemblyInfo.cs index 7d954c24b6..b79f9bb18c 100644 --- a/src/Libraries/ICSharpCode.Build.Tasks/Project/AssemblyInfo.cs +++ b/src/Libraries/ICSharpCode.Build.Tasks/Project/AssemblyInfo.cs @@ -30,4 +30,4 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] diff --git a/src/Libraries/ICSharpCode.Build.Tasks/Project/GetMonoFrameworkPath.cs b/src/Libraries/ICSharpCode.Build.Tasks/Project/GetMonoFrameworkPath.cs new file mode 100644 index 0000000000..78433409c2 --- /dev/null +++ b/src/Libraries/ICSharpCode.Build.Tasks/Project/GetMonoFrameworkPath.cs @@ -0,0 +1,81 @@ +// +// +// +// +// $Revision$ +// + +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; +using System; + +namespace ICSharpCode.Build.Tasks +{ + /// + /// Gets the path to the Mono Framework assemblies. + /// + public class GetMonoFrameworkPath : Task + { + public const string TargetMonoFrameworkVersion11 = "Mono v1.1"; + public const string TargetMonoFrameworkVersion20 = "Mono v2.0"; + + string path = String.Empty; + TargetMonoFrameworkVersion targetFrameworkVersion = TargetMonoFrameworkVersion.VersionLatest; + + public GetMonoFrameworkPath() + { + } + + [Output] + public string Path { + get { + return path; + } + set { + path = value; + } + } + + public string TargetFrameworkVersion { + get { + return ConvertToString(targetFrameworkVersion); + } + set { + targetFrameworkVersion = ConvertToEnum(value); + } + } + + public override bool Execute() + { + if (MonoToolLocationHelper.IsMonoInstalled) { + System.Diagnostics.Debug.WriteLine("TargetFrameworkVersion: " + targetFrameworkVersion.ToString()); + path = MonoToolLocationHelper.GetPathToMonoFramework(targetFrameworkVersion); + System.Diagnostics.Debug.WriteLine("MonoFrameworkPath: " + path); + return true; + } + Log.LogError("Mono is not installed."); + return false; + } + + static string ConvertToString(TargetMonoFrameworkVersion frameworkVersion) + { + switch (frameworkVersion) { + case TargetMonoFrameworkVersion.Version11: + return TargetMonoFrameworkVersion11; + case TargetMonoFrameworkVersion.Version20: + return TargetMonoFrameworkVersion20; + } + return null; + } + + static TargetMonoFrameworkVersion ConvertToEnum(string frameworkVersion) + { + if (frameworkVersion == TargetMonoFrameworkVersion11) { + return TargetMonoFrameworkVersion.Version11; + } else if (frameworkVersion == TargetMonoFrameworkVersion20) { + return TargetMonoFrameworkVersion.Version20; + } + throw new ArgumentException(String.Concat("Unknown Target Mono Framework Version: ", frameworkVersion)); + } + } +} diff --git a/src/Libraries/ICSharpCode.Build.Tasks/Project/GetMonoFrameworkSdkPath.cs b/src/Libraries/ICSharpCode.Build.Tasks/Project/GetMonoFrameworkSdkPath.cs new file mode 100644 index 0000000000..90a794fa9b --- /dev/null +++ b/src/Libraries/ICSharpCode.Build.Tasks/Project/GetMonoFrameworkSdkPath.cs @@ -0,0 +1,47 @@ +// +// +// +// +// $Revision$ +// + +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; +using System; + +namespace ICSharpCode.Build.Tasks +{ + /// + /// Gets the path to the Mono SDK folder. + /// + public class GetMonoFrameworkSdkPath : Task + { + string path = String.Empty; + + public GetMonoFrameworkSdkPath() + { + } + + [Output] + public string Path { + get { + return path; + } + set { + path = value; + } + } + + public override bool Execute() + { + if (MonoToolLocationHelper.IsMonoInstalled) { + path = MonoToolLocationHelper.GetPathToMonoSdk(); + System.Diagnostics.Debug.WriteLine("MonoSdk: " + path); + return true; + } + Log.LogError("Mono is not installed."); + return false; + + } + } +} diff --git a/src/Libraries/ICSharpCode.Build.Tasks/Project/ICSharpCode.Build.Tasks.csproj b/src/Libraries/ICSharpCode.Build.Tasks/Project/ICSharpCode.Build.Tasks.csproj index f7e1abfeb9..8c1fe8ff35 100644 --- a/src/Libraries/ICSharpCode.Build.Tasks/Project/ICSharpCode.Build.Tasks.csproj +++ b/src/Libraries/ICSharpCode.Build.Tasks/Project/ICSharpCode.Build.Tasks.csproj @@ -48,6 +48,13 @@ Always + + + + + + + diff --git a/src/Libraries/ICSharpCode.Build.Tasks/Project/MonoAssemblyName.cs b/src/Libraries/ICSharpCode.Build.Tasks/Project/MonoAssemblyName.cs new file mode 100644 index 0000000000..8134a58110 --- /dev/null +++ b/src/Libraries/ICSharpCode.Build.Tasks/Project/MonoAssemblyName.cs @@ -0,0 +1,196 @@ +// +// +// +// +// $Revision$ +// + +using System; +using System.Globalization; +using System.IO; +using System.Reflection; +using System.Text; + +namespace ICSharpCode.Build.Tasks +{ + public class MonoAssemblyName + { + string name = String.Empty; + Version version; + string directory = String.Empty; + CultureInfo cultureInfo; + byte[] publicKeyToken; + + public MonoAssemblyName(string name) : this(name, String.Empty) + { + } + + public MonoAssemblyName(string name, string directory) + { + AssemblyName assemblyName = new AssemblyName(name); + this.name = assemblyName.Name; + version = assemblyName.Version; + cultureInfo = assemblyName.CultureInfo; + publicKeyToken = assemblyName.GetPublicKeyToken(); + this.directory = directory; + } + + /// + /// Returns whether the assembly name, version, culture and public key token + /// are specified. + /// + public bool IsFullyQualified { + get { + return (name != null) && (version != null) && (cultureInfo != null) && (publicKeyToken != null); + } + } + + /// + /// The short name of the assembly. + /// + public string Name { + get { + return name; + } + } + + /// + /// Returns the full assembly name of the form: + /// Name, Version, Culture, Public Key Token. + /// + public string FullName { + get { + return GetFullName(name, GetVersionAsString(version), GetCultureAsString(cultureInfo), GetPublicKeyTokenAsString(publicKeyToken)); + } + } + + /// + /// Returns the full assembly name of the form: + /// Name, Version, Culture, Public Key Token. + /// + public static string GetFullName(string name, string version, string cultureInfo, string publicKeyToken) + { + StringBuilder fullName = new StringBuilder(); + + // Add name. + fullName.Append(name); + + // Add version. + if (version != null) { + fullName.AppendFormat(", Version={0}", version); + } + + // Add culture. + string culture = "neutral"; + if (cultureInfo != null) { + culture = cultureInfo; + } + fullName.AppendFormat(", Culture={0}", culture); + + // Add public key token. + if (publicKeyToken != null && publicKeyToken.Length > 0) { + fullName.AppendFormat(", PublicKeyToken={0}", publicKeyToken); + } + return fullName.ToString(); + } + + public Version Version { + get { + return version; + } + } + + public CultureInfo CultureInfo { + get { + return cultureInfo; + } + } + + public byte[] GetPublicKeyToken() + { + return publicKeyToken; + } + + public static string GetPublicKeyTokenAsString(byte[] publicKeyToken) + { + StringBuilder convertedToken = new StringBuilder(); + if (publicKeyToken != null) { + foreach (byte b in publicKeyToken) { + convertedToken.Append(b.ToString("x2")); + } + } + return convertedToken.ToString(); + } + + /// + /// Gets or sets the full path to the assembly excluding the assembly name. + /// + public string Directory { + get { + return directory; + } + set { + directory = value; + } + } + + /// + /// Gets the full filename of the assembly. + /// + public string FileName { + get { + return Path.Combine(directory, String.Concat(name, ".dll")); + } + } + + /// + /// Determines whether the assembly names match. + /// + /// + /// Handles partially qualified assembly names and will return + /// if the match is a partial match. + /// + public bool IsMatch(MonoAssemblyName assemblyName) + { + if (name == assemblyName.Name) { + if (assemblyName.publicKeyToken != null && publicKeyToken != null) { + if (assemblyName.publicKeyToken.Length == publicKeyToken.Length) { + for (int i = 0; i < publicKeyToken.Length; ++i) { + if (publicKeyToken[i] != assemblyName.publicKeyToken[i]) { + return false; + } + } + } + } + if (assemblyName.version != null && version != null) { + if (assemblyName.version != version) { + return false; + } + } + if (assemblyName.cultureInfo != null && cultureInfo != null) { + if (assemblyName.cultureInfo == cultureInfo) { + return false; + } + } + return true; + } + return false; + } + + static string GetVersionAsString(Version version) + { + if (version != null) { + return version.ToString(); + } + return null; + } + + static string GetCultureAsString(CultureInfo cultureInfo) + { + if (cultureInfo != null && cultureInfo.Name.Length > 0) { + return cultureInfo.Name; + } + return null; + } + } +} diff --git a/src/Libraries/ICSharpCode.Build.Tasks/Project/MonoGacDirectory.cs b/src/Libraries/ICSharpCode.Build.Tasks/Project/MonoGacDirectory.cs new file mode 100644 index 0000000000..f90a435835 --- /dev/null +++ b/src/Libraries/ICSharpCode.Build.Tasks/Project/MonoGacDirectory.cs @@ -0,0 +1,119 @@ +// +// +// +// +// $Revision$ +// + +using System; +using System.Globalization; +using System.IO; +using System.Reflection; +using System.Text; + +namespace ICSharpCode.Build.Tasks +{ + public class MonoGacDirectory + { + string gacBaseDirectory = String.Empty; + MonoAssemblyName assemblyName; + + public MonoGacDirectory() + { + } + + public MonoGacDirectory(string gacBaseDirectory, MonoAssemblyName assemblyName) + { + this.gacBaseDirectory = gacBaseDirectory; + this.assemblyName = assemblyName; + } + + public MonoGacDirectory(string gacBaseDirectory, string assemblyDirectoryName, string versionDirectoryName) + { + string assemblyDirectory = Path.Combine(gacBaseDirectory, Path.Combine(assemblyDirectoryName, versionDirectoryName)); + assemblyName = new MonoAssemblyName(GetAssemblyName(assemblyDirectoryName, versionDirectoryName), assemblyDirectory); + } + + /// + /// The assembly name associated with this directory. + /// + public MonoAssemblyName AssemblyName { + get { + return assemblyName; + } + } + + /// + /// Gets the full path to the directory containing the assembly. + /// + public string FullPath { + get { + return Path.Combine(gacBaseDirectory, Path.Combine(assemblyName.Name, GetSubFolderName(assemblyName.Version, assemblyName.CultureInfo, assemblyName.GetPublicKeyToken()))); + } + } + + /// + /// Gets the Mono Gac directory based on the assembly name. + /// + /// + /// If the assembly name is not fully qualified then this method returns + /// null. + /// + public static MonoGacDirectory GetAssemblyDirectory(string gacBaseDirectory, MonoAssemblyName assemblyName) + { + if (assemblyName.IsFullyQualified) { + return new MonoGacDirectory(gacBaseDirectory, assemblyName); + } + return null; + } + + public static string GetAssemblyName(string assemblyDirectoryName, string versionDirectoryName) + { + string version = null; + string culture = null; + string publicKeyToken = null; + + if (versionDirectoryName != null && versionDirectoryName.Length > 0) { + string[] items = versionDirectoryName.Split('_'); + if (items.Length == 3) { + if (items[0].Length > 0) { + version = items[0]; + } + if (items[1].Length > 0) { + culture = items[1]; + } + if (items[2].Length > 0) { + publicKeyToken = items[2]; + } + } + } + return MonoAssemblyName.GetFullName(assemblyDirectoryName, version, culture, publicKeyToken); + } + + static string GetSubFolderName(Version version, CultureInfo culture, byte[] publicKeyToken) + { + StringBuilder folderName = new StringBuilder(); + + // Add version. + if (version != null) { + folderName.Append(version.ToString()); + } + folderName.Append("_"); + + // Add culture. + if (culture != null) { + folderName.Append(culture.Name); + } + folderName.Append("_"); + + // Add public key token. + if (publicKeyToken != null) { + foreach (byte b in publicKeyToken) { + folderName.Append(b.ToString("x2")); + } + } + + return folderName.ToString(); + } + } +} diff --git a/src/Libraries/ICSharpCode.Build.Tasks/Project/MonoGlobalAssemblyCache.cs b/src/Libraries/ICSharpCode.Build.Tasks/Project/MonoGlobalAssemblyCache.cs new file mode 100644 index 0000000000..eea908484c --- /dev/null +++ b/src/Libraries/ICSharpCode.Build.Tasks/Project/MonoGlobalAssemblyCache.cs @@ -0,0 +1,122 @@ +// +// +// +// +// $Revision$ +// + +using Microsoft.Win32; +using System; +using System.Collections.Generic; +using System.IO; +using System.Security; + +namespace ICSharpCode.Build.Tasks +{ + public class MonoGlobalAssemblyCache + { + MonoGlobalAssemblyCache() + { + } + + /// + /// Gets all the assembly names in the Mono GAC. + /// + /// The GAC folder + public static List GetAssemblyNames(string folder) + { + List assemblyNames = new List(); + if (folder != null && Directory.Exists(folder)) { + DirectoryInfo gacDirectoryInfo = new DirectoryInfo(folder); + foreach (DirectoryInfo assemblyNameDirectoryInfo in gacDirectoryInfo.GetDirectories()) { + foreach (DirectoryInfo versionDirectoryInfo in assemblyNameDirectoryInfo.GetDirectories()) { + string assemblyFullName = MonoGacDirectory.GetAssemblyName(assemblyNameDirectoryInfo.Name, versionDirectoryInfo.Name); + MonoAssemblyName name = CreateMonoAssemblyName(assemblyFullName); + if (name != null) { + name.Directory = versionDirectoryInfo.FullName; + assemblyNames.Add(name); + } + } + } + } + return assemblyNames; + } + + /// + /// Gets all the assembly names in the Mono GAC. + /// + public static List GetAssemblyNames() + { + return GetAssemblyNames(MonoToolLocationHelper.GetPathToMonoGac()); + } + + /// + /// Finds the GAC assembly which matches the specified name. + /// + /// + /// A short name or a fully qualifed assembly name of the form + /// (glib-sharp, Version=1.0, Culture=neutral, PublicKeyToken=9449494) + /// + public static MonoAssemblyName FindAssemblyName(string name) + { + string gacFolder = MonoToolLocationHelper.GetPathToMonoGac(); + if (gacFolder != null) { + MonoAssemblyName assemblyName = CreateMonoAssemblyName(name); + if (assemblyName != null) { + if (assemblyName.IsFullyQualified) { + MonoGacDirectory directory = MonoGacDirectory.GetAssemblyDirectory(gacFolder, assemblyName); + if (directory != null) { + assemblyName.Directory = directory.FullPath; + return assemblyName; + } + } else { + return FindPartialAssemblyName(assemblyName); + } + } + } + return null; + } + + /// + /// Tries to match the partially specified assembly name. + /// + static MonoAssemblyName FindPartialAssemblyName(MonoAssemblyName partialName) + { + string assemblyDirectoryName = Path.Combine(MonoToolLocationHelper.GetPathToMonoGac(), partialName.Name); + if (Directory.Exists(assemblyDirectoryName)) { + MonoAssemblyName matchedName = null; + DirectoryInfo assemblyNameDirectoryInfo = new DirectoryInfo(assemblyDirectoryName); + foreach (DirectoryInfo versionDirectoryInfo in assemblyNameDirectoryInfo.GetDirectories()) { + string assemblyFullName = MonoGacDirectory.GetAssemblyName(assemblyNameDirectoryInfo.Name, versionDirectoryInfo.Name); + MonoAssemblyName name = CreateMonoAssemblyName(assemblyFullName, versionDirectoryInfo.FullName); + if (name != null && name.IsFullyQualified) { + if (matchedName == null) { + if (partialName.IsMatch(name)) { + matchedName = name; + } + } else if (partialName.IsMatch(name) && name.Version > matchedName.Version) { + matchedName = name; + } + } + } + return matchedName; + } + + return null; + } + + static MonoAssemblyName CreateMonoAssemblyName(string name, string directory) + { + try { + return new MonoAssemblyName(name, directory); + } catch (Exception) { } + + return null; + } + + static MonoAssemblyName CreateMonoAssemblyName(string name) + { + return CreateMonoAssemblyName(name, String.Empty); + } + } +} diff --git a/src/Libraries/ICSharpCode.Build.Tasks/Project/MonoToolLocationHelper.cs b/src/Libraries/ICSharpCode.Build.Tasks/Project/MonoToolLocationHelper.cs index c784b103da..038976821b 100644 --- a/src/Libraries/ICSharpCode.Build.Tasks/Project/MonoToolLocationHelper.cs +++ b/src/Libraries/ICSharpCode.Build.Tasks/Project/MonoToolLocationHelper.cs @@ -21,6 +21,11 @@ namespace ICSharpCode.Build.Tasks static string defaultMonoClr = null; static string monoSdkPath = null; + static string monoFrameworkAssemblyPath = null; + static string monoFrameworkVersion11Path = null; + static string monoFrameworkVersion20Path = null; + static bool monoInstalled; + static bool checkedForMonoInstallation; MonoToolLocationHelper() { @@ -35,9 +40,9 @@ namespace ICSharpCode.Build.Tasks // Look for Mono install path in registry. string toolName = Path.ChangeExtension(name, ".bat"); - string sdkPath = MonoSdkPath; + string sdkPath = GetPathToMonoSdk(); if (sdkPath.Length > 0) { - string toolPath = Path.Combine(sdkPath, String.Concat("bin\\", toolName)); + string toolPath = Path.Combine(sdkPath, toolName); if (System.IO.File.Exists(toolPath)) { return String.Concat("\"", toolPath, "\""); } @@ -53,28 +58,111 @@ namespace ICSharpCode.Build.Tasks return toolName; } - public static string MonoSdkPath { - get { - if (monoSdkPath == null) { - string defaultClr = DefaultMonoClr; - if (defaultClr.Length > 0) { - string keyName = String.Concat(MonoRootKeyName, "\\", defaultClr); - monoSdkPath = ReadRegistryValue(keyName, "SdkInstallRoot"); - } else { - monoSdkPath = String.Empty; + public static string GetPathToMonoSdk() + { + if (monoSdkPath == null) { + string defaultClr = GetDefaultMonoClr(); + if (defaultClr.Length > 0) { + string keyName = String.Concat(MonoRootKeyName, "\\", defaultClr); + monoSdkPath = ReadRegistryValue(keyName, "SdkInstallRoot"); + if (monoSdkPath.Length > 0) { + monoSdkPath = Path.Combine(monoSdkPath, "bin"); } + } else { + monoSdkPath = String.Empty; } - return monoSdkPath; } + return monoSdkPath; + } + + public static string GetDefaultMonoClr() + { + if (defaultMonoClr == null) { + defaultMonoClr = ReadRegistryValue(MonoRootKeyName, "DefaultClr"); + } + return defaultMonoClr; } - public static string DefaultMonoClr { + /// + /// Determines whether Mono is installed. + /// + public static bool IsMonoInstalled { get { - if (defaultMonoClr == null) { - defaultMonoClr = ReadRegistryValue(MonoRootKeyName, "DefaultClr"); + if (!checkedForMonoInstallation) { + checkedForMonoInstallation = true; + string baseFolder = GetBasePathToMonoFramework(); + if (baseFolder != null && baseFolder.Length > 0) { + monoInstalled = Directory.Exists(baseFolder); + } + } + return monoInstalled; + } + } + + public static string GetPathToMonoFramework(TargetMonoFrameworkVersion version) + { + switch (version) { + case TargetMonoFrameworkVersion.Version11: + return GetPathToMonoFrameworkVersion11(); + case TargetMonoFrameworkVersion.Version20: + return GetPathToMonoFrameworkVersion20(); + } + return null; + } + + /// + /// Gets the full path to the Mono GAC + /// + public static string GetPathToMonoGac() + { + string frameworkFolder = GetBasePathToMonoFramework(); + if (frameworkFolder != null && frameworkFolder.Length > 0) { + string gacFolder = Path.Combine(frameworkFolder, @"mono\gac"); + if (Directory.Exists(gacFolder)) { + return gacFolder; } - return defaultMonoClr; } + return null; + } + + /// + /// Gets the base path to the mono framework assemblies. + /// + static string GetBasePathToMonoFramework() + { + if (monoFrameworkAssemblyPath == null) { + string defaultClr = GetDefaultMonoClr(); + if (defaultClr.Length > 0) { + string keyName = String.Concat(MonoRootKeyName, "\\", defaultClr); + monoFrameworkAssemblyPath = ReadRegistryValue(keyName, "FrameworkAssemblyDirectory"); + } + } + return monoFrameworkAssemblyPath; + } + + static string GetPathToMonoFrameworkVersion11() + { + if (monoFrameworkVersion11Path == null) { + monoFrameworkVersion11Path = GetPathToMonoFramework(@"mono\1.0"); + } + return monoFrameworkVersion11Path; + } + + static string GetPathToMonoFrameworkVersion20() + { + if (monoFrameworkVersion20Path == null) { + monoFrameworkVersion20Path = GetPathToMonoFramework(@"mono\2.0"); + } + return monoFrameworkVersion20Path; + } + + static string GetPathToMonoFramework(string subFolder) + { + string monoFrameworkBaseFolder = GetBasePathToMonoFramework(); + if (monoFrameworkBaseFolder != null && monoFrameworkBaseFolder.Length > 0) { + return Path.Combine(monoFrameworkBaseFolder, subFolder); + } + return null; } static string ReadRegistryValue(string keyName, string name) diff --git a/src/Libraries/ICSharpCode.Build.Tasks/Project/SharpDevelop.Build.Mono.Gmcs.targets b/src/Libraries/ICSharpCode.Build.Tasks/Project/SharpDevelop.Build.Mono.Gmcs.targets index aaf730b594..43920fdff5 100644 --- a/src/Libraries/ICSharpCode.Build.Tasks/Project/SharpDevelop.Build.Mono.Gmcs.targets +++ b/src/Libraries/ICSharpCode.Build.Tasks/Project/SharpDevelop.Build.Mono.Gmcs.targets @@ -1,7 +1,15 @@ + + + + + $(MSBuildAllProjects);$(SharpDevelopBinPath)\SharpDevelop.Build.Mono.targets @@ -9,6 +17,52 @@ C# + + + + {CandidateAssemblyFiles}; + $(ReferencePath); + {HintPathFromItem}; + {TargetFrameworkDirectory}; + {MonoGAC}; + {RawFileName}; + $(OutputPath) + + + + + + + + + + + + + + + + + + + + + GetFrameworkPaths; + GetRedistLists; + PrepareForBuild; + AddMonoAssemblySearchPaths + + + + + + + + + - - diff --git a/src/Libraries/ICSharpCode.Build.Tasks/Project/SharpDevelop.Build.Mono.Mcs.targets b/src/Libraries/ICSharpCode.Build.Tasks/Project/SharpDevelop.Build.Mono.Mcs.targets index 87eb6ed753..53a7a5a219 100644 --- a/src/Libraries/ICSharpCode.Build.Tasks/Project/SharpDevelop.Build.Mono.Mcs.targets +++ b/src/Libraries/ICSharpCode.Build.Tasks/Project/SharpDevelop.Build.Mono.Mcs.targets @@ -1,15 +1,69 @@ + + - - + + + + + $(MSBuildAllProjects);$(SharpDevelopBinPath)\SharpDevelop.Build.Mono.targets .cs C# - + + + {CandidateAssemblyFiles}; + $(ReferencePath); + {HintPathFromItem}; + {TargetFrameworkDirectory}; + {MonoGAC}; + {RawFileName}; + $(OutputPath) + + + + + + + + + + + + + + + + + + + + + GetFrameworkPaths; + GetRedistLists; + PrepareForBuild; + AddMonoAssemblySearchPaths + + + + + + + + + + - - diff --git a/src/Libraries/ICSharpCode.Build.Tasks/Project/TargetMonoFrameworkVersion.cs b/src/Libraries/ICSharpCode.Build.Tasks/Project/TargetMonoFrameworkVersion.cs new file mode 100644 index 0000000000..a85b69fef8 --- /dev/null +++ b/src/Libraries/ICSharpCode.Build.Tasks/Project/TargetMonoFrameworkVersion.cs @@ -0,0 +1,18 @@ +// +// +// +// +// $Revision$ +// + +using System; + +namespace ICSharpCode.Build.Tasks +{ + public enum TargetMonoFrameworkVersion + { + Version11 = 0, + Version20 = 1, + VersionLatest = 1 + } +} diff --git a/src/Libraries/ICSharpCode.Build.Tasks/Test/AssemblyInfo.cs b/src/Libraries/ICSharpCode.Build.Tasks/Test/AssemblyInfo.cs index a4e5dd3e0d..557d686655 100644 --- a/src/Libraries/ICSharpCode.Build.Tasks/Test/AssemblyInfo.cs +++ b/src/Libraries/ICSharpCode.Build.Tasks/Test/AssemblyInfo.cs @@ -30,4 +30,4 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] diff --git a/src/Libraries/ICSharpCode.TextEditor/Project/Configuration/AssemblyInfo.cs b/src/Libraries/ICSharpCode.TextEditor/Project/Configuration/AssemblyInfo.cs index 2309a4b10b..fd3219b944 100644 --- a/src/Libraries/ICSharpCode.TextEditor/Project/Configuration/AssemblyInfo.cs +++ b/src/Libraries/ICSharpCode.TextEditor/Project/Configuration/AssemblyInfo.cs @@ -17,7 +17,7 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] [assembly: AssemblyDelaySign(false)] //[assembly: AssemblyKeyFile("ICSharpCode.TextEditor.key")] diff --git a/src/Libraries/ICSharpCode.TextEditor/Test/AssemblyInfo.cs b/src/Libraries/ICSharpCode.TextEditor/Test/AssemblyInfo.cs index 75ee8b00b7..294cfb9fe9 100644 --- a/src/Libraries/ICSharpCode.TextEditor/Test/AssemblyInfo.cs +++ b/src/Libraries/ICSharpCode.TextEditor/Test/AssemblyInfo.cs @@ -30,7 +30,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/Libraries/NRefactory/NRefactoryASTGenerator/AssemblyInfo.cs b/src/Libraries/NRefactory/NRefactoryASTGenerator/AssemblyInfo.cs index 3114526822..12bbd2d408 100644 --- a/src/Libraries/NRefactory/NRefactoryASTGenerator/AssemblyInfo.cs +++ b/src/Libraries/NRefactory/NRefactoryASTGenerator/AssemblyInfo.cs @@ -30,4 +30,4 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] diff --git a/src/Libraries/NRefactory/Project/Configuration/AssemblyInfo.cs b/src/Libraries/NRefactory/Project/Configuration/AssemblyInfo.cs index a888544cfb..fc75f938cd 100644 --- a/src/Libraries/NRefactory/Project/Configuration/AssemblyInfo.cs +++ b/src/Libraries/NRefactory/Project/Configuration/AssemblyInfo.cs @@ -30,7 +30,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/Libraries/NRefactory/Test/AssemblyInfo.cs b/src/Libraries/NRefactory/Test/AssemblyInfo.cs index 952d90dc74..19dee7d0b2 100644 --- a/src/Libraries/NRefactory/Test/AssemblyInfo.cs +++ b/src/Libraries/NRefactory/Test/AssemblyInfo.cs @@ -30,7 +30,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/Main/Base/Project/Configuration/AssemblyInfo.cs b/src/Main/Base/Project/Configuration/AssemblyInfo.cs index a5784289ea..d1db2e5d0a 100644 --- a/src/Main/Base/Project/Configuration/AssemblyInfo.cs +++ b/src/Main/Base/Project/Configuration/AssemblyInfo.cs @@ -19,6 +19,6 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] [assembly: AssemblyDelaySign(false)] diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs b/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs index addd393e2a..258c356916 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs @@ -20,9 +20,9 @@ namespace ICSharpCode.SharpDevelop.Gui { public class AssemblyReferencePanel : Panel, IReferencePanel { - SelectReferenceDialog selectDialog; + ISelectReferenceDialog selectDialog; - public AssemblyReferencePanel(SelectReferenceDialog selectDialog) + public AssemblyReferencePanel(ISelectReferenceDialog selectDialog) { this.selectDialog = selectDialog; diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/COMReferencePanel.cs b/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/COMReferencePanel.cs index 6f793797ee..0670a0da69 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/COMReferencePanel.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/COMReferencePanel.cs @@ -23,9 +23,9 @@ namespace ICSharpCode.SharpDevelop.Gui { public class COMReferencePanel : ListView, IReferencePanel { - SelectReferenceDialog selectDialog; + ISelectReferenceDialog selectDialog; - public COMReferencePanel(SelectReferenceDialog selectDialog) + public COMReferencePanel(ISelectReferenceDialog selectDialog) { this.selectDialog = selectDialog; diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs b/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs index 564d36882e..2808dac26c 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs @@ -49,10 +49,10 @@ namespace ICSharpCode.SharpDevelop.Gui } } - SelectReferenceDialog selectDialog; + ISelectReferenceDialog selectDialog; ColumnSorter sorter; - public GacReferencePanel(SelectReferenceDialog selectDialog) + public GacReferencePanel(ISelectReferenceDialog selectDialog) { sorter = new ColumnSorter(); this.ListViewItemSorter = sorter; @@ -103,7 +103,7 @@ namespace ICSharpCode.SharpDevelop.Gui } } - void PrintCache() + protected virtual void PrintCache() { IApplicationContext applicationContext = null; IAssemblyEnum assemblyEnum = null; diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/ProjectReferencePanel.cs b/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/ProjectReferencePanel.cs index 72252b1ff5..4265d9e9e1 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/ProjectReferencePanel.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/ProjectReferencePanel.cs @@ -18,9 +18,9 @@ namespace ICSharpCode.SharpDevelop.Gui { public class ProjectReferencePanel : ListView, IReferencePanel { - SelectReferenceDialog selectDialog; + ISelectReferenceDialog selectDialog; - public ProjectReferencePanel(SelectReferenceDialog selectDialog) + public ProjectReferencePanel(ISelectReferenceDialog selectDialog) { this.selectDialog = selectDialog; diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs b/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs index 4f8b2405bf..8fbdf7c1ee 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs @@ -23,6 +23,11 @@ namespace ICSharpCode.SharpDevelop.Gui void AddReference(object sender, EventArgs e); } + public interface ISelectReferenceDialog + { + void AddReference(ReferenceType referenceType, string referenceName, string referenceLocation, object tag); + } + public enum ReferenceType { Assembly, Typelib, @@ -34,7 +39,7 @@ namespace ICSharpCode.SharpDevelop.Gui /// /// Summary description for Form2. /// - public class SelectReferenceDialog : System.Windows.Forms.Form + public class SelectReferenceDialog : System.Windows.Forms.Form, ISelectReferenceDialog { private System.Windows.Forms.ListView referencesListView; private System.Windows.Forms.Button selectButton; diff --git a/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs b/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs index 8c8f4e2b6f..ba5b6c2d05 100644 --- a/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs +++ b/src/Main/Base/Project/Src/Internal/Templates/Project/ProjectDescriptor.cs @@ -27,6 +27,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates string name; string relativePath; string languageName = null; + bool clearExistingImports; List files = new List(); // contains FileTemplate classes List projectItems = new List(); @@ -140,6 +141,9 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates } // Add Imports + if (clearExistingImports) { + ((AbstractProject)project).Imports.Clear(); + } foreach(string projectImport in projectImports) { ((AbstractProject)project).Imports.Add(projectImport); } @@ -253,6 +257,9 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates } if (element["Imports"] != null) { ReadProjectImports(projectDescriptor, element["Imports"]); + if (element["Imports"].HasAttribute("clear")) { + projectDescriptor.clearExistingImports = (String.Compare(element["Imports"].Attributes["clear"].InnerText, "true", StringComparison.InvariantCultureIgnoreCase) == 0); + } } foreach (XmlNode node in element) { if (node.NodeType == XmlNodeType.Element && node.Name == "PropertyGroup") { diff --git a/src/Main/Base/Project/Src/Services/ParserService/ProjectContentRegistry.cs b/src/Main/Base/Project/Src/Services/ParserService/ProjectContentRegistry.cs index 2d62dc7899..94587d508b 100644 --- a/src/Main/Base/Project/Src/Services/ParserService/ProjectContentRegistry.cs +++ b/src/Main/Base/Project/Src/Services/ParserService/ProjectContentRegistry.cs @@ -12,6 +12,7 @@ using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; +using System.Windows.Forms; using System.Xml; using System.Text; @@ -28,6 +29,13 @@ namespace ICSharpCode.Core static Dictionary contents = new Dictionary(StringComparer.InvariantCultureIgnoreCase); static ReflectionProjectContent mscorlibContent; + public static void RunLocked(MethodInvoker method) + { + lock (contents) { + method(); + } + } + public static IProjectContent Mscorlib { get { if (mscorlibContent != null) return mscorlibContent; diff --git a/src/Main/Base/Test/AssemblyInfo.cs b/src/Main/Base/Test/AssemblyInfo.cs index 75ee8b00b7..294cfb9fe9 100644 --- a/src/Main/Base/Test/AssemblyInfo.cs +++ b/src/Main/Base/Test/AssemblyInfo.cs @@ -30,7 +30,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/Main/Core/Project/Configuration/AssemblyInfo.cs b/src/Main/Core/Project/Configuration/AssemblyInfo.cs index 2ddd1d72fd..2f0e11d412 100644 --- a/src/Main/Core/Project/Configuration/AssemblyInfo.cs +++ b/src/Main/Core/Project/Configuration/AssemblyInfo.cs @@ -20,6 +20,6 @@ using System.Runtime.CompilerServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] [assembly: AssemblyDelaySign(false)] diff --git a/src/Main/Core/Test/AssemblyInfo.cs b/src/Main/Core/Test/AssemblyInfo.cs index a9f97766a1..8ec5fff5b3 100644 --- a/src/Main/Core/Test/AssemblyInfo.cs +++ b/src/Main/Core/Test/AssemblyInfo.cs @@ -30,7 +30,7 @@ using System.Runtime.CompilerServices; // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("2.0.0.1")] +[assembly: AssemblyVersion("2.0.0.982")] // The following attributes specify the key for the sign of your assembly. See the // .NET Framework documentation for more information about signing. diff --git a/src/Main/StartUp/Project/SharpDevelop.exe.config b/src/Main/StartUp/Project/SharpDevelop.exe.config index 67038f51ae..fb5620c7ed 100644 --- a/src/Main/StartUp/Project/SharpDevelop.exe.config +++ b/src/Main/StartUp/Project/SharpDevelop.exe.config @@ -6,19 +6,19 @@ - + - + - + - + diff --git a/src/SharpDevelop.sln b/src/SharpDevelop.sln index 26a3223270..bc8f43eb86 100644 --- a/src/SharpDevelop.sln +++ b/src/SharpDevelop.sln @@ -1,5 +1,5 @@ Microsoft Visual Studio Solution File, Format Version 9.00 -# SharpDevelop 2.0.0.909 +# SharpDevelop 2.0.0.960 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AddIns", "AddIns", "{14A277EE-7DF1-4529-B639-7D1EF334C1C5}" ProjectSection(SolutionItems) = postProject EndProjectSection @@ -32,6 +32,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Misc", "Misc", "{CE5B42B7-6 ProjectSection(SolutionItems) = postProject EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoReflectionLoader", "AddIns\Misc\MonoReflectionLoader\Project\MonoReflectionLoader.csproj", "{8C52FFA5-35AF-4E28-8498-2DC2F168A241}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoAddIn", "AddIns\Misc\MonoAddIn\Project\MonoAddIn.csproj", "{082DCD64-EE32-4151-A50F-E139CF754CC0}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PInvokeAddIn", "AddIns\Misc\PInvokeAddIn\Project\PInvokeAddIn.csproj", "{5EEB99CF-EA2B-4733-80A6-CE9192D68170}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AddInManager", "AddIns\Misc\AddInManager\Project\AddInManager.csproj", "{F93E52FD-DA66-4CE5-A0CB-BCD902811122}" @@ -228,6 +232,14 @@ Global {5EEB99CF-EA2B-4733-80A6-CE9192D68170}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5EEB99CF-EA2B-4733-80A6-CE9192D68170}.Release|Any CPU.Build.0 = Release|Any CPU {5EEB99CF-EA2B-4733-80A6-CE9192D68170}.Release|Any CPU.ActiveCfg = Release|Any CPU + {082DCD64-EE32-4151-A50F-E139CF754CC0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {082DCD64-EE32-4151-A50F-E139CF754CC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {082DCD64-EE32-4151-A50F-E139CF754CC0}.Release|Any CPU.Build.0 = Release|Any CPU + {082DCD64-EE32-4151-A50F-E139CF754CC0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8C52FFA5-35AF-4E28-8498-2DC2F168A241}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8C52FFA5-35AF-4E28-8498-2DC2F168A241}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8C52FFA5-35AF-4E28-8498-2DC2F168A241}.Release|Any CPU.Build.0 = Release|Any CPU + {8C52FFA5-35AF-4E28-8498-2DC2F168A241}.Release|Any CPU.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -255,6 +267,8 @@ Global {1DB3CAD2-38E8-4C5E-8E1B-0E37B1A5C006} = {CE5B42B7-6E8C-4385-9E97-F4023FC16BF2} {F93E52FD-DA66-4CE5-A0CB-BCD902811122} = {CE5B42B7-6E8C-4385-9E97-F4023FC16BF2} {5EEB99CF-EA2B-4733-80A6-CE9192D68170} = {CE5B42B7-6E8C-4385-9E97-F4023FC16BF2} + {082DCD64-EE32-4151-A50F-E139CF754CC0} = {CE5B42B7-6E8C-4385-9E97-F4023FC16BF2} + {8C52FFA5-35AF-4E28-8498-2DC2F168A241} = {CE5B42B7-6E8C-4385-9E97-F4023FC16BF2} {B08385CD-F0CC-488C-B4F4-EEB34B6D2688} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D} {1D18D788-F7EE-4585-A23B-34DC8EC63CB8} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D} {EC06F96A-AEEC-49D6-B03D-AB87C6EB674C} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D}