Skip to content

Commit

Permalink
And another
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveGilham committed Aug 10, 2022
1 parent ac99c45 commit 9681fcc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 22 deletions.
24 changes: 7 additions & 17 deletions Build/targets.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down
13 changes: 8 additions & 5 deletions Samples/Sample9/sample9.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="altcover" Version="3.5.550" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.0" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="altcover" Version="8.3.838" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net472" Version="1.0.2" Condition="'$(TargetFramework)' == 'net472'" >
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net472" Version="1.0.2" Condition="'$(TargetFramework)' == 'net472'">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down

0 comments on commit 9681fcc

Please sign in to comment.