ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ptupit...@apache.org
Subject ignite git commit: IGNITE-7117 .NET: Improve IgniteHome resolver
Date Fri, 19 Jan 2018 13:22:55 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-2.4 7adce1075 -> 25e91b606


IGNITE-7117 .NET: Improve IgniteHome resolver

This closes #3402


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/25e91b60
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/25e91b60
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/25e91b60

Branch: refs/heads/ignite-2.4
Commit: 25e91b60694c589d8bf50c63a0d898ca4180b428
Parents: 7adce10
Author: Pavel Tupitsyn <ptupitsyn@apache.org>
Authored: Fri Jan 19 16:19:52 2018 +0300
Committer: Pavel Tupitsyn <ptupitsyn@apache.org>
Committed: Fri Jan 19 16:22:33 2018 +0300

----------------------------------------------------------------------
 .../Impl/Common/IgniteHome.cs                   | 29 +++++++++++++-------
 1 file changed, 19 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/25e91b60/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/IgniteHome.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/IgniteHome.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/IgniteHome.cs
index d61c6b4..615798c 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/IgniteHome.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Common/IgniteHome.cs
@@ -112,16 +112,25 @@ namespace Apache.Ignite.Core.Impl.Common
         {
             try
             {
-                return dir.Exists &&
-                       (dir.EnumerateDirectories().Count(x => x.Name == "examples" ||
x.Name == "bin") == 2 &&
-                        dir.EnumerateDirectories().Count(x => x.Name == "modules" || x.Name
== "platforms") == 1)
-                       || // NuGet home
-                       (dir.EnumerateDirectories().Any(x => x.Name == "libs") &&
-                        (dir.EnumerateFiles("Apache.Ignite.Core.dll").Any() ||
-                         dir.EnumerateFiles("Apache.Ignite.*.nupkg").Any() ||
-                         dir.EnumerateFiles("apache.ignite.*.nupkg").Any() ||  // Lowercase
on Linux
-                         dir.EnumerateFiles("apache.ignite.nuspec").Any() ||  // Lowercase
on Linux
-                         dir.EnumerateFiles("Apache.Ignite.nuspec").Any()));
+                if (!dir.Exists)
+                {
+                    return false;
+                }
+
+                // Binary release or NuGet home:
+                var libs = Path.Combine(dir.FullName, "libs");
+
+                if (Directory.Exists(libs) &&
+                    Directory.EnumerateFiles(libs, "ignite-core-*.jar", SearchOption.TopDirectoryOnly).Any())
+                {
+                    return true;
+                }
+
+                // Source release home:
+                var javaSrc = Path.Combine(dir.FullName,
+                    "modules", "core", "src", "main", "java", "org", "apache", "ignite");
+
+                return Directory.Exists(javaSrc);
             }
             catch (IOException)
             {


Mime
View raw message