From 9681fcc6c97644756dde2549ddadcc17c3398e8c Mon Sep 17 00:00:00 2001 From: Steve Gilham Date: Wed, 10 Aug 2022 17:37:51 +0100 Subject: [PATCH] And another --- Build/targets.fsx | 24 +++++++----------------- Samples/Sample9/sample9.csproj | 13 ++++++++----- 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/Build/targets.fsx b/Build/targets.fsx index 662d7af75..49ca8136c 100644 --- a/Build/targets.fsx +++ b/Build/targets.fsx @@ -6351,14 +6351,9 @@ _Target "Issue23" (fun _ -> csproj.Descendants(XName.Get("PackageReference")) |> Seq.head - let inject = - XElement( - XName.Get "PackageReference", - XAttribute(XName.Get "Include", "altcover"), - XAttribute(XName.Get "Version", Version.Value) - ) - - pack.AddBeforeSelf inject + // Bump the version + Assert.That(pack.Attribute(XName.Get "Include").Value, Is.EqualTo "altcover") + pack.Attribute(XName.Get "Version").Value <- Version.Value csproj.Save "./_Issue23/sample9.csproj" Shell.copy "./_Issue23" (!! "./Samples/Sample9/*.cs") Shell.copy "./_Issue23" (!! "./Samples/Sample9/*.json") @@ -6415,20 +6410,15 @@ _Target "Issue67" (fun _ -> csproj.Descendants(XName.Get("TargetFramework")) |> Seq.head - target.SetValue "netcoreapp2.1" + target.SetValue "net6.0" let pack = csproj.Descendants(XName.Get("PackageReference")) |> Seq.head - let inject = - XElement( - XName.Get "PackageReference", - XAttribute(XName.Get "Include", "altcover"), - XAttribute(XName.Get "Version", Version.Value) - ) - - pack.AddBeforeSelf inject + // Bump the version + Assert.That(pack.Attribute(XName.Get "Include").Value, Is.EqualTo "altcover") + pack.Attribute(XName.Get "Version").Value <- Version.Value csproj.Save "./_Issue67/sample9.csproj" Shell.copy "./_Issue67" (!! "./Samples/Sample9/*.cs") Shell.copy "./_Issue67" (!! "./Samples/Sample9/*.json") diff --git a/Samples/Sample9/sample9.csproj b/Samples/Sample9/sample9.csproj index b79cdcf79..1af9d2f4c 100644 --- a/Samples/Sample9/sample9.csproj +++ b/Samples/Sample9/sample9.csproj @@ -7,15 +7,18 @@ - - - - + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + - + all runtime; build; native; contentfiles; analyzers; buildtransitive