Skip to content

Commit

Permalink
SDK 7.0.306 and other tooling updates
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveGilham committed Jul 12, 2023
1 parent 2afb2c0 commit 60e7218
Show file tree
Hide file tree
Showing 14 changed files with 102 additions and 98 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-reportgenerator-globaltool": {
"version": "5.1.21",
"version": "5.1.23",
"commands": [
"reportgenerator"
]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.304'
dotnet-version: '7.0.306'
- name: Tools
run: dotnet tool restore
- name: Setup
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.304'
dotnet-version: '7.0.306'
- name: Tools
run: dotnet tool restore
- name: Setup
Expand Down
7 changes: 1 addition & 6 deletions AltCover.Api.Tests/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ module ExpectoMain =
module UnitTestStub =
[<EntryPoint; System.Runtime.CompilerServices.CompilerGenerated>]
let unitTestStub argv =
let writeResults =
TestResults.writeNUnitSummary ("AltCover.Api.TestResults.xml", "AltCover.Api.Tests")

let config =
defaultConfig.appendSummaryHandler writeResults

runTestsWithArgs config argv ExpectoMain.tests
runTestsWithCLIArgs Seq.empty<CLIArguments> argv ExpectoMain.tests
#endif
10 changes: 5 additions & 5 deletions AltCover.Avalonia/AltCover.Avalonia11.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" VersionOverride="11.0.0-preview4" />
<PackageReference Include="Avalonia.Desktop" VersionOverride="11.0.0-preview4" />
<PackageReference Include="Avalonia.Themes.Fluent" VersionOverride="11.0.0-preview4" />
<PackageReference Include="Avalonia.Themes.Simple" VersionOverride="11.0.0-preview4" />
<PackageReference Include="MessageBox.Avalonia" VersionOverride="2.3.1-prev2" />
<PackageReference Include="Avalonia" VersionOverride="11.0.0" />
<PackageReference Include="Avalonia.Desktop" VersionOverride="11.0.0" />
<PackageReference Include="Avalonia.Themes.Fluent" VersionOverride="11.0.0" />
<PackageReference Include="Avalonia.Themes.Simple" VersionOverride="11.0.0" />
<PackageReference Include="MessageBox.Avalonia" VersionOverride="3.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down
73 changes: 55 additions & 18 deletions AltCover.Avalonia/MainWindow.fs
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,32 @@ type AboutBox() as this =

vslink.Text <- Resource.GetResourceString "aboutVisualizer.Copyright"

#if AVALONIA11
#else
let vsLinkButton =
this.FindControl<Button>("VSLinkButton")

vsLinkButton.Click
|> Event.add (fun _ ->
Avalonia.Dialogs.AboutAvaloniaDialog.OpenBrowser
"https://learn.microsoft.com/en-us/visualstudio/designers/the-visual-studio-image-library?view=vs-2022")
#endif

let link =
this.FindControl<TextBlock>("Link")

link.Text <- Resource.GetResourceString "aboutVisualizer.WebsiteLabel"

#if AVALONIA11
#else
let linkButton =
this.FindControl<Button>("LinkButton")

linkButton.Click
|> Event.add (fun _ ->
Avalonia.Dialogs.AboutAvaloniaDialog.OpenBrowser
"http://www.github.com/SteveGilham/altcover")
#endif

this.FindControl<TabItem>("AboutDetails").Header <-
Resource.GetResourceString "AboutDialog.About"
Expand Down Expand Up @@ -286,6 +292,9 @@ type MainWindow() as this =
"AvoidSwitchStatementsRule",
Justification = "This is FP, not OO")>]
member private this.ShowMessageBox (status: MessageType) caption message =
#if AVALONIA11
()
#else
let dlg =
MessageBox.Avalonia.DTO.MessageBoxCustomParamsWithImage()

Expand Down Expand Up @@ -314,6 +323,7 @@ type MainWindow() as this =

// can we get this to tidy up after itself??
mbox.ShowDialog(this) |> ignore
#endif

// Fill in the menu from the memory cache
member private this.PopulateMenu() =
Expand Down Expand Up @@ -691,9 +701,9 @@ type MainWindow() as this =
#else
let where = Persistence.readFolder ()

if Directory.Exists where then
ofd.SuggestedStartLocation <-
new Avalonia.Platform.Storage.FileIO.BclStorageFolder(where)
//if Directory.Exists where then
// ofd.SuggestedStartLocation <-
// new Avalonia.Platform.Storage.FileIO.BclStorageFolder(where)
#endif

ofd.Title <- Resource.GetResourceString "Open Coverage File"
Expand Down Expand Up @@ -802,13 +812,17 @@ type MainWindow() as this =
if isWindows then
fontItem.IsVisible <- true

#if AVALONIA11
#else
fontItem.Click
|> Event.add (fun _ ->

let hwnd = this.PlatformImpl.Handle.Handle

Fonts.SelectWin32(Persistence.readFont (), hwnd)
|> Option.ofObj
|> Option.iter respondToFont)
#endif
else if Fonts.Wish().Any() then
fontItem.IsVisible <- true

Expand Down Expand Up @@ -890,32 +904,32 @@ type MainWindow() as this =
|> Event.choose id
|> Event.map (fun n ->
#if AVALONIA11
use temp = ofd.SuggestedStartLocation
let ok, where = n.TryGetUri()
let path = where.AbsolutePath

if ok then
ofd.SuggestedStartLocation <-
new Avalonia.Platform.Storage.FileIO.BclStorageFolder(
Path.GetDirectoryName path
)
//use temp = ofd.SuggestedStartLocation
//let ok, where = n.TryGetUri()
//let path = where.AbsolutePath

//if ok then
// ofd.SuggestedStartLocation <-
// new Avalonia.Platform.Storage.FileIO.BclStorageFolder(
// Path.GetDirectoryName path)
#else
ofd.Directory <- Path.GetDirectoryName n
#endif

if Persistence.save then
#if AVALONIA11
let ok, where =
ofd.SuggestedStartLocation.TryGetUri()
//let ok, where =
// ofd.SuggestedStartLocation.TryGetUri()

if ok then
Persistence.saveFolder where.AbsolutePath
//if ok then
// Persistence.saveFolder where.AbsolutePath
()
#else
Persistence.saveFolder ofd.Directory
#endif

#if AVALONIA11
justOpened <- path
//justOpened <- path
#else
justOpened <- n
#endif
Expand Down Expand Up @@ -955,7 +969,11 @@ type MainWindow() as this =
else
row.Tag <- Expanded

#if AVALONIA11
//"AvaloniaUI v11"
#else
row.Items <- l
#endif

row.Tapped
|> Event.add (fun x ->
Expand All @@ -976,7 +994,11 @@ type MainWindow() as this =
let remargin (t: TreeViewItem) =
if t.HeaderPresenter.IsNotNull then
let hp =
#if AVALONIA11
t.HeaderPresenter
#else
t.HeaderPresenter :?> Avalonia.Controls.Presenters.ContentPresenter
#endif

let grid = hp.Parent :?> Grid
grid.Margin <- Thickness(float t.Level * 4.0, 0.0, 0.0, 0.0)
Expand Down Expand Up @@ -1005,8 +1027,11 @@ type MainWindow() as this =
(tip: string option) ->
let newrow = makeNewRow pc leaf name icon

(context.Row.Items :?> List<TreeViewItem>).Add newrow
#if AVALONIA11

#else
(context.Row.Items :?> List<TreeViewItem>).Add newrow
#endif
tip
|> Option.iter (fun text -> ToolTip.SetTip(newrow, text))

Expand All @@ -1029,7 +1054,11 @@ type MainWindow() as this =
let tree =
this.FindControl<TreeView>("Tree")

#if AVALONIA11

#else
tree.Items <- Enumerable.Empty<TreeViewItem>()
#endif
tree.InvalidateVisual()
this.UpdateMRU info.FullName false)
UpdateUISuccess =
Expand Down Expand Up @@ -1070,7 +1099,11 @@ type MainWindow() as this =
.FindControl<StackPanel>("Branches")
.Children.Clear()

#if AVALONIA11

#else
tree.Items <- auxModel.Model
#endif
tree.InvalidateVisual()

if info.IsNotNull then
Expand All @@ -1080,7 +1113,11 @@ type MainWindow() as this =
let tree =
this.FindControl<TreeView>("Tree")

#if AVALONIA11

#else
tree.Items <- Enumerable.Empty<TreeViewItem>()
#endif
tree.InvalidateVisual()

let model = auxModel.Model
Expand Down
8 changes: 8 additions & 0 deletions AltCover.Avalonia/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ open Mono.Options

module VisualizerMain =
#if !NETSTANDARD2_0 // no AppBuilder here
#if AVALONIA11

#else
let BuildAvaloniaApp () =
AppBuilderBase<AppBuilder>
.Configure<App>()
.UsePlatformDetect()
.LogToTrace(LogEventLevel.Warning)
#endif
#endif

[<EntryPoint>]
Expand All @@ -33,8 +37,12 @@ module VisualizerMain =
options.Parse(arguments) |> ignore

#if !NETSTANDARD2_0
#if AVALONIA11
0
#else
BuildAvaloniaApp()
.StartWithClassicDesktopLifetime(arguments)
#endif
#else
0
#endif
Expand Down
10 changes: 1 addition & 9 deletions AltCover.Expecto.Tests/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,5 @@ module ExpectoMain =
module UnitTestStub =
[<EntryPoint; System.Runtime.CompilerServices.CompilerGenerated>]
let unitTestStub argv =
let writeResults =
TestResults.writeNUnitSummary (
"AltCover.Expecto.TestResults.xml",
"AltCover.Expecto.Tests"
)

let config =
defaultConfig.appendSummaryHandler writeResults

runTestsWithArgs config argv ExpectoMain.tests
runTestsWithCLIArgs Seq.empty<CLIArguments> argv ExpectoMain.tests
11 changes: 1 addition & 10 deletions AltCover.Monitor.Tests/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,5 @@ module ExpectoMain =
module UnitTestStub =
[<EntryPoint; System.Runtime.CompilerServices.CompilerGenerated>]
let unitTestStub argv =
let writeResults =
TestResults.writeNUnitSummary (
"AltCover.Monitor.TestResults.xml",
"AltCover.Monitor.Tests"
)

let config =
defaultConfig.appendSummaryHandler writeResults

runTestsWithArgs config argv ExpectoMain.tests
runTestsWithCLIArgs Seq.empty<CLIArguments> argv ExpectoMain.tests
#endif
9 changes: 4 additions & 5 deletions AltCover.Recorder/Tracer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ type internal Tracer =
Stream = null
Formatter = null }

member this.IsConnected
with internal get () =
match this.Stream with
| null -> false
| _ -> this.Runner
member internal this.IsConnected =
match this.Stream with
| null -> false
| _ -> this.Runner

[<SuppressMessage("Gendarme.Rules.Correctness",
"EnsureLocalDisposalRule",
Expand Down
10 changes: 1 addition & 9 deletions AltCover.ValidateGendarmeEmulation/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@ module ExpectoMain =
module UnitTestStub =
[<EntryPoint; System.Runtime.CompilerServices.CompilerGenerated>]
let unitTestStub argv =
let writeResults =
TestResults.writeNUnitSummary (
"AltCover.ValidateGendarmeEmulation.TestResults.xml",
"AltCover.ValidateGendarmeEmulation"
)

let config =
defaultConfig.appendSummaryHandler writeResults

runTestsWithArgs config argv ExpectoMain.tests
runTestsWithCLIArgs Seq.empty<CLIArguments> argv ExpectoMain.tests
#endif
10 changes: 1 addition & 9 deletions AltCover.Visualizer.Tests/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ module TestMain =
module UnitTestStub =
[<EntryPoint; System.Runtime.CompilerServices.CompilerGenerated>]
let unitTestStub argv =
let writeResults =
TestResults.writeNUnitSummary (
"AltCover.Visualizer.TestResults.xml",
"AltCover.Visualizer.Tests"
)

let config =
defaultConfig.appendSummaryHandler writeResults

runTestsWithArgs config argv TestMain.tests
runTestsWithCLIArgs Seq.empty<CLIArguments> argv TestMain.tests
#endif
6 changes: 2 additions & 4 deletions Build/targets.fs
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,6 @@ module Targets =
"-debug"
"-D:MONO"
"-out:./_Mono/Sample3/Sample3.dll"
"-lib:./packages/Mono.Cecil.0.11.4/lib/net40"
"-r:Mono.Cecil.dll"
"./Samples/Sample3/Class1.cs" ]) ]

Expand All @@ -972,7 +971,6 @@ module Targets =
"-debug"
"-D:MONO"
"-out:./_Mono/Sample31/Sample31.dll"
"-lib:./packages/Mono.Cecil.0.11.4/lib/net40"
"-r:Mono.Cecil.dll"
"./Samples/Sample31/Class1.cs" ]) ]
|> Seq.iter (fun (dir, cmd) ->
Expand Down Expand Up @@ -1097,8 +1095,8 @@ module Targets =
("./Build/common-rules.xml",
[ "_Binaries/AltCover/Debug+AnyCPU/netcoreapp2.1/AltCover.dll" // global tool builds
"_Binaries/AltCover.Avalonia/Debug+AnyCPU/net5.0/AltCover.Visualizer.dll" ])
("./Build/common-rules.xml",
[ "_Binaries/AltCover.Avalonia11/Debug+AnyCPU/net5.0/AltCover.Visualizer.dll" ])
//("./Build/common-rules.xml",
// [ "_Binaries/AltCover.Avalonia11/Debug+AnyCPU/net5.0/AltCover.Visualizer.dll" ])
("./Build/csharp-rules.xml",
[ "_Binaries/AltCover.DataCollector/Debug+AnyCPU/netstandard2.0/AltCover.DataCollector.dll"
"_Binaries/AltCover.Monitor/Debug+AnyCPU/netstandard2.0/AltCover.Local.Monitor.dll"
Expand Down
Loading

0 comments on commit 60e7218

Please sign in to comment.