constant %GAC% to force searching referenced assemblies only in GAC

This commit is contained in:
Бондарев Иван 2017-04-03 21:29:18 +02:00
parent f264b59a1b
commit f0873dbe77
6 changed files with 22 additions and 21 deletions

View file

@ -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;

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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