-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
142 lines (121 loc) · 8.38 KB
/
Copy pathDirectory.Build.props
File metadata and controls
142 lines (121 loc) · 8.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<Project>
<PropertyGroup>
<!-- Default to Debug configuration for local development -->
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<RepositorySourceRoot>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'src'))</RepositorySourceRoot>
<RepositoryTestRoot>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'tests'))</RepositoryTestRoot>
<RepositoryExamplesRoot>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'examples'))</RepositoryExamplesRoot>
<NormalizedProjectDirectory>$([MSBuild]::NormalizeDirectory('$(MSBuildProjectDirectory)'))</NormalizedProjectDirectory>
<IsSourcePackageProject Condition="$(NormalizedProjectDirectory.StartsWith('$(RepositorySourceRoot)'))">true</IsSourcePackageProject>
</PropertyGroup>
<PropertyGroup>
<!-- Compile settings -->
<TargetFrameworks>net10.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisMode>Recommended</AnalysisMode>
<AnalysisModeSecurity>All</AnalysisModeSecurity>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<LangVersion>14.0</LangVersion>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
<WarningsAsErrors>$(WarningsAsErrors);Nullable;NU1901;NU1902;NU1903;NU1904</WarningsAsErrors>
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild>
<!-- Build settings -->
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<!-- Package settings -->
<IncludeBuildOutput>true</IncludeBuildOutput>
<Authors>CVOYA LLC</Authors>
<Company>CVOYA LLC</Company>
<Copyright>Copyright 2025 CVOYA LLC</Copyright>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://cvoya.com/software</PackageProjectUrl>
<RepositoryUrl>https://github.com/cvoya-com/graph</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageOutputPath>$(MSBuildThisFileDirectory)artifacts</PackageOutputPath>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>icon.png</PackageIcon>
<!-- Development mode uses project references by default -->
<!-- This ensures that CI/CD workflows and local development work without requiring pre-built packages -->
<UseProjectReferences Condition="'$(UseProjectReferences)' == '' AND '$(Configuration)' == 'Debug'">true</UseProjectReferences>
<UseProjectReferences Condition="'$(UseProjectReferences)' == '' AND '$(Configuration)' == 'Benchmark'">true</UseProjectReferences>
<UseProjectReferences Condition="'$(UseProjectReferences)' == '' AND '$(Configuration)' == 'LocalFeed'">true</UseProjectReferences>
<UseProjectReferences Condition="'$(UseProjectReferences)' == '' AND '$(Configuration)' == 'Release'">true</UseProjectReferences>
<!-- Use package references only when explicitly requested -->
<!-- Set UsePackageReferences=true to build with package references instead of project references -->
<UseProjectReferences Condition="'$(UsePackageReferences)' == 'true'">false</UseProjectReferences>
<!-- LocalFeed configuration: Release optimizations + project references + package generation -->
<Optimize Condition="'$(Configuration)' == 'LocalFeed'">true</Optimize>
<GeneratePackageOnBuild Condition="'$(Configuration)' == 'LocalFeed'">true</GeneratePackageOnBuild>
<!-- Release follows the normal `dotnet pack` contract: pack builds unless
the caller explicitly disables the build. Enabling pack-on-build here
suppresses that implicit build and can silently package stale output. -->
<GeneratePackageOnBuild Condition="'$(ForcePackageGeneration)' == 'true'">true</GeneratePackageOnBuild>
<GeneratePackageOnBuild Condition="'$(GeneratePackageOnBuild)' == ''">false</GeneratePackageOnBuild>
</PropertyGroup>
<!-- Source package build metadata -->
<PropertyGroup Condition="'$(IsSourcePackageProject)' == 'true'">
<Deterministic>true</Deterministic>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>
<ItemGroup Condition="'$(IsSourcePackageProject)' == 'true'">
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
</ItemGroup>
<!-- Include README in the package -->
<ItemGroup>
<None Include="$(MSBuildProjectDirectory)\README.md" Pack="true" PackagePath="\" />
<None Include="$(MSBuildThisFileDirectory)assets\icon.png" Pack="true" PackagePath="\icon.png" />
</ItemGroup>
<!-- Test project settings -->
<PropertyGroup Condition="$(NormalizedProjectDirectory.StartsWith('$(RepositoryTestRoot)'))">
<IsTestProject>true</IsTestProject>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<IsPackable>false</IsPackable>
</PropertyGroup>
<!-- Example project settings -->
<PropertyGroup Condition="$(NormalizedProjectDirectory.StartsWith('$(RepositoryExamplesRoot)'))">
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<IsPackable>false</IsPackable>
</PropertyGroup>
<!-- Analyzer project settings - allow packaging for LocalFeed configuration -->
<PropertyGroup Condition=" '$(MSBuildProjectName)' == 'Graph.Analyzers' OR '$(MSBuildProjectName)' == 'Graph.Serialization.CodeGen' ">
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<IsPackable Condition="'$(Configuration)' == 'LocalFeed'">true</IsPackable>
<IsPackable Condition="'$(Configuration)' != 'LocalFeed'">false</IsPackable>
<!-- Override DevelopmentDependency for LocalFeed to allow packaging -->
<DevelopmentDependency Condition="'$(Configuration)' == 'LocalFeed'">false</DevelopmentDependency>
</PropertyGroup>
<!-- Version Management
Releases are tag-authoritative: scripts/release.sh pushes v<semver> and
release.yml hands that version to the pack job as GRAPH_RELEASE_VERSION.
The VERSION file is only the development default for untagged local and
CI builds — it is not the release source of truth, and nothing in CI
ever writes it. See docs/release-process.md.
AssemblyVersion/FileVersion are derived here rather than tracked in a
second file because they must be four numeric parts and cannot carry a
semver prerelease suffix. The full version, prerelease suffix and commit
sha included, still ships via InformationalVersion, which
GenerateAssemblyInfo emits from Version + SourceRevisionId. -->
<PropertyGroup>
<VersionFile>$(MSBuildThisFileDirectory)VERSION</VersionFile>
<FullVersion Condition="'$(GRAPH_RELEASE_VERSION)' != ''">$(GRAPH_RELEASE_VERSION)</FullVersion>
<FullVersion Condition="'$(FullVersion)' == '' AND Exists('$(VersionFile)')">$([System.IO.File]::ReadAllText('$(VersionFile)').Trim())</FullVersion>
<Version Condition="'$(FullVersion)' != ''">$(FullVersion)</Version>
<PackageVersion Condition="'$(FullVersion)' != ''">$(FullVersion)</PackageVersion>
<!-- Strip any prerelease suffix: 1.0.0-alpha.20260716 -> 1.0.0 -->
<NumericVersion Condition="'$(FullVersion)' != ''">$(FullVersion.Split('-')[0])</NumericVersion>
<AssemblyVersion Condition="'$(NumericVersion)' != ''">$(NumericVersion).0</AssemblyVersion>
<FileVersion Condition="'$(NumericVersion)' != ''">$(NumericVersion).0</FileVersion>
</PropertyGroup>
<Target Name="ShowVersion">
<Message Text="Current version: $(FullVersion)" Importance="high" Condition="'$(FullVersion)' != ''" />
<Message Text="No version resolved (no GRAPH_RELEASE_VERSION and no VERSION file)" Importance="high" Condition="'$(FullVersion)' == ''" />
</Target>
</Project>