|
6 | 6 | -->
|
7 | 7 | <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />
|
8 | 8 |
|
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"> |
13 | 22 | <RepositoryUrl>https://github.com/$(OrganizationName)/$(RepositoryName)</RepositoryUrl>
|
14 | 23 | <RepositoryType>git</RepositoryType>
|
15 |
| - <PackageProjectUrl>https://github.com/$(OrganizationName)/$(RepositoryName)</PackageProjectUrl> |
16 |
| - <PackageTags></PackageTags> |
17 |
| - <Product></Product> |
18 | 24 | <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 --> |
20 | 40 | <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) --> |
21 | 49 | <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> |
23 | 70 | </PropertyGroup>
|
24 | 71 |
|
25 | 72 | <ItemGroup>
|
|
0 commit comments