From 154525ecda08f5524d23f222240226d02b4bd1d8 Mon Sep 17 00:00:00 2001 From: Mpdreamz Date: Thu, 3 Aug 2017 22:26:14 +0200 Subject: [PATCH] move Paket.Pack() over to use flag arguments from the now deprecated positional arguments. backport to 4 from #1627 --- src/app/FakeLib/PaketHelper.fs | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/app/FakeLib/PaketHelper.fs b/src/app/FakeLib/PaketHelper.fs index 4ab2c522755..62347296ced 100755 --- a/src/app/FakeLib/PaketHelper.fs +++ b/src/app/FakeLib/PaketHelper.fs @@ -21,6 +21,7 @@ type PaketPackParams = ExcludedTemplates : string list WorkingDir : string OutputPath : string + ProjectUrl : string Symbols : bool IncludeReferencedProjects : bool MinimumFromLockFile : bool @@ -37,6 +38,7 @@ let PaketPackDefaults() : PaketPackParams = BuildConfig = null BuildPlatform = null TemplateFile = null + ProjectUrl = null ExcludedTemplates = [] WorkingDir = "." OutputPath = "./temp" @@ -98,22 +100,25 @@ let Pack setParams = let xmlEncode (notEncodedText : string) = if String.IsNullOrWhiteSpace notEncodedText then "" else XText(notEncodedText).ToString().Replace("ß", "ß") - - let version = if String.IsNullOrWhiteSpace parameters.Version then "" else " version " + toParam parameters.Version - let releaseNotes = if String.IsNullOrWhiteSpace parameters.ReleaseNotes then "" else " releaseNotes " + toParam (xmlEncode parameters.ReleaseNotes) - let buildConfig = if String.IsNullOrWhiteSpace parameters.BuildConfig then "" else " buildconfig " + toParam parameters.BuildConfig - let buildPlatform = if String.IsNullOrWhiteSpace parameters.BuildPlatform then "" else " buildplatform " + toParam parameters.BuildPlatform - let templateFile = if String.IsNullOrWhiteSpace parameters.TemplateFile then "" else " templatefile " + toParam parameters.TemplateFile - let lockDependencies = if parameters.LockDependencies then " lock-dependencies" else "" - let excludedTemplates = parameters.ExcludedTemplates |> Seq.map (fun t -> " exclude " + t) |> String.concat " " - let specificVersions = parameters.SpecificVersions |> Seq.map (fun (id,v) -> sprintf " specific-version %s %s" id v) |> String.concat " " - let symbols = if parameters.Symbols then " symbols" else "" - let includeReferencedProjects = if parameters.IncludeReferencedProjects then " include-referenced-projects" else "" - let minimumFromLockFile = if parameters.MinimumFromLockFile then " minimum-from-lock-file" else "" - let pinProjectReferences = if parameters.PinProjectReferences then " pin-project-references" else "" + let version = if String.IsNullOrWhiteSpace parameters.Version then "" else " --version " + Process.toParam parameters.Version + let buildConfig = if String.IsNullOrWhiteSpace parameters.BuildConfig then "" else " --build-config " + Process.toParam parameters.BuildConfig + let buildPlatform = if String.IsNullOrWhiteSpace parameters.BuildPlatform then "" else " --build-platform " + Process.toParam parameters.BuildPlatform + let templateFile = if String.IsNullOrWhiteSpace parameters.TemplateFile then "" else " --template " + Process.toParam parameters.TemplateFile + let lockDependencies = if parameters.LockDependencies then " --lock-dependencies" else "" + let excludedTemplates = parameters.ExcludedTemplates |> Seq.map (fun t -> " --exclude " + t) |> String.concat " " + let specificVersions = parameters.SpecificVersions |> Seq.map (fun (id,v) -> sprintf " --specific-version %s %s" id v) |> String.concat " " + let releaseNotes = if String.IsNullOrWhiteSpace parameters.ReleaseNotes then "" else " --release-notes " + Process.toParam (xmlEncode parameters.ReleaseNotes) + let minimumFromLockFile = if parameters.MinimumFromLockFile then " --minimum-from-lock-file" else "" + let pinProjectReferences = if parameters.PinProjectReferences then " --pin-project-references" else "" + let symbols = if parameters.Symbols then " --symbols" else "" + let includeReferencedProjects = if parameters.IncludeReferencedProjects then " --include-referenced-projects" else "" + let projectUrl = if String.IsNullOrWhiteSpace parameters.ProjectUrl then "" else " --project-url " + Process.toParam parameters.ProjectUrl let packResult = - let cmdArgs = sprintf "%s%s%s%s%s%s%s%s%s%s%s%s" version specificVersions releaseNotes buildConfig buildPlatform templateFile lockDependencies excludedTemplates symbols includeReferencedProjects minimumFromLockFile pinProjectReferences + let cmdArgs = + sprintf "%s%s%s%s%s%s%s%s%s%s%s%s%s" + version specificVersions releaseNotes buildConfig buildPlatform templateFile lockDependencies excludedTemplates + symbols includeReferencedProjects minimumFromLockFile pinProjectReferences projectUrl ExecProcess (fun info -> info.FileName <- parameters.ToolPath