private static List <string> GenerateWarningAccordingToVersionAttribute(DotNetCliTool dotNetCliTool) { List <string> warnings = new List <string>(); if (string.IsNullOrWhiteSpace(dotNetCliTool.Version)) { warnings.Add("Format version is missing, this tool may not be supported in this SDK version. Please contact the author."); // TODO wul loc } else { if (!Version.TryParse(dotNetCliTool.Version, out Version version)) { warnings.Add("Format version is malformed, this tool may not be supported in this SDK version. Please contact the author."); // TODO wul loc } else { if (version.Major > SupportedMajorVersion) { warnings.Add("Format version indicate this tool may not be fully supported in this SDK version. Please update SDK version."); // TODO wul loc } } } return(warnings); }
private static List <string> GenerateWarningAccordingToVersionAttribute(DotNetCliTool dotNetCliTool) { List <string> warnings = new List <string>(); if (string.IsNullOrWhiteSpace(dotNetCliTool.Version)) { warnings.Add(CommonLocalizableStrings.FormatVersionIsMissing); } else { if (!int.TryParse(dotNetCliTool.Version, out int version)) { warnings.Add(CommonLocalizableStrings.FormatVersionIsMalformed); } else { if (version > SupportedVersion) { warnings.Add(CommonLocalizableStrings.FormatVersionIsHigher); } } } return(warnings); }