Exemple #1
0
        private ToolVersion?GetVersion()
        {
            var process = CreateProcess(" --version");

            process.Start();
            process.WaitForExit();
            return(ToolVersion.Parse(process.StandardOutput.ReadToEnd()));
        }
Exemple #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (ToolId != null ? ToolId.ToLower().GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ToolVersion != null ? ToolVersion.ToLower().GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (FileName != null ? FileName.ToLower().GetHashCode() : 0);
         return(hashCode);
     }
 }
Exemple #3
0
        public override bool Execute()
        {
            try
            {
                if (!FindRustc())
                {
                    return(false);
                }

                var version = GetVersion();
                if (!version.HasValue)
                {
                    return(false);
                }
                rustcVersion = version.Value;

                return(ExecuteInner());
            }
            catch (Exception ex)
            {
                this.Log.LogErrorFromException(ex, true);
                return(false);
            }
        }