From eb93ff4149f107c8301d0eb6367f7400a80c2e2f Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Fri, 28 Oct 2005 11:11:38 +0000 Subject: [PATCH] SharpDevelop now passes properties so that MSBuild accepts them for both the scanning and building steps -> compiling Boo and ILAsm applications and specifying the target Framework version in C# works again. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@644 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Boo/BooBinding/Project/BooBinding.csproj | 1 - .../CompletionWindow/DeclarationViewWindow.cs | 8 ++++++++ .../Project/Src/Gui/TextArea.cs | 1 + .../Gui/Dialogs/ReferenceDialog/FusionNative.cs | 3 ++- .../Base/Project/Src/Project/MSBuildEngine.cs | 16 +++++----------- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/AddIns/BackendBindings/Boo/BooBinding/Project/BooBinding.csproj b/src/AddIns/BackendBindings/Boo/BooBinding/Project/BooBinding.csproj index cdeb9d3e33..b41d1635ba 100644 --- a/src/AddIns/BackendBindings/Boo/BooBinding/Project/BooBinding.csproj +++ b/src/AddIns/BackendBindings/Boo/BooBinding/Project/BooBinding.csproj @@ -120,7 +120,6 @@ NRefactoryToBooConverter True - {7D7E92DF-ACEB-4B69-92C8-8AC7A703CD57} FormDesigner diff --git a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/DeclarationViewWindow.cs b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/DeclarationViewWindow.cs index 3255e394cb..92de37a207 100644 --- a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/DeclarationViewWindow.cs +++ b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/CompletionWindow/DeclarationViewWindow.cs @@ -48,6 +48,8 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow } } + public bool HideOnClick; + public DeclarationViewWindow(Form parent) { SetStyle(ControlStyles.Selectable, false); @@ -59,6 +61,12 @@ namespace ICSharpCode.TextEditor.Gui.CompletionWindow base.CreateHandle(); } + protected override void OnClick(EventArgs e) + { + base.OnClick(e); + if (HideOnClick) Hide(); + } + public void ShowDeclarationViewWindow() { AbstractCompletionWindow.ShowWindowWithoutFocus(this); diff --git a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextArea.cs b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextArea.cs index 02fb36ced1..728ccbd525 100644 --- a/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextArea.cs +++ b/src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextArea.cs @@ -320,6 +320,7 @@ namespace ICSharpCode.TextEditor p.Offset(3, 3); toolTip.Location = p; toolTip.Description = text; + toolTip.HideOnClick = true; toolTip.Show(); } oldToolTip = text; diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/FusionNative.cs b/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/FusionNative.cs index bddeba3e66..28049f437c 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/FusionNative.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/FusionNative.cs @@ -8,6 +8,7 @@ using System; using System.Text; using System.Runtime.InteropServices; +using System.Runtime.InteropServices.ComTypes; namespace MSjogren.GacTool.FusionNative { @@ -47,7 +48,7 @@ namespace MSjogren.GacTool.FusionNative uint dwFormat, uint dwFlags, uint dwMaxSize, - out UCOMIStream ppStream); + out IStream ppStream); void IsNameEqual(IAssemblyName pName); diff --git a/src/Main/Base/Project/Src/Project/MSBuildEngine.cs b/src/Main/Base/Project/Src/Project/MSBuildEngine.cs index e8d31069bf..b9d84c32eb 100644 --- a/src/Main/Base/Project/Src/Project/MSBuildEngine.cs +++ b/src/Main/Base/Project/Src/Project/MSBuildEngine.cs @@ -107,22 +107,16 @@ namespace ICSharpCode.SharpDevelop.Project { LoggingService.Debug("Run MSBuild on " + buildFile); - // HACK: Workaround for MSBuild bug: - // "unknown" MSBuild projects (projects with unknown type id, e.g. IL-projects) - // are looked up by MSBuild if the project files are MSBuild-compatible. - // That lookup method has a bug: it uses the working directory instead of the - // solution directory as base path for the lookup. - Environment.CurrentDirectory = Path.GetDirectoryName(buildFile); - - BuildPropertyGroup properties = new BuildPropertyGroup(); + Engine engine = new Engine(System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory()); foreach (KeyValuePair entry in MsBuildProperties) { - properties.SetProperty(entry.Key, entry.Value); + engine.GlobalProperties.SetProperty(entry.Key, entry.Value); } - Engine engine = new Engine(System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory()); SharpDevelopLogger logger = new SharpDevelopLogger(this.engine, results); engine.RegisterLogger(logger); - engine.BuildProjectFile(buildFile, targets, properties, null); + // IMPORTANT: engine.GlobalProperties must be passed here. + // The properties must be available for both the scanning and building steps + engine.BuildProjectFile(buildFile, targets, engine.GlobalProperties); LoggingService.Debug("MSBuild finished"); }