You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by pt...@apache.org on 2018/01/19 13:20:02 UTC

ignite git commit: IGNITE-7117 .NET: Improve IgniteHome resolver

Repository: ignite
Updated Branches:
  refs/heads/master 1ae1350e7 -> c305b9131


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/c305b913
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/c305b913
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/c305b913

Branch: refs/heads/master
Commit: c305b91318789150ac898dd8bd74d944baf4e90d
Parents: 1ae1350
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Fri Jan 19 16:19:52 2018 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Fri Jan 19 16:19:52 2018 +0300

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


http://git-wip-us.apache.org/repos/asf/ignite/blob/c305b913/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)
             {