From ed39215d85fac67dd24af706bda4640da9e2a3c3 Mon Sep 17 00:00:00 2001 From: Mikhalkovich Stanislav Date: Wed, 29 Nov 2023 12:35:53 +0300 Subject: [PATCH] fix #2932 --- Configuration/GlobalAssemblyInfo.cs | 2 +- Configuration/Version.defs | 4 +- Release/pabcversion.txt | 2 +- ReleaseGenerators/PascalABCNET_version.nsh | 2 +- VisualPascalABCNET/Projects/NuGetTasks.cs | 44 ++++++++++++++++++++-- 5 files changed, 46 insertions(+), 8 deletions(-) diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 60495f349..e0a31afcf 100644 --- a/Configuration/GlobalAssemblyInfo.cs +++ b/Configuration/GlobalAssemblyInfo.cs @@ -15,7 +15,7 @@ internal static class RevisionClass public const string Major = "3"; public const string Minor = "9"; public const string Build = "0"; - public const string Revision = "3383"; + public const string Revision = "3384"; public const string MainVersion = Major + "." + Minor; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; diff --git a/Configuration/Version.defs b/Configuration/Version.defs index 5a1fc3e94..edb2e4279 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%MINOR%=9 -%REVISION%=3383 %COREVERSION%=0 +%REVISION%=3384 +%MINOR%=9 %MAJOR%=3 diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index 11a677303..68df9c6a2 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.9.0.3383 +3.9.0.3384 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index f468f2052..107c6d075 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.9.0.3383' +!define VERSION '3.9.0.3384' diff --git a/VisualPascalABCNET/Projects/NuGetTasks.cs b/VisualPascalABCNET/Projects/NuGetTasks.cs index 74327f899..1a1888b43 100644 --- a/VisualPascalABCNET/Projects/NuGetTasks.cs +++ b/VisualPascalABCNET/Projects/NuGetTasks.cs @@ -6,6 +6,7 @@ using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; @@ -43,6 +44,37 @@ namespace VisualPascalABC nugetProcess.WaitForExit(); } + static string getDotnetDir(string startDir) + { + // 481 48 472 471 47 462 461 46 452 451 45 4 + var s = "481 48 472 471 47 462 461 46 452 451 45 4"; + var ss = s.Split().Reverse().Select(d => "net" + d).ToList(); + ss.Add("netstandard2.0"); + ss.Add("net"); + + string Dir = ""; + foreach (var dd in ss) + { + Dir = Path.Combine(startDir, dd); + if (Directory.Exists(Dir)) + break; + } + + /*string Dir = Path.Combine(startDir, "net40"); + if (!Directory.Exists(Dir)) + Dir = Path.Combine(startDir, "net45"); + if (!Directory.Exists(Dir)) + Dir = Path.Combine(startDir, "net46"); + if (!Directory.Exists(Dir)) + Dir = Path.Combine(startDir, "netstandard2.0"); + if (!Directory.Exists(Dir)) + Dir = Path.Combine(startDir, "net");*/ + + if (!Directory.Exists(Dir)) + Dir = startDir; + return Dir; + } + static bool getPackage(string workingDir, out string[] dlls, out string[] xmls, out string[] ndlls) { dlls = null; @@ -57,7 +89,9 @@ namespace VisualPascalABC string libDir = Path.Combine(dir, "lib"); if (Directory.Exists(libDir)) { - string dotnetDir = Path.Combine(libDir, "net40"); + string dotnetDir = getDotnetDir(libDir); + + /*string dotnetDir = Path.Combine(libDir, "net40"); if (!Directory.Exists(dotnetDir)) dotnetDir = Path.Combine(libDir, "net45"); if (!Directory.Exists(dotnetDir)) @@ -67,7 +101,8 @@ namespace VisualPascalABC if (!Directory.Exists(dotnetDir)) dotnetDir = Path.Combine(libDir, "net"); if (!Directory.Exists(dotnetDir)) - dotnetDir = libDir; + dotnetDir = libDir;*/ + if (Directory.Exists(dotnetDir)) { string[] dllFiles = Directory.GetFiles(dotnetDir, "*.dll"); @@ -88,7 +123,7 @@ namespace VisualPascalABC runtimesDir = Path.Combine(dir, "runtimes", "win-x64", "native"); if (Directory.Exists(runtimesDir)) { - string dotnetDir = Path.Combine(runtimesDir, "net40"); + /*string dotnetDir = Path.Combine(runtimesDir, "net40"); if (!Directory.Exists(dotnetDir)) dotnetDir = Path.Combine(runtimesDir, "net45"); if (!Directory.Exists(dotnetDir)) @@ -99,6 +134,9 @@ namespace VisualPascalABC dotnetDir = Path.Combine(runtimesDir, "net"); if (!Directory.Exists(dotnetDir)) dotnetDir = runtimesDir; + */ + string dotnetDir = getDotnetDir(runtimesDir); + if (Directory.Exists(dotnetDir)) { string[] nativedllFiles = Directory.GetFiles(dotnetDir, "*.dll");