Skip to content

Commit

Permalink
Merge branch 'develop/maintenance' into release/Habu
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveGilham committed Sep 13, 2022
2 parents 6f84ef8 + 4ecc726 commit 0518177
Show file tree
Hide file tree
Showing 201 changed files with 1,197 additions and 930 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
]
},
"fake-cli": {
"version": "5.22.0",
"version": "5.23.0",
"commands": [
"fake"
]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fetch-depth: 2
- uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.301'
dotnet-version: '6.0.400'
- name: Tools
run: dotnet tool restore
- name: Setup
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.301'
dotnet-version: '6.0.400'
- name: Tools
run: dotnet tool restore
- name: Setup
Expand Down
9 changes: 2 additions & 7 deletions AltCover.Api.Tests/AltCover.Api.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,10 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="YoloDev.Expecto.TestSdk" Version="1.0.0" Condition="'$(TargetFramework)' != 'net472'" />
<PackageReference Include="Mono.Cecil" Version="0.11.4" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net472" Version="1.0.2" Condition="'$(TargetFramework)' == 'net472'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net472" Version="1.0.3" Condition="'$(TargetFramework)' == 'net472'">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -86,7 +82,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Update="DotNet.ReproducibleBuilds" Version="1.1.1" />
<PackageReference Update="FSharp.Core" Version="6.0.5">
<ExcludeAssets>contentfiles</ExcludeAssets>
</PackageReference>
Expand Down
6 changes: 2 additions & 4 deletions AltCover.Async/AltCover.Async.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,14 @@

<ItemGroup>
<PackageReference Include="FSharp.Compiler.Tools" Version="10.2.3" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net46" Version="1.0.2">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net46" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Remove="System.ValueTuple" />
<PackageReference Remove="System.ValueTuple" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="DotNet.ReproducibleBuilds" Version="1.1.1" />
<PackageReference Update="FSharp.Core" Version="4.1.18" />
</ItemGroup>

</Project>
5 changes: 2 additions & 3 deletions AltCover.Avalonia/AltCover.Avalonia.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.15" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.15" />
<PackageReference Include="Avalonia" Version="0.10.18" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.18" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand All @@ -57,7 +57,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Update="DotNet.ReproducibleBuilds" Version="1.1.1" />
<PackageReference Update="FSharp.Core" Version="6.0.5">
<ExcludeAssets>contentfiles</ExcludeAssets>
</PackageReference>
Expand Down
3 changes: 0 additions & 3 deletions AltCover.Cake/AltCover.Cake.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,4 @@
<ProjectReference Include="..\AltCover.DotNet\AltCover.DotNet.fsproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="DotNet.ReproducibleBuilds" Version="1.1.1" />
</ItemGroup>
</Project>
3 changes: 0 additions & 3 deletions AltCover.DataCollector/AltCover.DataCollector.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,4 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Update="DotNet.ReproducibleBuilds" Version="1.1.1" />
</ItemGroup>
</Project>
1 change: 0 additions & 1 deletion AltCover.DotNet/AltCover.DotNet.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Update="DotNet.ReproducibleBuilds" Version="1.1.1" />
<PackageReference Update="FSharp.Core" Version="6.0.5">
<ExcludeAssets>contentfiles</ExcludeAssets>
</PackageReference>
Expand Down
1 change: 0 additions & 1 deletion AltCover.Engine/AltCover.Engine.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Update="DotNet.ReproducibleBuilds" Version="1.1.1" />
<PackageReference Update="FSharp.Core" Version="6.0.5">
<ExcludeAssets>contentfiles</ExcludeAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions AltCover.Engine/AltCover.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,11 @@ namespace AltCoverFake.DotNet.Testing
///</summary>
member Error : (System.String -> unit)
///<summary>
/// Sink for command line/usage messages
/// Sink for detailed messages
///</summary>
member Verbose : (System.String -> unit)
///<summary>
/// Sink for detailed messages
/// Sink for command line/usage messages
///</summary>
member Echo : (System.String -> unit)
///<summary>
Expand Down
30 changes: 30 additions & 0 deletions AltCover.Engine/CecilEx.fs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ open System.Reflection

open Mono.Cecil
open Mono.Cecil.Cil
open Mono.Cecil.Metadata

module AssemblyConstants =
let internal nugetCache =
Expand Down Expand Up @@ -190,12 +191,38 @@ module internal CecilExtension =
System.Reflection.BindingFlags.Instance
||| System.Reflection.BindingFlags.NonPublic)

let etypeField =
typeof<TypeReference>.GetField
("etype",
System.Reflection.BindingFlags.Instance
||| System.Reflection.BindingFlags.NonPublic)

let internal offsetTable =
System.Collections.Generic.SortedDictionary<int, Instruction>()

let unresolved (point: InstructionOffset) =
isResolvedProp.GetValue(point) :?> bool |> not

let checkScopeConstants (m: MethodDefinition) =
scopesSeen
|> Seq.iter(fun scope -> let sus = scope.Constants
|> Seq.filter (fun c -> (isNull c.Value) &&
match etypeField.GetValue(c.ConstantType) :?> byte with
| 0x14uy // ElementType.Array
| 0x1duy // ElementType.SzArray
| 0x12uy // ElementType.Class
| 0x1cuy // ElementType.Object
| 0x00uy // ElementType.None
| 0x13uy // ElementType.Var
| 0x1euy // ElementType.MVar
| 0x0euy // ElementType.String
-> false
| _ -> not c.ConstantType.IsPrimitive)
|> Seq.toList
sus |> Seq.iter (fun c -> scope.Constants.Remove c |> ignore
sprintf "Null Constant %s elided in method %s" c.Name m.FullName
|> Output.verbose))

let prepareLocalScopes (m: MethodDefinition) =
offsetTable.Clear()
scopesSeen.Clear()
Expand Down Expand Up @@ -238,6 +265,9 @@ module internal CecilExtension =
scope.End <- resolvePoint scope.End

m.DebugInformation.Scope |> resolveScope

checkScopeConstants m

pruneLocalScopes m

// Adjust the IL for exception handling
Expand Down
7 changes: 6 additions & 1 deletion AltCover.Engine/Tasks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,9 @@ type ContingentCopy() =
[<Required>]
member val InstrumentDirectory = String.Empty with get, set

member internal self.Write message =
``base``.Log.LogMessage(MessageImportance.High, message)

override self.Execute() =
//base.Log.LogMessage(MessageImportance.High, sprintf "Project dir %A" self.ProjectDir)
//base.Log.LogMessage(MessageImportance.High, sprintf "Relative dir %A" self.RelativeDir)
Expand Down Expand Up @@ -503,7 +506,9 @@ type ContingentCopy() =
if toDir |> Directory.Exists |> not then
toDir |> Directory.CreateDirectory |> ignore

File.Copy(from, toFile, true)
let copy x = File.Copy(x, toFile, true)
from
|> CommandLine.I.doRetry copy self.Write 10 1000 0

true

Expand Down
4 changes: 2 additions & 2 deletions AltCover.Engine/TypeSafe.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ namespace AltCoverFake.DotNet.Testing
//
// ### Individual files and directories
// ```
[<NoComparison>]
///<summary>
/// Corresponds to a file or executable tool
///</summary>
[<NoComparison>]
type FilePath =
///<summary>
/// A named `dotnet` tool, carried unaltered
Expand Down Expand Up @@ -177,10 +177,10 @@ namespace AltCoverFake.DotNet.Testing
// ```
// ### Yes/No choices
// ```
[<NoComparison>]
///<summary>
/// Corresponds to a yes/no choice
///</summary>
[<NoComparison>]
type Flag =
///<summary>
/// A type-safe boolean
Expand Down
10 changes: 5 additions & 5 deletions AltCover.Engine/WhatIfExtension.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,31 @@ open System.Runtime.CompilerServices /// no doc
// ```
// ## module `PrepareExtension` and module `CollectExtension`
// ```
[<Extension>]
///<summary>
/// `Abstract.IPrepareOptions` extension methods
///</summary>
[<Extension>]
module PrepareExtension = begin
[<Extension>]
///<summary>
/// Validates the supplied options
///</summary>
/// <param name="prepare">The options</param>
/// <returns>The validation outcome.</returns>
[<Extension>]
val WhatIf : prepare:Abstract.IPrepareOptions -> AltCover.ValidatedCommandLine
end
[<Extension>]
///<summary>
/// `Abstract.ICollectOptions` extension methods
///</summary>
[<Extension>]
module CollectExtension = begin
[<Extension>]
///<summary>
/// Validates the supplied options
///</summary>
/// <param name="collect">The options</param>
/// <param name="afterPreparation">Values indicating whether the instrumentation has already taken place</param>
/// <returns>The validation outcome.</returns>
[<Extension>]
val WhatIf :
collect:Abstract.ICollectOptions ->
afterPreparation:bool -> AltCover.ValidatedCommandLine
Expand All @@ -43,10 +43,10 @@ end
//
// ## module `WhatIfExtension`
// ```
[<AutoOpen>]
///<summary>
/// F#-style I&lt;Whatever&gt;Options extension methods
///</summary>
[<AutoOpen>]
module WhatIfExtension = begin
///<summary>
/// F# style `Abstract.ICollectOptions` extension methods
Expand Down
5 changes: 1 addition & 4 deletions AltCover.Expecto.Tests/AltCover.Expecto.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,15 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Expecto" Version="9.0.4" />
<PackageReference Include="Expecto.TestResults" Version="8.13.2" />
<PackageReference Include="YoloDev.Expecto.TestSdk" Version="1.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\AltCover.Tests\AltCover.Tests.fsproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="DotNet.ReproducibleBuilds" Version="1.1.1" />
<PackageReference Update="FSharp.Core" Version="6.0.5">
<ExcludeAssets>contentfiles</ExcludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,9 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Collections.Immutable" Version="1.7.1" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="DotNet.ReproducibleBuilds" Version="1.1.1" />
<PackageReference Update="FSharp.Core" Version="6.0.5">
<ExcludeAssets>contentfiles</ExcludeAssets>
</PackageReference>
Expand Down
1 change: 0 additions & 1 deletion AltCover.Fake/AltCover.Fake.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Update="DotNet.ReproducibleBuilds" Version="1.1.1" />
<PackageReference Update="FSharp.Core" Version="6.0.5">
<ExcludeAssets>contentfiles</ExcludeAssets>
</PackageReference>
Expand Down
8 changes: 2 additions & 6 deletions AltCover.FontSupport/AltCover.FontSupport.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Fake.Core.Process" Version="5.22.0" Condition="'$(TargetFramework)' != 'net472'" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net472" Version="1.0.2" Condition="'$(TargetFramework)' == 'net472'">
<PackageReference Include="Fake.Core.Process" Version="5.23.0" Condition="'$(TargetFramework)' != 'net472'" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net472" Version="1.0.3" Condition="'$(TargetFramework)' == 'net472'">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -35,8 +35,4 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<PackageReference Update="DotNet.ReproducibleBuilds" Version="1.1.1" />
</ItemGroup>
</Project>
7 changes: 3 additions & 4 deletions AltCover.Monitor.Tests/AltCover.Monitor.Tests.fsproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
Expand All @@ -19,13 +19,13 @@
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="Unquote" Version="6.1.0" Condition="'$(TargetFramework)' != 'net472'" />
<Reference Include="Unquote" Condition="'$(TargetFramework)' == 'net472'">
<HintPath>..\ThirdParty\Unquote.dll</HintPath>
</Reference>
<PackageReference Include="YoloDev.Expecto.TestSdk" Version="1.0.0" Condition="'$(TargetFramework)' != 'net472'" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net472" Version="1.0.2" Condition="'$(TargetFramework)' == 'net472'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net472" Version="1.0.3" Condition="'$(TargetFramework)' == 'net472'">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -49,7 +49,6 @@
</ItemGroup>

<ItemGroup>
<PackageReference Update="DotNet.ReproducibleBuilds" Version="1.1.1" />
<PackageReference Update="FSharp.Core" Version="6.0.5">
<ExcludeAssets>contentfiles</ExcludeAssets>
</PackageReference>
Expand Down
6 changes: 1 addition & 5 deletions AltCover.Monitor/AltCover.Monitor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,9 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net20" Version="1.0.2" Condition="'$(TargetFramework)' == 'net20'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net20" Version="1.0.3" Condition="'$(TargetFramework)' == 'net20'">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<PackageReference Update="DotNet.ReproducibleBuilds" Version="1.1.1" />
</ItemGroup>
</Project>
Loading

0 comments on commit 0518177

Please sign in to comment.