Skip to content

Commit 9241261

Browse files
authored
Merge pull request #275 from MahApps/feature/Net5
Add .Net 5 target
2 parents 82d0e8b + 636fe3b commit 9241261

File tree

9 files changed

+53
-82
lines changed

9 files changed

+53
-82
lines changed

GitVersion.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
assembly-versioning-scheme: Major
22
assembly-file-versioning-scheme: MajorMinorPatchTag
3+
next-version: 4.9.0
34
mode: ContinuousDeployment
4-
next-version: 4.8.0
55
branches:
66
master:
77
regex: ^main

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
Awesome icon packs for <code>WPF</code> and <code>UWP</code> in one library
99
</p>
1010
<p>
11-
Supporting .NET Framework (4.5+), .NET Core (3.0 and 3.1) and UWP
11+
Supporting .NET Framework 4.5+, .NET Core 3 (3.0 and 3.1), .NET 5 (on Windows) and UWP
1212
</p>
1313
<a href="https://gitter.im/MahApps/MahApps.Metro.IconPacks">
1414
<img src="https://img.shields.io/badge/Gitter-Join%20Chat-green.svg?style=flat-square">

build.cake

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#load sign.cake
66

7-
#tool dotnet:?package=GitReleaseManager.Tool&version=0.11.0
7+
#tool dotnet:?package=GitReleaseManager.Tool&version=0.12.0
88
#tool dotnet:?package=GitVersion.Tool&version=5.6.6
99

1010
#tool vswhere&version=2.8.4
@@ -155,19 +155,13 @@ Task("CreateRelease")
155155
.WithCriteria(() => !isPullRequest)
156156
.Does(() =>
157157
{
158-
var username = EnvironmentVariable("GITHUB_USERNAME");
159-
if (string.IsNullOrEmpty(username))
160-
{
161-
throw new Exception("The GITHUB_USERNAME environment variable is not defined.");
162-
}
163-
164158
var token = EnvironmentVariable("GITHUB_TOKEN");
165159
if (string.IsNullOrEmpty(token))
166160
{
167161
throw new Exception("The GITHUB_TOKEN environment variable is not defined.");
168162
}
169163

170-
GitReleaseManagerCreate(username, token, "MahApps", repoName, new GitReleaseManagerCreateSettings {
164+
GitReleaseManagerCreate(token, "MahApps", repoName, new GitReleaseManagerCreateSettings {
171165
Milestone = gitVersion.MajorMinorPatch,
172166
Name = gitVersion.AssemblySemFileVer,
173167
Prerelease = isDevelopBranch,

src/Directory.build.props

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<PropertyGroup>
3+
<IsBuildingWpfTempProj Condition="$(MSBuildProjectName.Contains('_wpftmp')) != 'true'">false</IsBuildingWpfTempProj>
4+
<IsBuildingWpfTempProj Condition="$(MSBuildProjectName.Contains('_wpftmp')) == 'true'">true</IsBuildingWpfTempProj>
5+
</PropertyGroup>
26

37
<!-- Project properties -->
48
<PropertyGroup>
5-
<TargetFrameworks>net45;net46;net47;netcoreapp3.0;netcoreapp3.1;uap10.0.16299</TargetFrameworks>
9+
<TargetFrameworks>net45;net46;net47;netcoreapp3.0;netcoreapp3.1;net5-windows;uap10.0.16299</TargetFrameworks>
610
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
711
<GenerateDocumentationFile>true</GenerateDocumentationFile>
812
<AutoGenerateBindingRedirects Condition=" $(TargetFramework.StartsWith('net4')) or $(TargetFramework.StartsWith('uap')) ">true</AutoGenerateBindingRedirects>
@@ -15,13 +19,8 @@
1519
<IsSampleProject>$(MSBuildProjectName.Contains('Browser'))</IsSampleProject>
1620
</PropertyGroup>
1721

18-
<ItemGroup>
19-
<SourceRoot Include="$(MSBuildThisFileDirectory)/" />
20-
</ItemGroup>
21-
2222
<PropertyGroup>
23-
<IsBuildingWpfTempProj Condition="$(MSBuildProjectName.Contains('_wpftmp')) != 'true'">false</IsBuildingWpfTempProj>
24-
<IsBuildingWpfTempProj Condition="$(MSBuildProjectName.Contains('_wpftmp')) == 'true'">true</IsBuildingWpfTempProj>
23+
<DefineConstants Condition="'$(TargetFramework)' == 'net5.0-windows'">$(DefineConstants);NET5_0_OR_GREATER</DefineConstants>
2524
</PropertyGroup>
2625

2726
<!-- .NET Framework and Core -->
@@ -44,30 +43,37 @@
4443
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
4544
</PropertyGroup>
4645

47-
<!-- Add the references for all projects and targets -->
48-
<ItemGroup>
49-
<PackageReference Include="JetBrains.Annotations" Version="2020.*" PrivateAssets="All" />
50-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.*" PrivateAssets="All"/>
51-
<!-- <PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.18362.2002-preview" PrivateAssets="All" Condition=" $(TargetFramework.StartsWith('uap')) " /> -->
52-
</ItemGroup>
53-
54-
<ItemGroup>
55-
<None Remove="**\*.png;**\*.jpg;**\*.ico;**\*.cur" />
56-
<Resource Include="**\*.png;**\*.jpg;**\*.ico;**\*.cur" />
57-
</ItemGroup>
58-
5946
<!-- SourceLink -->
6047
<PropertyGroup>
6148
<!-- Optional: Declare that the Repository URL can be published to NuSpec -->
6249
<PublishRepositoryUrl>true</PublishRepositoryUrl>
50+
<!-- <IncludeSymbols>true</IncludeSymbols> -->
6351
<!-- Optional: Embed source files that are not tracked by the source control manager to the PDB -->
6452
<EmbedUntrackedSources>true</EmbedUntrackedSources>
6553
<!-- Optional: Include PDB in the built .nupkg -->
6654
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb;.xaml;.xml</AllowedOutputExtensionsInPackageBuildOutputFolder>
6755
<!-- https://github.com/dotnet/sourcelink/blob/master/docs/README.md#embedallsources -->
68-
<!-- <EmbedAllSources>true</EmbedAllSources>-->
56+
<!-- <EmbedAllSources>true</EmbedAllSources> -->
6957
</PropertyGroup>
7058

59+
<!-- Add the references for all projects and targets -->
60+
<ItemGroup>
61+
<PackageReference Include="JetBrains.Annotations" Version="2021.*" PrivateAssets="All" IncludeAssets="build;compile" />
62+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.*">
63+
<PrivateAssets>all</PrivateAssets>
64+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
65+
</PackageReference>
66+
</ItemGroup>
67+
68+
<ItemGroup>
69+
<None Remove="**\*.png;**\*.jpg;**\*.ico;**\*.cur" />
70+
<Resource Include="**\*.png;**\*.jpg;**\*.ico;**\*.cur" />
71+
</ItemGroup>
72+
73+
<ItemGroup>
74+
<SourceRoot Include="$(MSBuildThisFileDirectory)/" />
75+
</ItemGroup>
76+
7177
<!--
7278
Fix for .NET Core 3.0, see https://github.com/dotnet/core-sdk/issues/192, it
7379
uses obj/release instead of [outputdirectory]

src/Directory.build.targets

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
<Copyright>Copyright © 2016 - $([System.DateTime]::Today.ToString(yyyy)) MahApps.Metro</Copyright>
88
<Description>IconPacks for stylish awesome WPF and UWP applications.</Description>
99
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
10-
<Version>3.0.0.0</Version>
11-
<AssemblyVersion>3.0.0.0</AssemblyVersion>
12-
<FileVersion>3.0.0.0</FileVersion>
13-
<InformationalVersion>3.0.0.0</InformationalVersion>
10+
<Version>4.0.0.0</Version>
11+
<AssemblyVersion>4.0.0.0</AssemblyVersion>
12+
<FileVersion>4.0.0.0</FileVersion>
13+
<InformationalVersion>4.0.0.0</InformationalVersion>
1414
</PropertyGroup>
1515

1616
<!-- Sign assembly -->
@@ -46,27 +46,7 @@
4646
<TargetPlatformMinVersion>10.0.$(DefaultTargetPlatformMinVersion).0</TargetPlatformMinVersion>
4747
<DebugType>Full</DebugType>
4848
</PropertyGroup>
49-
<!-- <ItemGroup>
50-
<SDKReference Condition=" '$(UseWindowsDesktopSdk)' == 'true' and '$(TargetFramework)' == 'uap10.0.15063' " Include="WindowsDesktop, Version=10.0.15063.0">
51-
<Name>Windows Desktop Extensions for the UWP</Name>
52-
</SDKReference>
53-
<SDKReference Condition=" '$(UseWindowsDesktopSdk)' == 'true' and '$(TargetFramework)' == 'uap10.0.16299' " Include="WindowsDesktop, Version=10.0.16299.0">
54-
<Name>Windows Desktop Extensions for the UWP</Name>
55-
</SDKReference>
56-
</ItemGroup> -->
5749
</When>
5850
</Choose>
5951

60-
<!-- <Target Name="GetUWPContracts" BeforeTargets="ResolveFrameworkReferences" Condition=" $(TargetFramework.StartsWith('uap')) ">
61-
<CreateProperty Value="true">
62-
<Output PropertyName="ImplicitlyExpandTargetPlatform" TaskParameter="Value"/>
63-
</CreateProperty>
64-
<CreateProperty Value="">
65-
<Output PropertyName="WindowsWinmdFile" TaskParameter="Value"/>
66-
</CreateProperty>
67-
<ItemGroup>
68-
<Reference Remove="@(_SdkWindowsImplicitReference)"/>
69-
</ItemGroup>
70-
</Target>
71-
-->
7252
</Project>

src/MahApps.Metro.IconPacks.Browser/MahApps.Metro.IconPacks.Browser.csproj

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
44
<!-- Project properties -->
55
<PropertyGroup>
6-
<TargetFrameworks>net47;netcoreapp3.1</TargetFrameworks>
6+
<TargetFrameworks>net47;netcoreapp3.1;net5-windows</TargetFrameworks>
77
<AssemblyName>MahApps.Metro.IconPacks.Browser</AssemblyName>
88
<RootNamespace>MahApps.Metro.IconPacks.Browser</RootNamespace>
9-
<!-- <DisableFody Condition=" '$(Configuration)' == 'Debug' or $(TargetFramework.StartsWith('netcoreapp')) ">true</DisableFody> -->
10-
<!-- <DisableFody>true</DisableFody> -->
119
<GenerateDocumentationFile>false</GenerateDocumentationFile>
1210
<IsPackable>false</IsPackable>
1311
<!-- Workaround for https://github.com/dotnet/sourcelink/issues/91 -->
@@ -18,46 +16,35 @@
1816
<NoWarn>SA1652</NoWarn>
1917
<ApplicationManifest>app.manifest</ApplicationManifest>
2018
<ApplicationIcon>Icon\Icon.ico</ApplicationIcon>
21-
<LangVersion>8.0</LangVersion>
2219
</PropertyGroup>
2320
<ItemGroup>
2421
<ProjectReference Include="..\MahApps.Metro.IconPacks.Core\MahApps.Metro.IconPacks.Core.csproj" />
2522
<ProjectReference Include="..\MahApps.Metro.IconPacks\MahApps.Metro.IconPacks.csproj" />
2623
</ItemGroup>
2724
<ItemGroup>
28-
<PackageReference Include="MahApps.Metro" Version="2.4.3" />
25+
<PackageReference Include="MahApps.Metro" Version="2.*" />
2926
<PackageReference Include="ControlzEx" Version="4.*" />
3027
<PackageReference Include="AsyncAwaitBestPractices" Version="4.*" />
31-
<PackageReference Include="MaterialDesignThemes" Version="3.2.0" />
3228
<PackageReference Include="Microsoft-WindowsAPICodePack-Shell" Version="1.1.4" />
3329
</ItemGroup>
34-
<!-- <ItemGroup Condition=" '$(Configuration)' != 'Debug' and !$(TargetFramework.StartsWith('netcoreapp')) ">
35-
<PackageReference Include="Fody" Version="6.*">
36-
<PrivateAssets>all</PrivateAssets>
37-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
38-
</PackageReference>
39-
<PackageReference Include="Costura.Fody" Version="4.*" />
40-
</ItemGroup> -->
30+
<ItemGroup Condition="$(DefineConstants.Contains(NETCOREAPP)) == true">
31+
<PackageReference Include="MaterialDesignThemes" Version="4.1.0" />
32+
<PackageReference Include="MaterialDesignColors" Version="2.0.1" />
33+
</ItemGroup>
34+
<ItemGroup Condition="$(DefineConstants.Contains(NETCOREAPP)) == false">
35+
<PackageReference Include="MaterialDesignThemes" Version="3.0.1" />
36+
<PackageReference Include="MaterialDesignColors" Version="1.2.7" />
37+
</ItemGroup>
4138
<ItemGroup>
4239
<None Include="app.manifest" />
4340
<None Remove="App.config" />
44-
</ItemGroup>
45-
<ItemGroup Condition=" !$(TargetFramework.StartsWith('netcoreapp')) ">
46-
<AppConfigWithTargetPath Include="App.$(TargetFramework).config">
47-
<TargetPath>$(AssemblyName).config</TargetPath>
41+
<AppConfigWithTargetPath Include="App.$(TargetFramework).config" Condition="$(DefineConstants.Contains(NETCOREAPP)) == false">
42+
<TargetPath>$(AssemblyName).exe.config</TargetPath>
4843
</AppConfigWithTargetPath>
4944
</ItemGroup>
50-
<ItemGroup>
51-
<Resource Remove="Icon.ico" />
52-
<Resource Remove="Icon\Icon.ico" />
53-
</ItemGroup>
5445
<ItemGroup>
5546
<_SettingsFiles Remove="Properties\Settings.settings" />
5647
</ItemGroup>
57-
<ItemGroup>
58-
<Compile DependentUpon="%(Filename)" SubType="Code" Update="**\obj\**\*.g$(DefaultLanguageSourceExtension)" />
59-
<Compile DependentUpon="%(Filename)" SubType="Designer" Update="**\*.xaml$(DefaultLanguageSourceExtension)" />
60-
</ItemGroup>
6148
<ItemGroup>
6249
<None Update="ExportTemplates\Bitmap.xml">
6350
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -90,4 +77,8 @@
9077
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
9178
</None>
9279
</ItemGroup>
80+
<ItemGroup>
81+
<Compile DependentUpon="%(Filename)" SubType="Code" Update="**\obj\**\*.g$(DefaultLanguageSourceExtension)" />
82+
<Compile DependentUpon="%(Filename)" SubType="Designer" Update="**\*.xaml$(DefaultLanguageSourceExtension)" />
83+
</ItemGroup>
9384
</Project>

src/MahApps.Metro.IconPacks/Directory.build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))" />
3030
</ItemGroup>
3131
</Target>
32-
<Target Name="GetMyPackageFiles" Condition=" '$(_SdkShortFrameworkIdentifier)' == 'uap' ">
32+
<Target Name="GetMyPackageFiles" Condition=" $(TargetFramework.StartsWith('uap')) ">
3333
<ItemGroup>
3434
<BuildOutputInPackage Include="$(OutDir)MahApps.Metro.IconPacks.Core\*.*">
3535
<TargetPath>MahApps.Metro.IconPacks.Core</TargetPath>

src/MahApps.Metro.IconPacks/MahApps.Metro.IconPacks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths-&gt;WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))" />
8282
</ItemGroup>
8383
</Target>
84-
<Target Name="GetMyPackageFiles" Condition=" '$(_SdkShortFrameworkIdentifier)' == 'uap' ">
84+
<Target Name="GetMyPackageFiles" Condition=" $(TargetFramework.StartsWith('uap')) ">
8585
<ItemGroup>
8686
<BuildOutputInPackage Include="$(OutDir)MahApps.Metro.IconPacks.Core\*.*">
8787
<TargetPath>MahApps.Metro.IconPacks.Core</TargetPath>

src/global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "3.1.301",
3+
"version": "5.0.301",
44
"rollForward": "latestFeature"
55
},
66
"msbuild-sdks": {

0 commit comments

Comments
 (0)