|
1 | 1 | <Project> |
2 | | - <!-- Set common properties regarding assembly information and nuget packages --> |
3 | 2 |
|
4 | | - <PropertyGroup> |
5 | | - <Authors>Steven T. Cramer</Authors> |
6 | | - <Product>TimeWarp.SourceGenerators</Product> |
7 | | - <PackageId>TimeWarp.SourceGenerators</PackageId> |
8 | | - <PackageVersion>1.0.0-beta.4</PackageVersion> |
9 | | - <PackageProjectUrl>https://timewarpengineering.github.io/timewarp-source-generators/</PackageProjectUrl> |
10 | | - <PackageTags>TimeWarp; Source Generator;SourceGenerators; Delegate</PackageTags> |
11 | | - <PackageIcon>logo.png</PackageIcon> |
12 | | - <RepositoryUrl>https://github.com/TimeWarpEngineering/timewarp-source-generators.git</RepositoryUrl> |
13 | | - <RepositoryType>git</RepositoryType> |
14 | | - <GenerateDocumentationFile>true</GenerateDocumentationFile> |
15 | | - <PackageLicenseExpression>Unlicense</PackageLicenseExpression> |
16 | | - <PackageReleaseNotes> |
17 | | - For detailed release notes and changelog, please visit: https://github.com/TimeWarpEngineering/timewarp-source-generators/releases |
18 | | - </PackageReleaseNotes> |
19 | | - <PackageReadmeFile>read-me.md</PackageReadmeFile> |
20 | | - <ContentTargetFolders>contentFiles</ContentTargetFolders> |
| 3 | + <!-- Custom path definitions for repository structure --> |
| 4 | + <PropertyGroup Label="Custom Repository Variables"> |
| 5 | + <RepositoryName>timewarp-source-generators</RepositoryName> |
| 6 | + <RepositoryRoot>$(MSBuildThisFileDirectory)</RepositoryRoot> |
| 7 | + <SourceDirectory>$(RepositoryRoot)source/</SourceDirectory> |
| 8 | + <TestsDirectory>$(RepositoryRoot)tests/</TestsDirectory> |
| 9 | + <ArtifactsDirectory>$(RepositoryRoot)artifacts/</ArtifactsDirectory> |
| 10 | + <PackagesDirectory>$(ArtifactsDirectory)packages/</PackagesDirectory> |
21 | 11 | </PropertyGroup> |
22 | 12 |
|
23 | | - <!-- Deterministic Builds https://devblogs.microsoft.com/dotnet/producing-packages-with-source-link/#deterministic-builds --> |
24 | | - <PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'"> |
25 | | - <ContinuousIntegrationBuild>true</ContinuousIntegrationBuild> |
| 13 | + <!-- MSBuild and NuGet behavior configuration --> |
| 14 | + <PropertyGroup Label="MSBuild/NuGet Configuration"> |
| 15 | + <!-- Output packages to our local feed directory --> |
| 16 | + <PackageOutputPath>$(PackagesDirectory)</PackageOutputPath> |
| 17 | + |
| 18 | + <!-- Suppress .NET preview SDK message --> |
| 19 | + <SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage> |
26 | 20 | </PropertyGroup> |
27 | 21 |
|
28 | | - <!-- Common compile parameters --> |
29 | | - <PropertyGroup> |
30 | | - <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> |
31 | | - <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles> |
| 22 | + <!-- Default language and framework settings for all projects --> |
| 23 | + <PropertyGroup Label="Project Defaults"> |
| 24 | + <TargetFramework>net9.0</TargetFramework> |
32 | 25 | <ImplicitUsings>enable</ImplicitUsings> |
33 | | - <LangVersion>latest</LangVersion> |
34 | | - <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> |
35 | | - <NoWarn>CS7035;NU1503;1503;1591</NoWarn> |
36 | 26 | <Nullable>enable</Nullable> |
37 | | - <TargetFramework>net9.0</TargetFramework> |
| 27 | + <LangVersion>latest</LangVersion> |
| 28 | + <IsPackable>false</IsPackable> |
| 29 | + <GenerateDocumentationFile>true</GenerateDocumentationFile> |
| 30 | + </PropertyGroup> |
| 31 | + |
| 32 | + <!-- Code quality, analyzers, and warning configuration --> |
| 33 | + <PropertyGroup Label="Code Quality and Analysis"> |
| 34 | + <!-- Treat all warnings as errors --> |
38 | 35 | <TreatWarningsAsErrors>true</TreatWarningsAsErrors> |
| 36 | + <NoWarn>CS7035;NU1503;1503;1591</NoWarn> |
| 37 | + |
| 38 | + <!-- Enable compiler-generated files output --> |
| 39 | + <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles> |
39 | 40 | </PropertyGroup> |
40 | 41 |
|
41 | | - <!-- https://devblogs.microsoft.com/nuget/enable-repeatable-package-restores-using-a-lock-file/ supports caching of nugets in CI builds --> |
42 | | - <PropertyGroup> |
43 | | - <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> |
44 | | - <RestoreLockedMode Condition="'$(ContinuousIntegrationBuild)' == 'true'">true</RestoreLockedMode> |
| 42 | + <!-- Central Package Management --> |
| 43 | + <PropertyGroup Label="NuGet Configuration"> |
| 44 | + <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> |
45 | 45 | </PropertyGroup> |
46 | 46 |
|
47 | | - <PropertyGroup> |
| 47 | + <!-- Source Link Settings --> |
| 48 | + <PropertyGroup Label="Source Link Settings"> |
48 | 49 | <PublishRepositoryUrl>true</PublishRepositoryUrl> |
49 | 50 | <IncludeSymbols>false</IncludeSymbols> |
50 | 51 | <DebugType>portable</DebugType> |
51 | 52 | </PropertyGroup> |
52 | 53 |
|
53 | | - <!--This is to add the CommitDate and CommitHash to your assemblyinfo --> |
54 | | - <Target Name="SetAssemblyMetaData" BeforeTargets="PreBuildEvent" > |
| 54 | + <!-- Git commit metadata for assembly info --> |
| 55 | + <Target Name="SetAssemblyMetaData" BeforeTargets="PreBuildEvent"> |
55 | 56 | <Exec Command="git log -1 --format=%%ct" ConsoleToMSBuild="true" Condition="'$(OS)' == 'Windows_NT'"> |
56 | 57 | <Output TaskParameter="ConsoleOutput" PropertyName="GitCommitTimestamp"/> |
57 | 58 | </Exec> |
|
61 | 62 | <Exec Command="pwsh -ExecutionPolicy Bypass -NoProfile -File "$(MSBuildThisFileDirectory)convert-timestamp.ps1" -GitCommitTimestamp $(GitCommitTimestamp)" ConsoleToMSBuild="true"> |
62 | 63 | <Output TaskParameter="ConsoleOutput" PropertyName="CommitDate"/> |
63 | 64 | </Exec> |
64 | | - <PropertyGroup> |
65 | | - <!-- In Visual Studio the below line crashes if they fix VS then we can use this and no need for the powershell script --> |
66 | | - <!--<LastCommitDate>$([System.DateTime]::UnixEpoch.AddSeconds($(GitCommitTimestamp)).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssK"))</LastCommitDate>--> |
67 | | - </PropertyGroup> |
68 | 65 | <ItemGroup> |
69 | 66 | <AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute"> |
70 | 67 | <_Parameter1>CommitDate</_Parameter1> |
|
73 | 70 | </ItemGroup> |
74 | 71 | </Target> |
75 | 72 |
|
76 | | - <!-- Common analyzers and code fixes--> |
77 | | - <ItemGroup> |
| 73 | + <!-- Common analyzers for all projects --> |
| 74 | + <ItemGroup Label="Code Analyzers"> |
78 | 75 | <PackageReference Include="Microsoft.CodeAnalysis.Analyzers"> |
79 | 76 | <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |
80 | 77 | <PrivateAssets>all</PrivateAssets> |
|
0 commit comments