From 23562683a1df6df7668d4486bfa3a42d2d5ad167 Mon Sep 17 00:00:00 2001 From: jbtule Date: Wed, 4 Apr 2018 23:24:47 -0500 Subject: [PATCH] Trying to fix deployment --- Version.props | 2 +- build.fsx | 36 +++++++++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/Version.props b/Version.props index 80d1d3f..062603e 100644 --- a/Version.props +++ b/Version.props @@ -1,5 +1,5 @@ - 2.0.8 + 2.0.9 \ No newline at end of file diff --git a/build.fsx b/build.fsx index cc81888..4001700 100755 --- a/build.fsx +++ b/build.fsx @@ -22,24 +22,42 @@ #I "packages/FAKE/tools" #r "FakeLib.dll" +#r "System.Xml.Linq.dll" open Fake +open System.Xml.Linq +open System.Xml.XPath let sln = "./Dynamitey.sln" let commonBuild target = let buildMode = getBuildParamOrDefault "configuration" "Release" let vsuffix = getBuildParamOrDefault "vsuffix" "" + + let versionPrefix = "Version.props" + |> System.IO.File.ReadAllText + |> XDocument.Parse + |> (fun x -> x.XPathEvaluate("//VersionPrefix/text()")) + |> (fun x-> x :?> seq) + |> Seq.exactlyOne + |> sprintf "%A" + + let vProp = + if System.Text.RegularExpressions.Regex.IsMatch(vsuffix, "^\d+$") then + "Version", versionPrefix + "." + vsuffix + else + "VersionSuffix", vsuffix + let setParams defaults = - { defaults with - Verbosity = Some(Quiet) - Targets = [target] - Properties = - [ - "Configuration", buildMode - "VersionSuffix", vsuffix - ] - } + { defaults with + Verbosity = Some(Quiet) + Targets = [target] + Properties = + [ + "Configuration", buildMode + vProp + ] + } build setParams sln |> DoNothing