-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDirectory.Build.props
145 lines (107 loc) · 5.63 KB
/
Directory.Build.props
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
143
144
145
<Project>
<!--
Default properties:
-->
<PropertyGroup>
<Product>Neon.Operator</Product>
<Authors>NEONFORGE Team</Authors>
<Company>NEONFORGE LLC</Company>
<NeonSdkPackageVersion>4.0.8</NeonSdkPackageVersion>
<Copyright>Copyright © 2005-2024 by NEONFORGE LLC. All rights reserved.</Copyright>
<PackageReadmeFile Condition="Exists('README.md')">README.md</PackageReadmeFile>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<LangVersion>latest</LangVersion>
<Deterministic>true</Deterministic>
<DeterministicSourcePaths>false</DeterministicSourcePaths>
<Nullable>disable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<NoWarn>1701;1702;NETSDK1138;CS8892;ASP0014;IDE0063;IDE0090;IDE0017;IDE0079;IDE0066;MSB3243;CS8034;IDE0055</NoWarn>
<!-- Debugging -->
<DebugType>embedded</DebugType>
<DebugSymbols>true</DebugSymbols>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<!--
Our nuget publication scripts will set the environment variable [NEON_PUBLIC_SOURCELINK=true]
when the source code has been or will be commited to GitHub with the expectation that we'll
enable sourcelink to reference source code from our GitHub repos.
-->
<ContinuousIntegrationBuild Condition="'$(NEON_PUBLIC_SOURCELINK)' == 'true'">true</ContinuousIntegrationBuild>
<!-- Publish defaults -->
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
</PropertyGroup>
<PropertyGroup Label="Dotnet versions">
<DotNet6Version>6.0.*</DotNet6Version>
<DotNet7Version>7.0.*</DotNet7Version>
<DotNet8Version>8.0.*</DotNet8Version>
<DotNet9Version>9.0.0-*</DotNet9Version>
</PropertyGroup>
<PropertyGroup Condition="'$(SolutionName)' == 'operator-sdk'">
<NeonBuildUseNugets>true</NeonBuildUseNugets>
</PropertyGroup>
<PropertyGroup Condition="'$(NeonBuildUseNugets)' == '' And '$(NEON_BUILD_USE_NUGETS)' != 'true' And '$(SolutionName)' != 'operator-sdk'">
<NeonBuildUseNugets>false</NeonBuildUseNugets>
</PropertyGroup>
<PropertyGroup Condition="'$(SolutionName)' == 'operator-sdk'">
<NeonBuildUseNugets>true</NeonBuildUseNugets>
</PropertyGroup>
<PropertyGroup Condition="'$(NO_ROOT)' == ''">
<!-- Use solution directory when NO_ROOT isn't set (CI) -->
<NO_ROOT>$(SolutionDir)</NO_ROOT>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>$(DefineConstants);TRACE;DEBUG</DefineConstants>
<Optimize>false</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<Optimize>true</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(JUSTMOCK_ENABLED)' != ''">
<DefineConstants>$(DefineConstants);JUSTMOCK</DefineConstants>
</PropertyGroup>
<!-- $hack(jefflill):
We've had a lot of trouble with auto generated source files for:
* GitInfo
* AssemblyInfoAttribute
* TargetFrameworkAttribute
The problem is that these are all generated in [obj/CONFIGURATION] or
[obj/CONFIGURATION/TARGETFRAMEWORK] but the build system compiles all
C# files it sees under the project directory, and it's very easy to
end up with multiple source files defining the same classes.
We tried precleaning these files early in the build, but that didn't
work because we may end up building multiple build targets for the
same project in parallel and it also prevented us from publishing
nuget packages via scripts because we're typically running Visual
Studio in the DEBUG build configuration but publishing as RELEASE.
We also tried messing with the source input globbing rules, but
that didn't work either.
So here's what we're going to do:
* Create a local [BuildInfo] library that has only one
build configuration and target framework.
* Have [BuildInfo] reference the GitInfo nuget package
and then write a drop-in replacement for the [ThisAssembly]
class that returns the values from the local GitInfo generated
class.
* Disable generation of the [AssemblyInfoAttribute] and
[TargetFrameworkAttribute] classes for all projects.
* Manually add [AssemblyInfo.cs] and [AssemblyAttributes.cs]
classes to [BuildInfo] and reference these from other projects as
shared links. This code will include #IFDEFs to compile the correct
code for the the current target framework, etc.
-->
<PropertyGroup>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
</PropertyGroup>
<!-- Build breaks for some reason without this, since the .NET 8.0 upgrade -->
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="6.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="7.0.0" />
</ItemGroup>
</Project>