Skip to content

Commit

Permalink
Merge pull request #4443 from MahApps/jk/Replacing-NET-versions
Browse files Browse the repository at this point in the history
Replacing .NET versions
  • Loading branch information
punker76 authored Dec 8, 2023
2 parents 4b5ad8f + 234788b commit 833cf44
Show file tree
Hide file tree
Showing 12 changed files with 128 additions and 132 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
5.x
6.x
8.x
- name: List dotnet sdks
run: dotnet --list-sdks
run: dotnet --info
- name: Run the Cake script
uses: cake-build/cake-action@v1
with:
Expand Down
15 changes: 4 additions & 11 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ environment:

skip_tags: true
image: Visual Studio 2022
test: off
test: false

install:
# Appveyor uses git checkout -qf FETCH_HEAD but all GitVersion versions above 5.6.3 doesn't support this detached header
Expand All @@ -29,14 +29,14 @@ install:
{
git checkout -qf $($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT)
}
# - 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: Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile 'dotnet-install.ps1'
- ps: ./dotnet-install.ps1 -Version 8.0.100 -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

Expand All @@ -52,10 +52,3 @@ nuget:
skip_commits:
files:
- '**/*.md'

# notifications:
# - provider: Webhook
# url: https://webhooks.gitter.im/e/3065442a8d5860a11008
# on_build_success: true
# on_build_failure: true
# on_build_status_changed: false
52 changes: 48 additions & 4 deletions src/Directory.Build.Props
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,60 @@

<!-- Project properties -->
<PropertyGroup>
<TargetFrameworks>net462;net47;net48;net5.0-windows;net6.0-windows</TargetFrameworks>
<TargetFrameworks>net8.0-windows;net6.0-windows;net462</TargetFrameworks>
<LangVersion>latestmajor</LangVersion>

<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
<AutoGenerateBindingRedirects Condition="$(DefineConstants.Contains(NETCOREAPP)) == false">true</AutoGenerateBindingRedirects>
<LangVersion>latestmajor</LangVersion>

<UseWPF>true</UseWPF>
<Nullable>enable</Nullable>

<NoWarn>$(NoWarn);CS1591</NoWarn>
<NoError>$(NoError);CS1591</NoError>
<UseWPF>true</UseWPF>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Nullable>enable</Nullable>
</PropertyGroup>

<!-- AssemblyInfo -->
<PropertyGroup>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>

<Company>MahApps</Company>
<Product>MahApps.Metro</Product>
<Copyright>Copyright © $([System.DateTime]::Today.ToString(yyyy)) .NET Foundation and Contributors. All rights reserved.</Copyright>
<Description>MahApps.Metro, a toolkit for creating Metro / Modern UI styled WPF applications.</Description>

<Version Condition="'$(Version)' == ''">3.0.0.0</Version>
<AssemblyVersion Condition="'$(AssemblyVersion)' == ''">3.0.0.0</AssemblyVersion>
<FileVersion Condition="'$(FileVersion)' == ''">3.0.0.0</FileVersion>
<InformationalVersion Condition="'$(InformationalVersion)' == ''">SRC</InformationalVersion>
</PropertyGroup>

<!-- Sign assembly -->
<PropertyGroup>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)/mahapps.public.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
</PropertyGroup>

<!-- SourceLink -->
<PropertyGroup>
<!-- Optional: Declare that the Repository URL can be published to NuSpec -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<!-- Optional: Embed source files that are not tracked by the source control manager to the PDB -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<!-- By using EmbedAllSources we don't need SourceLink itself -->
<!-- https://github.com/dotnet/sourcelink/blob/master/docs/README.md#embedallsources -->
<EmbedAllSources>true</EmbedAllSources>
</PropertyGroup>

<!-- PDB-Options -->
<PropertyGroup>
<DebugSymbols>true</DebugSymbols>
<DebugType>Embedded</DebugType>
</PropertyGroup>

<!-- Add the references for all projects and targets -->
Expand Down
14 changes: 0 additions & 14 deletions src/Directory.Build.Targets
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
<Project>

<!-- AssemblyInfo -->
<PropertyGroup>
<Company>MahApps</Company>
<Product>MahApps.Metro</Product>
<Copyright>Copyright © $([System.DateTime]::Today.ToString(yyyy)) .NET Foundation and Contributors. All rights reserved.</Copyright>
<Description>MahApps.Metro, a toolkit for creating Metro / Modern UI styled WPF applications.</Description>

<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<Version>3.0.0.0</Version>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<FileVersion>3.0.0.0</FileVersion>
<InformationalVersion>3.0.0.0</InformationalVersion>
</PropertyGroup>

<ItemGroup>
<Page Update="@(Page)" SubType="Designer" Generator="MSBuild:Compile" />
</ItemGroup>
Expand Down
27 changes: 13 additions & 14 deletions src/Directory.packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
</PropertyGroup>

<ItemGroup Label="Build">
<PackageVersion Include="ControlzEx" Version="6.0.0" />
<PackageVersion Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.39" />
<PackageVersion Include="ControlzEx" Version="7.0.0-alpha0018" />
<PackageVersion Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.77" />
<PackageVersion Include="XAMLTools.MSBuild" Version="1.0.0-alpha0143" />

<PackageVersion Include="JetBrains.Annotations" Version="2023.3.0" />

<PackageVersion Include="Caliburn.Micro" Version="4.0.212" />
<PackageVersion Include="JetBrains.Annotations" Version="2023.2.0" />
<PackageVersion Include="MahApps.Metro.IconPacks.Entypo" Version="4.11.0" />
<PackageVersion Include="MahApps.Metro.IconPacks.FontAwesome" Version="4.11.0" />
<PackageVersion Include="MahApps.Metro.IconPacks.Material" Version="4.11.0" />
Expand All @@ -23,22 +24,20 @@
<PackageVersion Include="MaterialDesignColors" Version="2.1.4" Condition=" $(DefineConstants.Contains(NETCOREAPP)) == true " />

<PackageVersion Include="NHotkey.Wpf" Version="2.1.1" />
<PackageVersion Include="Microsoft.Web.WebView2" Version="1.0.2045.28" />
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.2.252-beta" />
<PackageVersion Include="Microsoft.Web.WebView2" Version="1.0.2151.40" />
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.3.49-beta" />

<PackageVersion Include="System.ComponentModel.Composition" Version="6.0.0" Condition=" $(DefineConstants.Contains(NET6_0_OR_GREATER)) == false " />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="6.0.0" Condition=" $(DefineConstants.Contains(NET6_0_OR_GREATER)) == false " />
<PackageVersion Include="System.ComponentModel.Composition" Version="7.0.0" Condition=" $(DefineConstants.Contains(NET6_0_OR_GREATER)) == true " />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="7.0.0" Condition=" $(DefineConstants.Contains(NET6_0_OR_GREATER)) == true " />
<PackageVersion Include="System.ComponentModel.Composition" Version="8.0.0" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="8.0.0" />

<PackageVersion Include="WpfAnalyzers" Version="4.1.1" />
</ItemGroup>

<ItemGroup Label="Test">
<PackageVersion Include="xunit" Version="2.5.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageVersion Include="xunit.runner.console" Version="2.5.2" />
<PackageVersion Include="xunit.analyzers" Version="1.4.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageVersion Include="xunit" Version="2.6.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.4" />
<PackageVersion Include="xunit.runner.console" Version="2.6.2" />
<PackageVersion Include="xunit.analyzers" Version="1.6.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
</ItemGroup>
</Project>
39 changes: 0 additions & 39 deletions src/MahApps.Metro/Directory.Build.Targets

This file was deleted.

24 changes: 0 additions & 24 deletions src/MahApps.Metro/Directory.Build.props

This file was deleted.

26 changes: 25 additions & 1 deletion src/MahApps.Metro/MahApps.Metro.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@
<DefineConstants>$(DefineConstants);INTERNAL_NULLABLE_ATTRIBUTES</DefineConstants>
</PropertyGroup>

<!-- NuGet -->
<PropertyGroup>
<Authors>Jan Karger, Bastian Schmidt, Dennis Daume, Brendan Forster, Alex Mitchell, Paul Jenkins, Jake Ginnivan</Authors>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/MahApps/MahApps.Metro</PackageProjectUrl>
<PackageIcon>mahapps.metro.logo.png</PackageIcon>
<PackageTags>WPF;UI;Metro;Modern;Material;XAML;Toolkit;Library;.NET;OSS;OpenSource</PackageTags>
<PackageReleaseNotes>https://github.com/MahApps/MahApps.Metro/releases</PackageReleaseNotes>
<RepositoryUrl>https://github.com/MahApps/MahApps.Metro.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<GenerateLibraryLayout>true</GenerateLibraryLayout>
</PropertyGroup>

<ItemGroup>
<SourceRoot Include="$(NuGetPackageRoot)" Condition="'$(NuGetPackageRoot)' != ''" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="ControlzEx" />
<PackageReference Include="XAMLTools.MSBuild" PrivateAssets="all" IncludeAssets="build" />
Expand All @@ -24,6 +41,13 @@
</ItemGroup>

<!-- Items include -->
<ItemGroup>
<None Include="..\..\mahapps.metro.logo.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<None Include="VisualStudioToolsManifest.xml" Pack="true" PackagePath="tools" />
<UpToDateCheckInput Include="**/*.xaml" />
Expand Down Expand Up @@ -57,4 +81,4 @@
</XAMLColorSchemeGeneratorItems>
</ItemGroup>

</Project>
</Project>
18 changes: 16 additions & 2 deletions src/MahApps.Metro/MahAppsException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@
// See the LICENSE file in the project root for more information.

using System;
using System.Runtime.Serialization;
using System.Windows;

#if !NET8_0_OR_GREATER
using System.Runtime.Serialization;
using System.Security;
#endif

namespace MahApps.Metro
{
#if !NET8_0_OR_GREATER
[Serializable]
#endif
public class MahAppsException : Exception
{
public MahAppsException()
Expand All @@ -25,23 +31,31 @@ public MahAppsException(string message, Exception? innerException)
{
}

#if !NET8_0_OR_GREATER
[SecuritySafeCritical]
protected MahAppsException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
#endif
}

#if !NET8_0_OR_GREATER
[Serializable]
#endif
public class MissingRequiredTemplatePartException : MahAppsException
{
public MissingRequiredTemplatePartException(FrameworkElement target, string templatePart)
: base($"Template part \"{templatePart}\" in template for \"{target.GetType().FullName}\" is missing.")
{
}


#if !NET8_0_OR_GREATER
[SecuritySafeCritical]
protected MissingRequiredTemplatePartException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
#endif
}
}
Loading

0 comments on commit 833cf44

Please sign in to comment.