コード例 #1
0
        /// <summary>
        /// Get's protoc directory based on <paramref name="target"/>.
        /// </summary>
        /// <param name="target">The target.</param>
        /// <returns>Returns last directory part for given OS.</returns>
        public static string DirectoryFromTarget(OSTarget target)
        {
            switch (target)
            {
            case OSTarget.Google:
                return("google");

            case OSTarget.Linux64:
                return("linux_x64");

            case OSTarget.Linux86:
                return("linux_x86");

            case OSTarget.MacOSX64:
                return("macosx_x64");

            case OSTarget.MacOSX86:
                return("macosx_x86");

            case OSTarget.Windows64:
                return("windows_x64");

            case OSTarget.Windows86:
                return("windows_x86");

            default:
                throw new Exception($"Unknown OSTarget {target}");
            }
        }
コード例 #2
0
 /// <summary>
 /// Checks if target is Windows.
 /// </summary>
 /// <param name="target">The target.</param>
 /// <returns>True when target is Windows, false otherwise.</returns>
 public static bool IsWindows(OSTarget target) => target == OSTarget.Windows64 || target == OSTarget.Windows86;