diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 8f3a4382..da200cda 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "cake.tool": { - "version": "3.1.0", + "version": "4.0.0", "commands": [ "dotnet-cake" ] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 987679c6..bfafdfcd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,10 +20,11 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: | - 5.x 6.x + 8.x + 9.x - name: List dotnet sdks - run: dotnet --list-sdks + run: dotnet --info - name: Run the Cake script uses: cake-build/cake-action@v1 with: diff --git a/GitVersion.yml b/GitVersion.yml index a6ad889b..cc400f22 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -1,6 +1,6 @@ assembly-versioning-scheme: Major assembly-file-versioning-scheme: MajorMinorPatchTag -next-version: 3.2.0 +next-version: 4.0.0 mode: ContinuousDeployment branches: master: diff --git a/NuGet.Config b/NuGet.Config index b6b26c57..c99ebb09 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -15,4 +15,9 @@ + + + + + \ No newline at end of file diff --git a/README.md b/README.md index d6304c92..effb949a 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ An easy to use drag'n'drop framework for WPF.

- Supporting .NET Framework 4.6.2+, .NET Core 3.1, .NET 5 and .NET 6 (on Windows) + Supporting .NET Framework 4.6.2 and later, .NET 6 and later (on Windows)

diff --git a/appveyor.yml b/appveyor.yml index 2bd7338a..af0a190b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,6 +6,8 @@ branches: - main environment: + # bad, but without this, gitversion doesn't work anymore + IGNORE_NORMALISATION_GIT_HEAD_MOVE: 1 azure-key-vault-url: secure: 1mKS/HfCVq+iYNRVSrrN8NEowOkKt3knrpMzw+SOy3g= azure-key-vault-client-id: @@ -17,28 +19,20 @@ environment: azure-key-vault-certificate: secure: BSPdW2TgnQtoQXXbeDECug== -skip_tags: true image: Visual Studio 2022 -test: off - -install: - # Appveyor uses git checkout -qf FETCH_HEAD but all GitVersion versions above 5.6.3 doesn't support this detached header - # This is a workaround for this issue - - ps: | - if ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -ne "") - { - git checkout -qf $($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT) - } +test: false + +# install: # - ps: Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile 'dotnet-install.ps1' - # - ps: ./dotnet-install.ps1 -Version 6.0.100 -InstallDir "C:\Program Files\dotnet" + # - ps: ./dotnet-install.ps1 -Version 8.0.403 -InstallDir "C:\Program Files\dotnet" pull_requests: do_not_increment_build_number: false build_script: - - ps: dotnet --list-sdks + - ps: dotnet --info - ps: gitversion /version - - ps: .\build.ps1 --target=ci #--verbosity=diagnostic + - ps: .\build.ps1 --target=ci --verbosity=diagnostic artifacts: - path: \Publish\*.* diff --git a/build.cake b/build.cake index 5051a26d..ec5a46d0 100644 --- a/build.cake +++ b/build.cake @@ -3,14 +3,12 @@ /////////////////////////////////////////////////////////////////////////////// #tool dotnet:?package=NuGetKeyVaultSignTool&version=3.2.3 -#tool dotnet:?package=AzureSignTool&version=4.0.1 -#tool dotnet:?package=GitReleaseManager.Tool&version=0.15.0 +#tool dotnet:?package=AzureSignTool&version=6.0.0 +#tool dotnet:?package=GitReleaseManager.Tool&version=0.17.0 #tool dotnet:?package=XamlStyler.Console&version=3.2206.4 #tool nuget:?package=GitVersion.CommandLine&version=5.12.0 -#addin nuget:?package=Cake.Figlet&version=2.0.1 - /////////////////////////////////////////////////////////////////////////////// // ARGUMENTS /////////////////////////////////////////////////////////////////////////////// @@ -37,8 +35,8 @@ public class BuildData public DotNetVerbosity DotNetVerbosity { get; } public bool IsLocalBuild { get; set; } public bool IsPullRequest { get; set; } - public bool IsDevelopBranch { get; set; } - public bool IsReleaseBranch { get; set; } + public bool IsPrerelease { get; set; } + public bool IsRunningOnCI { get; set; } public GitVersion GitVersion { get; set; } public BuildData( @@ -55,9 +53,7 @@ public class BuildData public void SetGitVersion(GitVersion gitVersion) { GitVersion = gitVersion; - - IsDevelopBranch = StringComparer.OrdinalIgnoreCase.Equals("develop", GitVersion.BranchName); - IsReleaseBranch = StringComparer.OrdinalIgnoreCase.Equals("main", GitVersion.BranchName); + IsPrerelease = GitVersion.NuGetVersion.Contains("-"); } } @@ -72,10 +68,9 @@ Setup(ctx => throw new NotImplementedException($"{repoName} will only build on Windows because it's not possible to target WPF and Windows Forms from UNIX."); } - Information(Figlet(repoName)); + Spectre.Console.AnsiConsole.Write(new Spectre.Console.FigletText(repoName)); var gitVersionPath = Context.Tools.Resolve("gitversion.exe"); - Information("GitVersion : {0}", gitVersionPath); var buildData = new BuildData( @@ -85,6 +80,7 @@ Setup(ctx => ) { IsLocalBuild = BuildSystem.IsLocalBuild, + IsRunningOnCI = BuildSystem.GitHubActions.IsRunningOnGitHubActions || BuildSystem.AppVeyor.IsRunningOnAppVeyor, IsPullRequest = (BuildSystem.GitHubActions.IsRunningOnGitHubActions && BuildSystem.GitHubActions.Environment.PullRequest.IsPullRequest) || (BuildSystem.AppVeyor.IsRunningOnAppVeyor && BuildSystem.AppVeyor.Environment.PullRequest.IsPullRequest) @@ -97,15 +93,19 @@ Setup(ctx => } buildData.SetGitVersion(GitVersion(new GitVersionSettings { ToolPath = gitVersionPath, OutputType = GitVersionOutput.Json })); + Information("GitVersion : {0}", gitVersionPath); Information("Branch : {0}", buildData.GitVersion.BranchName); Information("Configuration : {0}", buildData.Configuration); - Information("IsLocalBuild : {0}", buildData.IsLocalBuild); + Information("IsRunningOnCI : {0}", buildData.IsRunningOnCI); + Information("IsPrerelease : {0}", buildData.IsPrerelease); + Information("IsPrerelease : {0}", buildData.IsPrerelease); Information("Informational Version: {0}", buildData.GitVersion.InformationalVersion); Information("SemVer Version: {0}", buildData.GitVersion.SemVer); Information("AssemblySemVer Version: {0}", buildData.GitVersion.AssemblySemVer); Information("MajorMinorPatch Version: {0}", buildData.GitVersion.MajorMinorPatch); Information("NuGet Version: {0}", buildData.GitVersion.NuGetVersion); Information("Verbosity : {0}", buildData.Verbosity); + Information("Publish folder : {0}", publishDir); return buildData; }); @@ -141,11 +141,11 @@ Task("Build") var msbuildSettings = new DotNetMSBuildSettings { MaxCpuCount = 0, - Version = data.IsReleaseBranch ? data.GitVersion.MajorMinorPatch : data.GitVersion.NuGetVersion, + Version = data.GitVersion.NuGetVersion, AssemblyVersion = data.GitVersion.AssemblySemVer, FileVersion = data.GitVersion.AssemblySemFileVer, InformationalVersion = data.GitVersion.InformationalVersion, - ContinuousIntegrationBuild = data.IsReleaseBranch, + ContinuousIntegrationBuild = data.IsRunningOnCI, ArgumentCustomization = args => args.Append("/m").Append("/nr:false") // The /nr switch tells msbuild to quite once it's done }; // msbuildSettings.FileLoggers.Add( @@ -177,10 +177,11 @@ Task("Pack") var msbuildSettings = new DotNetMSBuildSettings { MaxCpuCount = 0, - Version = data.IsReleaseBranch ? data.GitVersion.MajorMinorPatch : data.GitVersion.NuGetVersion, + Version = data.GitVersion.NuGetVersion, AssemblyVersion = data.GitVersion.AssemblySemVer, FileVersion = data.GitVersion.AssemblySemFileVer, - InformationalVersion = data.GitVersion.InformationalVersion + InformationalVersion = data.GitVersion.InformationalVersion, + ContinuousIntegrationBuild = data.IsRunningOnCI } .WithProperty("IncludeBuildOutput", "true") .WithProperty("RepositoryBranch", data.GitVersion.BranchName) @@ -211,7 +212,7 @@ Task("Pack") Task("Sign") .WithCriteria((context, data) => !data.IsPullRequest) .ContinueOnError() - .Does(() => + .Does(data => { var files = GetFiles("./src/GongSolutions.WPF.DragDrop/bin/**/*/GongSolutions.WPF.DragDrop.dll"); SignFiles(files, "GongSolutions.WPF.DragDrop, an easy to use drag'n'drop framework for WPF applications."); @@ -312,7 +313,7 @@ Task("CreateRelease") GitReleaseManagerCreate(token, "punker76", repoName, new GitReleaseManagerCreateSettings { Milestone = data.GitVersion.MajorMinorPatch, Name = data.GitVersion.AssemblySemFileVer, - Prerelease = data.IsDevelopBranch, + Prerelease = data.IsPrerelease, TargetCommitish = data.GitVersion.BranchName, WorkingDirectory = "." }); diff --git a/cake.config b/cake.config index 3260017d..841666e6 100644 --- a/cake.config +++ b/cake.config @@ -14,3 +14,4 @@ Modules=./tools/Modules [Settings] SkipVerification=false SkipPackageVersionCheck=true +ShowProcessCommandLine=true diff --git a/global.json b/global.json new file mode 100644 index 00000000..b0617650 --- /dev/null +++ b/global.json @@ -0,0 +1,7 @@ +{ + "sdk": { + "version": "9.0.100", + "rollForward": "latestFeature", + "allowPrerelease": false + } +} \ No newline at end of file diff --git a/src/Directory.build.props b/src/Directory.build.props index e00e1fb8..68f240b6 100644 --- a/src/Directory.build.props +++ b/src/Directory.build.props @@ -7,7 +7,7 @@ - net462;net47;net48;net5.0-windows;net6.0-windows + net8.0-windows;net6.0-windows;net462 true false true diff --git a/src/Directory.build.targets b/src/Directory.build.targets index 1c58d300..612e13d9 100644 --- a/src/Directory.build.targets +++ b/src/Directory.build.targets @@ -8,19 +8,16 @@ An easy to use drag'n'drop framework for WPF applications. true - 3.0.0.0 - 3.0.0.0 - 3.0.0.0 - 3.0.0.0 + 4.0.0.0 + 4.0.0.0 + 4.0.0.0 + 4.0.0.0 - - - - $([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)')) + diff --git a/src/Directory.packages.props b/src/Directory.packages.props index cee1093e..b9105c0e 100644 --- a/src/Directory.packages.props +++ b/src/Directory.packages.props @@ -1,17 +1,25 @@ + + + true + true - + - - - - - + + + + + diff --git a/src/GongSolutions.WPF.DragDrop.sln b/src/GongSolutions.WPF.DragDrop.sln index ecab7ae2..bf0fe8bc 100644 --- a/src/GongSolutions.WPF.DragDrop.sln +++ b/src/GongSolutions.WPF.DragDrop.sln @@ -1,12 +1,20 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.28729.10 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35514.174 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GongSolutions.WPF.DragDrop", "GongSolutions.WPF.DragDrop\GongSolutions.WPF.DragDrop.csproj", "{CB5BFDCE-284B-4B1E-A99A-ED4764D26E74}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Showcase.WPF.DragDrop", "Showcase\Showcase.WPF.DragDrop.csproj", "{4E15F482-1FE9-4614-98F7-31256B643462}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{DBB1D473-7CDE-4C02-9081-7EBC3C6C429A}" + ProjectSection(SolutionItems) = preProject + ..\build.cake = ..\build.cake + Directory.build.props = Directory.build.props + Directory.build.targets = Directory.build.targets + Directory.packages.props = Directory.packages.props + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/src/Showcase/FodyWeavers.xsd b/src/Showcase/FodyWeavers.xsd index 05e92c11..f2dbece7 100644 --- a/src/Showcase/FodyWeavers.xsd +++ b/src/Showcase/FodyWeavers.xsd @@ -29,12 +29,27 @@ - A list of unmanaged 32 bit assembly names to include, delimited with line breaks. + Obsolete, use UnmanagedWinX86Assemblies instead + + + + + A list of unmanaged X86 (32 bit) assembly names to include, delimited with line breaks. - A list of unmanaged 64 bit assembly names to include, delimited with line breaks. + Obsolete, use UnmanagedWinX64Assemblies instead. + + + + + A list of unmanaged X64 (64 bit) assembly names to include, delimited with line breaks. + + + + + A list of unmanaged Arm64 (64 bit) assembly names to include, delimited with line breaks. @@ -73,6 +88,11 @@ As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off. + + + The attach method no longer subscribes to the `AppDomain.AssemblyResolve` (.NET 4.x) and `AssemblyLoadContext.Resolving` (.NET 6.0+) events. + + Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code. @@ -105,12 +125,27 @@ - A list of unmanaged 32 bit assembly names to include, delimited with |. + Obsolete, use UnmanagedWinX86Assemblies instead + + + + + A list of unmanaged X86 (32 bit) assembly names to include, delimited with |. - A list of unmanaged 64 bit assembly names to include, delimited with |. + Obsolete, use UnmanagedWinX64Assemblies instead + + + + + A list of unmanaged X64 (64 bit) assembly names to include, delimited with |. + + + + + A list of unmanaged Arm64 (64 bit) assembly names to include, delimited with |. diff --git a/src/Showcase/Showcase.WPF.DragDrop.csproj b/src/Showcase/Showcase.WPF.DragDrop.csproj index 8d02800a..b09c79c7 100644 --- a/src/Showcase/Showcase.WPF.DragDrop.csproj +++ b/src/Showcase/Showcase.WPF.DragDrop.csproj @@ -2,6 +2,7 @@ + net9.0-windows;net8.0-windows;net6.0-windows;net462 Showcase.WPF.DragDrop Showcase.WPF.DragDrop true @@ -33,13 +34,8 @@ compile; runtime; build; native; contentfiles; analyzers - - - - - - + \ No newline at end of file diff --git a/src/Showcase/Views/TreeViewSamples.xaml b/src/Showcase/Views/TreeViewSamples.xaml index ead25b22..f632805a 100644 --- a/src/Showcase/Views/TreeViewSamples.xaml +++ b/src/Showcase/Views/TreeViewSamples.xaml @@ -3,10 +3,10 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:dd="urn:gong-wpf-dragdrop" + xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:viewModels="clr-namespace:Showcase.WPF.DragDrop.ViewModels" xmlns:views="clr-namespace:Showcase.WPF.DragDrop.Views" - xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks" d:DataContext="{d:DesignInstance viewModels:MainViewModel}" d:DesignHeight="400" d:DesignWidth="600" @@ -48,12 +48,12 @@ @@ -66,10 +66,10 @@ @@ -167,13 +167,13 @@ - @@ -182,8 +182,7 @@ - + diff --git a/src/global.json b/src/global.json deleted file mode 100644 index 28288bd5..00000000 --- a/src/global.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "sdk": { - "version": "6.0.400", - "rollForward": "latestFeature", - "allowPrerelease": false - } -} \ No newline at end of file