예제 #1
0
        internal FileInfo FindTool(DirectoryInfo androidHome, string toolName, string windowsExtension, params string[] pathSegments)
        {
            var isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);

            var ext  = isWindows ? windowsExtension : string.Empty;
            var home = AndroidSdkManager.FindHome(androidHome)?.FirstOrDefault();

            if (home?.Exists ?? false)
            {
                var allSegments = new List <string>();
                allSegments.Add(home.FullName);
                allSegments.AddRange(pathSegments);
                allSegments.Add(toolName + ext);

                var tool = Path.Combine(allSegments.ToArray());

                if (File.Exists(tool))
                {
                    return(new FileInfo(tool));
                }
            }

            return(null);
        }
예제 #2
0
 public SdkTool(DirectoryInfo androidSdkHome)
 {
     AndroidSdkHome = AndroidSdkManager.FindHome(androidSdkHome)?.FirstOrDefault();
     Jdks           = new JdkLocator().Find()?.ToArray() ?? new JdkInfo[0];
 }