From f0873dbe77fbcbe83a0f4dadbfb3fdd1af408fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=BE=D0=BD=D0=B4=D0=B0=D1=80=D0=B5=D0=B2=20=D0=98?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD?= Date: Mon, 3 Apr 2017 21:29:18 +0200 Subject: [PATCH] constant %GAC% to force searching referenced assemblies only in GAC --- Compiler/Compiler.cs | 19 ++++++++++--------- bin/Lib/ABCObjects.pas | 4 ++-- bin/Lib/DMCollect.pas | 4 ++-- bin/Lib/GraphABC.pas | 4 ++-- bin/Lib/GraphABCHelper.pas | 4 ++-- bin/Lib/PABCSystem.pas | 8 ++++---- 6 files changed, 22 insertions(+), 21 deletions(-) diff --git a/Compiler/Compiler.cs b/Compiler/Compiler.cs index b1d130ee9..30b2935df 100644 --- a/Compiler/Compiler.cs +++ b/Compiler/Compiler.cs @@ -2684,13 +2684,13 @@ namespace PascalABCCompiler directives = ConvertDirectives(Unit.SyntaxTree); if (CompilerOptions.UseDllForSystemUnits) { - directives.Add(new TreeRealization.compiler_directive("reference", "PABCRtl.dll", null)); - directives.Add(new TreeRealization.compiler_directive("reference", "mscorlib.dll", null)); - directives.Add(new TreeRealization.compiler_directive("reference", "System.dll", null)); - directives.Add(new TreeRealization.compiler_directive("reference", "System.Core.dll", null)); - directives.Add(new TreeRealization.compiler_directive("reference", "System.Numerics.dll", null)); - directives.Add(new TreeRealization.compiler_directive("reference", "System.Windows.Forms.dll", null)); - directives.Add(new TreeRealization.compiler_directive("reference", "System.Drawing.dll", null)); + directives.Add(new TreeRealization.compiler_directive("reference", "%GAC%\\PABCRtl.dll", null)); + directives.Add(new TreeRealization.compiler_directive("reference", "%GAC%\\mscorlib.dll", null)); + directives.Add(new TreeRealization.compiler_directive("reference", "%GAC%\\System.dll", null)); + directives.Add(new TreeRealization.compiler_directive("reference", "%GAC%\\System.Core.dll", null)); + directives.Add(new TreeRealization.compiler_directive("reference", "%GAC%\\System.Numerics.dll", null)); + directives.Add(new TreeRealization.compiler_directive("reference", "%GAC%\\System.Windows.Forms.dll", null)); + directives.Add(new TreeRealization.compiler_directive("reference", "%GAC%\\System.Drawing.dll", null)); } foreach (TreeRealization.compiler_directive cd in directives) { @@ -3373,6 +3373,7 @@ namespace PascalABCCompiler } public static string get_standart_assembly_path(string name) { + name = name.Replace("%GAC%\\", ""); string ttn = System.IO.Path.GetFileNameWithoutExtension(name); string tn = Path.Combine(standartAssemblyPath, name); if (File.Exists(tn)) @@ -3452,7 +3453,7 @@ namespace PascalABCCompiler public static string get_assembly_path(string name, bool search_for_intellisense) { //если явно задан каталог то ищем только там - if (Environment.OSVersion.Platform != PlatformID.Unix && Environment.OSVersion.Platform != PlatformID.MacOSX) + if (Environment.OSVersion.Platform != PlatformID.Unix && Environment.OSVersion.Platform != PlatformID.MacOSX && !name.StartsWith("%GAC%\\")) { if (Path.GetDirectoryName(name) != string.Empty) if (File.Exists(name)) @@ -3473,7 +3474,7 @@ namespace PascalABCCompiler } } - if (!search_for_intellisense) + if (!search_for_intellisense && !name.StartsWith("%GAC%\\")) { string dir = Environment.CurrentDirectory; diff --git a/bin/Lib/ABCObjects.pas b/bin/Lib/ABCObjects.pas index 601ddcbae..a77f0e491 100644 --- a/bin/Lib/ABCObjects.pas +++ b/bin/Lib/ABCObjects.pas @@ -8,8 +8,8 @@ unit ABCObjects; //{$apptype windows} -{$reference 'System.Windows.Forms.dll'} -{$reference 'System.Drawing.dll'} +{$reference '%GAC%\System.Windows.Forms.dll'} +{$reference '%GAC%\System.Drawing.dll'} {$gendoc true} interface diff --git a/bin/Lib/DMCollect.pas b/bin/Lib/DMCollect.pas index 2018bdf9f..f05c39526 100644 --- a/bin/Lib/DMCollect.pas +++ b/bin/Lib/DMCollect.pas @@ -1,8 +1,8 @@ -// Copyright (c) Ivan Bondarev, Stanislav Mihalkovich (for details please see \doc\copyright.txt) +// Copyright (c) Ivan Bondarev, Stanislav Mihalkovich (for details please see \doc\copyright.txt) // This code is distributed under the GNU LGPL (for details please see \doc\license.txt) unit DMCollect; -{$reference 'System.Drawing.dll'} +{$reference '%GAC%\System.Drawing.dll'} interface diff --git a/bin/Lib/GraphABC.pas b/bin/Lib/GraphABC.pas index 9c97b1172..92b040d70 100644 --- a/bin/Lib/GraphABC.pas +++ b/bin/Lib/GraphABC.pas @@ -7,8 +7,8 @@ unit GraphABC; //ne udaljat, IB 7.10.08 //с дополнениями 2015.01 (mabr) {$apptype windows} -{$reference 'System.Windows.Forms.dll'} -{$reference 'System.Drawing.dll'} +{$reference '%GAC%\System.Windows.Forms.dll'} +{$reference '%GAC%\System.Drawing.dll'} {$gendoc true} interface diff --git a/bin/Lib/GraphABCHelper.pas b/bin/Lib/GraphABCHelper.pas index 271187116..15f0826f9 100644 --- a/bin/Lib/GraphABCHelper.pas +++ b/bin/Lib/GraphABCHelper.pas @@ -3,8 +3,8 @@ unit GraphABCHelper; //{$apptype windows} -{$reference 'System.Windows.Forms.dll'} -{$reference 'System.Drawing.dll'} +{$reference '%GAC%\System.Windows.Forms.dll'} +{$reference '%GAC%\System.Drawing.dll'} interface diff --git a/bin/Lib/PABCSystem.pas b/bin/Lib/PABCSystem.pas index e458548f1..41713fd1b 100644 --- a/bin/Lib/PABCSystem.pas +++ b/bin/Lib/PABCSystem.pas @@ -12,10 +12,10 @@ unit PABCSystem; // Default Application type {$apptype console} -{$reference 'System.dll'} -{$reference 'mscorlib.dll'} -{$reference 'System.Core.dll'} -{$reference 'System.Numerics.dll'} +{$reference '%GAC%\System.dll'} +{$reference '%GAC%\mscorlib.dll'} +{$reference '%GAC%\System.Core.dll'} +{$reference '%GAC%\System.Numerics.dll'} interface