Add table generator to the installer repo so it can be found and updated along with the tables.

This commit is contained in:
Marc Paine 2020-11-23 15:46:21 -08:00
parent dcc8aac7af
commit 668d2efb0e
10 changed files with 1066 additions and 1 deletions

View file

@ -0,0 +1,42 @@
module TableGenerator.Shared
open NuGet.Versioning
open System
type Branch =
{ GitBranchName: string
DisplayName: string
AkaMsChannel: string option }
type ReferenceTemplate =
{ AkaMSTemplate: string
LegacyTemplate: string }
let branchNameShorten (branch: Branch): string =
branch.GitBranchName.Substring(branch.GitBranchName.IndexOf('/') + 1).Replace("xx", "XX")
type BranchMajorMinorVersion =
{ Major: int
Minor: int
Release: string}
type BranchMajorMinorVersionOrMaster =
| Master
| MajorMinor of BranchMajorMinorVersion
| NoVersion
let getMajorMinor (branch: Branch): BranchMajorMinorVersionOrMaster =
match branch.GitBranchName = "master" with
| true -> Master
| _ ->
match branch.GitBranchName.IndexOf('/') with
| index when index < 0 -> NoVersion
| _ ->
match NuGetVersion.TryParseStrict
(branch.GitBranchName.Substring(branch.GitBranchName.IndexOf('/') + 1).Replace("xx", "99")) with
| true, version ->
MajorMinor
{ Major = version.Major
Minor = version.Minor
Release = version.Release}
| _ -> NoVersion