Skip to content

Commit c9c86cf

Browse files
Merge pull request #45 from atc-net/feature/align-distribution
Align distribution build structure.
2 parents 9c07687 + 1f09896 commit c9c86cf

File tree

4 files changed

+70
-14
lines changed

4 files changed

+70
-14
lines changed

distribution/Directory.Build.props

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33

4+
<PropertyGroup Label="Metadata configuration">
5+
<OrganizationName><!-- insert organization name here --></OrganizationName>
6+
<RepositoryName><!-- insert repository name here --></RepositoryName>
7+
</PropertyGroup>
8+
49
<!-- Solution wide properties -->
510
<PropertyGroup Label="Assembly Naming">
6-
<Company>CompanyName</Company>
7-
<Authors>CompanyName</Authors>
11+
<Company>$(OrganizationName)</Company>
12+
<Authors>$(OrganizationName)</Authors>
813
<NeutralLanguage>en</NeutralLanguage>
914
<DefaultLanguage>en-US</DefaultLanguage>
1015
</PropertyGroup>
@@ -22,9 +27,9 @@
2227

2328
<PropertyGroup Label="Analyzer settings">
2429
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
25-
<EnableNETAnalyzers>true</EnableNETAnalyzers>
26-
<AnalysisLevel>latest</AnalysisLevel>
27-
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
30+
<EnableNETAnalyzers>true</EnableNETAnalyzers>
31+
<AnalysisLevel>latest</AnalysisLevel>
32+
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
2833
</PropertyGroup>
2934

3035
<!-- Treat warnings as errors are always on when building in release -->

distribution/images/icon.png

5.15 KB
Loading

distribution/src/Directory.Build.props

Lines changed: 56 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,67 @@
66
-->
77
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />
88

9-
<PropertyGroup Label="Nuget package metadata">
10-
<OrganizationName><!-- Insert organization name here --></OrganizationName>
11-
<RepositoryName><!-- Insert repository name here --></RepositoryName>
12-
<PackageLicenseExpression>MIT</PackageLicenseExpression>
9+
<!--
10+
Place this in your csproj file for each nuget package that needs to be generated.
11+
12+
<PropertyGroup>
13+
<PackageId>my-id</PackageId>
14+
<PackageTags>tag1;tag2</PackageTags>
15+
<Description>Package description.</Description>
16+
</PropertyGroup>
17+
18+
-->
19+
20+
<!-- Global nuget package configurations that should not be needed to change -->
21+
<PropertyGroup Label="Global Nuget Package metadata">
1322
<RepositoryUrl>https://github.com/$(OrganizationName)/$(RepositoryName)</RepositoryUrl>
1423
<RepositoryType>git</RepositoryType>
15-
<PackageProjectUrl>https://github.com/$(OrganizationName)/$(RepositoryName)</PackageProjectUrl>
16-
<PackageTags></PackageTags>
17-
<Product></Product>
1824
<PublishRepositoryUrl>true</PublishRepositoryUrl>
19-
<EmbedUntrackedSources>true</EmbedUntrackedSources>
25+
<PackageLicenseExpression>MIT</PackageLicenseExpression>
26+
<PackageProjectUrl>https://github.com/$(OrganizationName)/$(RepositoryName)</PackageProjectUrl>
27+
<PackageIcon>icon.png</PackageIcon>
28+
</PropertyGroup>
29+
30+
<ItemGroup>
31+
<!-- Ensures package icon is valid -->
32+
<None Include="..\..\images\icon.png" Pack="true" PackagePath="\" Visible="false" />
33+
</ItemGroup>
34+
35+
<PropertyGroup Label="Build instructions">
36+
<OutputType>Library</OutputType>
37+
<TargetFramework>net5.0</TargetFramework>
38+
39+
<!-- Creates a regular package and a symbols package -->
2040
<IncludeSymbols>true</IncludeSymbols>
41+
<!-- Creates symbol package in the new .snupkg format -->
42+
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
43+
<!--
44+
Instruct the build system to embed project source files that are not tracked by the source control
45+
or imported from a source package to the generated PDB.
46+
-->
47+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
48+
<!-- Recommended: Embed symbols containing Source Link in the main file (exe/dll) -->
2149
<DebugType>embedded</DebugType>
22-
<!-- <SymbolPackageFormat>snupkg</SymbolPackageFormat> # NU5017 - https://github.com/NuGet/Home/issues/10372 -->
50+
51+
<!-- Will generate nuget packages for each project -->
52+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
53+
<!-- Web projects aren't packable by default. To override the default behavior, add the following -->
54+
<!--<IsPackable>true</IsPackable>-->
55+
</PropertyGroup>
56+
57+
<!--
58+
By default builds are non-deterministic, meaning there is no guarantee that building the same code twice(on the same or different machines)
59+
will produce exactly the same binary output. Deterministic builds are important as they enable verification that the resulting
60+
binary was built from the specified source and provides traceability.
61+
62+
To enable deterministic builds a property should be set to through: ContinuousIntegrationBuild.
63+
64+
Important: This property should not be enabled during local development as the debugger won't be able to find the local source files.
65+
66+
see : https://bartwullems.blogspot.com/2021/01/improve-debugging-experience-with.html
67+
-->
68+
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
69+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
2370
</PropertyGroup>
2471

2572
<ItemGroup>

distribution/test/Directory.Build.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
-->
77
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />
88

9+
<PropertyGroup Label="Compile settings">
10+
<Nullable>annotations</Nullable>
11+
</PropertyGroup>
12+
913
<ItemGroup Label="Test Analyzers">
1014
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.14" PrivateAssets="All" />
1115
</ItemGroup>

0 commit comments

Comments
 (0)