Skip to content

Commit

Permalink
Merge pull request #134 from punker76/jk/CentralPackageManagement
Browse files Browse the repository at this point in the history
Use Central Package Management and update packages
  • Loading branch information
punker76 authored Oct 29, 2023
2 parents 2884489 + 448211f commit 01b7fb5
Show file tree
Hide file tree
Showing 11 changed files with 140 additions and 58 deletions.
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# PLEASE READ BEFORE POSTING AN ISSUE

This is a place for issues for MahApps.Metro.SimpleChildWindow itself. Questions are better asked at [discussions](https://github.com/punker76/MahApps.Metro.SimpleChildWindow/discussions).

### Seriously consider creating and linking to a test repo which takes absolutely minimal setup to illustrate how reproduce the problem.

My time is limited and .Zip files, code snippets and partial examples are often a time sink. GitHub also provides great communication and code review tools which can be utilised.

## HOW TO POST A GOOD SAMPLE.

Follow these guidelines and I will most likely look at the issue sooner:

* Post a full GitHub repository. Not a zip file, half baked snippet etc. If GitHub is new to you consider it a great learning opportunity and chance to get involved.
* The repository should have just ONE step max for me to get running, and that is "Restore NuGet Packages". If there are any other missing dependencies, or uncompiling features I will most likely move on to another issue.
* I'm not trying to be awkward. I'm just busy and I'm helping a lot of people, not just you, so help me out and I will help you out.

## What steps will reproduce this issue?

_Write problem description here_

### Expected outcome

_Write expected outcome here_

### Repo

_Link to the Repo_

### Environment

- MahApps.Metro.SimpleChildWindow __v?.?.?__
- MahApps.Metro __v?.?.?__
- Windows OS __??__
- Visual Studio __20xx__
- .NET Framework __?.?__
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## What changed?

_Describe the changes you have made to improve this project._

_Closed issues._
32 changes: 20 additions & 12 deletions src/Directory.build.props
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@
<Project>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<IsBuildingWpfTempProj Condition="$(MSBuildProjectName.Contains('_wpftmp')) != 'true'">false</IsBuildingWpfTempProj>
<IsBuildingWpfTempProj Condition="$(MSBuildProjectName.Contains('_wpftmp')) == 'true'">true</IsBuildingWpfTempProj>
</PropertyGroup>

<!-- Project properties -->
<PropertyGroup>
<TargetFrameworks>net462;net47;net48;net5.0-windows;net6.0-windows</TargetFrameworks>
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<AutoGenerateBindingRedirects Condition=" $(TargetFramework.StartsWith('net4')) ">true</AutoGenerateBindingRedirects>
<LangVersion>9</LangVersion>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<AutoGenerateBindingRedirects Condition="$(DefineConstants.Contains(NETCOREAPP)) == false">true</AutoGenerateBindingRedirects>
<LangVersion>latestmajor</LangVersion>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<NoError>$(NoError);CS1591</NoError>
<UseWPF>true</UseWPF>
<!-- <TreatWarningsAsErrors>true</TreatWarningsAsErrors> -->
<!-- <Nullable>enable</Nullable> -->
</PropertyGroup>

<!-- Add the references for all projects and targets -->
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" PrivateAssets="All" IncludeAssets="build;compile" />
<PackageReference Include="WpfAnalyzers" PrivateAssets="all" IncludeAssets="build;analyzers" />
</ItemGroup>

<ItemGroup>
<None Remove="**\*.png;**\*.jpg;**\*.ico;**\*.ttf" />
<Resource Include="**\*.png;**\*.jpg;**\*.ico;**\*.ttf" />
<None Remove="**\*.png;**\*.jpg;**\*.ico;**\*.ttf;**\*.cur" />
<Resource Include="**\*.png;**\*.jpg;**\*.ico;**\*.ttf;**\*.cur" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" PrivateAssets="All" IncludeAssets="build;compile" />
<PackageReference Include="WpfAnalyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<SourceRoot Include="$(MSBuildThisFileDirectory)/" />
</ItemGroup>

</Project>
17 changes: 5 additions & 12 deletions src/Directory.build.targets
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
<Project>

<!-- Package references -->
<ItemGroup>
<PackageReference Update="MahApps.Metro" Version="[2.*, 3)" />
<PackageReference Update="JetBrains.Annotations" Version="2022.1.0" />
<PackageReference Update="WpfAnalyzers" Version="4.1.1" />
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageReference Update="MahApps.Metro.IconPacks" Version="4.11.0" />
<PackageReference Update="Fody" Version="6.*" />
<PackageReference Update="Costura.Fody" Version="4.*" />
</ItemGroup>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!-- AssemblyInfo -->
<PropertyGroup>
Expand All @@ -29,4 +18,8 @@
<Page Update="@(Page)" SubType="Designer" Generator="MSBuild:Compile" />
</ItemGroup>

<PropertyGroup>
<TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
</PropertyGroup>

</Project>
15 changes: 15 additions & 0 deletions src/Directory.packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
</PropertyGroup>

<ItemGroup Label="Build">
<PackageVersion Include="MahApps.Metro" Version="[2.4.10, 3)" />
<PackageVersion Include="JetBrains.Annotations" Version="2023.2.0" />
<PackageVersion Include="MahApps.Metro.IconPacks" Version="4.11.0" />
<PackageVersion Include="Costura.Fody" Version="5.7.0" />

<PackageVersion Include="WpfAnalyzers" Version="4.1.1" />
</ItemGroup>
</Project>
30 changes: 30 additions & 0 deletions src/MahApps.Metro.SimpleChildWindow.Demo/FodyWeavers.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="ExcludeRuntimeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="IncludeRuntimeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="Unmanaged32Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with line breaks.</xs:documentation>
Expand All @@ -43,6 +53,16 @@
<xs:documentation>Controls if .pdbs for reference assemblies are also embedded.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IncludeRuntimeReferences" type="xs:boolean">
<xs:annotation>
<xs:documentation>Controls if runtime assemblies are also embedded.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="UseRuntimeReferencePaths" type="xs:boolean">
<xs:annotation>
<xs:documentation>Controls whether the runtime assemblies are embedded with their full path or only with their assembly name.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="DisableCompression" type="xs:boolean">
<xs:annotation>
<xs:documentation>Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option.</xs:documentation>
Expand Down Expand Up @@ -73,6 +93,16 @@
<xs:documentation>A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="ExcludeRuntimeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with |</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="IncludeRuntimeAssemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with |.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Unmanaged32Assemblies" type="xs:string">
<xs:annotation>
<xs:documentation>A list of unmanaged 32 bit assembly names to include, delimited with |.</xs:documentation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<!-- Workaround for https://github.com/dotnet/sourcelink/issues/91 -->
<DeterministicSourcePaths Condition="'$(EnableSourceLink)' == ''">false</DeterministicSourcePaths>
</PropertyGroup>
<PropertyGroup>
<OutputType>WinExe</OutputType>
<NoWarn>SA1652</NoWarn>
<NoWarn>SA1652;WPF0041</NoWarn>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\MahApps.Metro.SimpleChildWindow\MahApps.Metro.SimpleChildWindow.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="MahApps.Metro.IconPacks" />
<PackageReference Include="Fody">
</ItemGroup>

<ItemGroup Condition="$(DefineConstants.Contains(NETCOREAPP)) == false">
<PackageReference Include="Costura.Fody">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<IncludeAssets>compile; runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Costura.Fody" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
19 changes: 11 additions & 8 deletions src/MahApps.Metro.SimpleChildWindow/Directory.Build.Props
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
<Project>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

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

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

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

<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.Props', '$(MSBuildThisFileDirectory)../'))" />
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.build.props', '$(MSBuildThisFileDirectory)../'))" />
</Project>
12 changes: 6 additions & 6 deletions src/MahApps.Metro.SimpleChildWindow/Directory.build.targets
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<ItemGroup>
<None Include="..\..\MahApps.Metro.SimpleChildWindow.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
<None Include="..\..\MahApps.Metro.SimpleChildWindow.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>

<!-- NuGet -->
Expand All @@ -24,7 +24,7 @@
<TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
</PropertyGroup>
<ItemGroup>
<EmbeddedFiles Include="$(GeneratedAssemblyInfoFile)"/>
<EmbeddedFiles Include="$(GeneratedAssemblyInfoFile)" />
</ItemGroup>

<!-- Sign assembly -->
Expand All @@ -35,5 +35,5 @@
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
</PropertyGroup>

<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.Targets', '$(MSBuildThisFileDirectory)../'))" />
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.build.targets', '$(MSBuildThisFileDirectory)../'))" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>

<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<!-- Project properties -->
<PropertyGroup>
<AssemblyName>MahApps.Metro.SimpleChildWindow</AssemblyName>
<Title>MahApps.Metro.SimpleChildWindow</Title>
<RootNamespace>MahApps.Metro.SimpleChildWindow</RootNamespace>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<OutputType>Library</OutputType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MahApps.Metro" />
<PackageReference Include="Microsoft.SourceLink.GitHub">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="MahApps.Metro" />
</ItemGroup>

<ItemGroup>
<Compile DependentUpon="%(Filename)" SubType="Code" Update="**\obj\**\*.g$(DefaultLanguageSourceExtension)" />
<Compile DependentUpon="%(Filename)" SubType="Designer" Update="**\*.xaml$(DefaultLanguageSourceExtension)" />
</ItemGroup>
</Project>
5 changes: 3 additions & 2 deletions src/global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"sdk": {
"version": "6.0.100",
"rollForward": "latestFeature"
"version": "6.0.400",
"rollForward": "latestFeature",
"allowPrerelease": false
}
}

0 comments on commit 01b7fb5

Please sign in to comment.