-
Notifications
You must be signed in to change notification settings - Fork 329
Expand file tree
/
Copy pathbuild.proj
More file actions
270 lines (224 loc) · 9.96 KB
/
build.proj
File metadata and controls
270 lines (224 loc) · 9.96 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="src/Directory.Build.props" />
<Import Project="$(ToolsDir)targets\CompareMdsRefAssemblies.targets" />
<PropertyGroup>
<!-- SourceLink variable-->
<DisableSourceLink>false</DisableSourceLink>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<ResultsDirectory Condition="$(ResultsDirectory) == ''">TestResults</ResultsDirectory>
<!--
Path to a `dotnet` version like a x86 or any especific versions in addition to a default installed version.
This property is empty by default to use the default path of the system's path variable.
The provided path should be ended to a `\` character without white spaces: Ex. C:\x86\
-->
<DotnetPath></DotnetPath>
</PropertyGroup>
<!-- Release Build properties must be turned on for Release purposes, and turned off for Code Coverage calculations -->
<PropertyGroup>
<BuildForRelease Condition="$(BuildForRelease) == ''">true</BuildForRelease>
<CI>ContinuousIntegrationBuild=$(BuildForRelease);EmbedUntrackedSources=$(BuildForRelease)</CI>
</PropertyGroup>
<!-- Populate all managed projects -->
<ItemGroup>
<Tools Include="tools/GenAPI/Microsoft.DotNet.GenAPI/Microsoft.DotNet.GenAPI.csproj" />
<SqlServer Include="**/Microsoft.SqlServer.Server.csproj" />
<Abstractions Include="src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/Abstractions.csproj" />
<Azure Include="src/Microsoft.Data.SqlClient.Extensions/Azure/src/Azure.csproj" />
<Logging Include="src/Microsoft.Data.SqlClient.Internal/Logging/src/Logging.csproj" />
<AKVProvider Include="**/add-ons/**/AzureKeyVaultProvider/*.csproj" />
</ItemGroup>
<!-- SqlServer Targets -->
<PropertyGroup>
<SqlServerProperties>$(CommonProperties)</SqlServerProperties>
<SqlServerProperties Condition="'$(SqlServerPackageVersion)' != ''">
$(SqlServerProperties);SqlServerPackageVersion=$(SqlServerPackageVersion)
</SqlServerProperties>
<SqlServerProperties Condition="'$(SqlServerAssemblyFileVersion)' != ''">
$(SqlServerProperties);SqlServerAssemblyFileVersion=$(SqlServerAssemblyFileVersion)
</SqlServerProperties>
</PropertyGroup>
<Target Name="RestoreSqlServer">
<MSBuild Projects="@(SqlServer)" Targets="restore" Properties="$(SqlServerProperties)" />
</Target>
<Target Name="BuildSqlServer" DependsOnTargets="RestoreSqlServer">
<MSBuild
Projects="@(SqlServer)"
Targets="Build"
Properties="$(CI);$(SqlServerProperties)" />
</Target>
<Target Name="PackSqlServer">
<MSBuild
Projects="@(SqlServer)"
Targets="Pack"
Properties="$(SqlServerProperties);NoBuild=true" />
</Target>
<!-- Abstractions Targets -->
<PropertyGroup>
<AbstractionsProperties>$(CommonProperties)</AbstractionsProperties>
<!--
If the AbstractionsPackageVersion property was supplied on the
command-line, then pass it along to the Abstractions build. Otherwise,
omit it entirely to avoid it expanding as empty here and thus overriding
the default behaviour in the Abstractions project. Command-line
properties take precedence over project defaults, even if their value is
empty. For example:
dotnet build -p:AbstractionsPackageVersion=
That results in $(AbstractionsPackageVersion) being defined as empty,
and cannot be overridden by the project.
-->
<AbstractionsProperties Condition="'$(AbstractionsPackageVersion)' != ''">
$(AbstractionsProperties);AbstractionsPackageVersion=$(AbstractionsPackageVersion)
</AbstractionsProperties>
<!-- Do the same for the AbstractionsAssemblyFileVersion property. -->
<AbstractionsProperties Condition="'$(AbstractionsAssemblyFileVersion)' != ''">
$(AbstractionsProperties);AbstractionsAssemblyFileVersion=$(AbstractionsAssemblyFileVersion)
</AbstractionsProperties>
</PropertyGroup>
<Target Name="RestoreAbstractions" DependsOnTargets="RestoreLogging">
<MSBuild
Projects="@(Abstractions)"
Targets="Restore"
Properties="$(AbstractionsProperties)" />
</Target>
<Target Name="BuildAbstractions" DependsOnTargets="RestoreAbstractions;BuildLogging">
<MSBuild
Projects="@(Abstractions)"
Targets="Build"
Properties="$(CI);$(AbstractionsProperties)" />
</Target>
<Target Name="PackAbstractions">
<MSBuild
Projects="@(Abstractions)"
Targets="Pack"
Properties="$(AbstractionsProperties);NoBuild=true" />
</Target>
<!-- Logging Targets -->
<PropertyGroup>
<LoggingProperties>$(CommonProperties)</LoggingProperties>
<!--
If the LoggingPackageVersion property was supplied on the command-line,
then pass it along to the Logging build. Otherwise, omit it entirely
to avoid it expanding as empty here and thus overriding the default
behaviour in the Logging project.
-->
<LoggingProperties Condition="'$(LoggingPackageVersion)' != ''">
$(LoggingProperties);LoggingPackageVersion=$(LoggingPackageVersion)
</LoggingProperties>
<!-- Do the same for the LoggingAssemblyFileVersion property. -->
<LoggingProperties Condition="'$(LoggingAssemblyFileVersion)' != ''">
$(LoggingProperties);LoggingAssemblyFileVersion=$(LoggingAssemblyFileVersion)
</LoggingProperties>
</PropertyGroup>
<Target Name="RestoreLogging">
<MSBuild
Projects="@(Logging)"
Targets="Restore"
Properties="$(LoggingProperties)" />
</Target>
<Target Name="BuildLogging" DependsOnTargets="RestoreLogging">
<MSBuild
Projects="@(Logging)"
Targets="Build"
Properties="$(CI);$(LoggingProperties)" />
</Target>
<Target Name="PackLogging">
<MSBuild
Projects="@(Logging)"
Targets="Pack"
Properties="$(LoggingProperties);NoBuild=true" />
</Target>
<!-- Azure Targets -->
<PropertyGroup>
<AzureProperties>$(CommonProperties)</AzureProperties>
<!--
If the AzurePackageVersion property was supplied on the command-line, then
pass it along to the Azure build. Otherwise, omit it entirely to avoid it
expanding as empty here and thus overriding the default behaviour in the
Azure project. Command-line properties take precedence over project
defaults, even if their value is empty. For example:
dotnet build -p:AzurePackageVersion=
That results in $(AzurePackageVersion) being defined as empty, and cannot
be overridden by the project.
-->
<AzureProperties Condition="'$(AzurePackageVersion)' != ''">
$(AzureProperties);AzurePackageVersion=$(AzurePackageVersion)
</AzureProperties>
<!-- Do the same for the AzureAssemblyFileVersion property. -->
<AzureProperties Condition="'$(AzureAssemblyFileVersion)' != ''">
$(AzureProperties);AzureAssemblyFileVersion=$(AzureAssemblyFileVersion)
</AzureProperties>
</PropertyGroup>
<Target Name="RestoreAzure">
<MSBuild
Projects="@(Azure)"
Targets="Restore"
Properties="$(AzureProperties)" />
</Target>
<Target Name="BuildAzure" DependsOnTargets="RestoreAzure">
<MSBuild
Projects="@(Azure)"
Targets="Build"
Properties="$(CI);$(AzureProperties)" />
</Target>
<Target Name="PackAzure">
<MSBuild
Projects="@(Azure)"
Targets="Pack"
Properties="$(AzureProperties);NoBuild=true" />
</Target>
<!-- Clean all build outputs. -->
<Target Name="Clean">
<RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".", "artifacts", SearchOption.AllDirectories))' />
<RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".", "bin", SearchOption.AllDirectories))' />
<RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".", ".nuget", SearchOption.AllDirectories))' />
<RemoveDir Directories='$([System.IO.Directory]::GetDirectories(".", "obj", SearchOption.AllDirectories))' />
<!-- Remove generated .nupkg and .snupkg files from packages/ and output/. -->
<ItemGroup>
<PackagesToDelete Include="$(RepoRoot)/packages/*.nupkg" />
<PackagesToDelete Include="$(RepoRoot)/packages/*.snupkg" />
<PackagesToDelete Include="$(RepoRoot)/output/*.nupkg" />
<PackagesToDelete Include="$(RepoRoot)/output/*.snupkg" />
</ItemGroup>
<Delete Files="@(PackagesToDelete)" />
</Target>
<!-- AKV Provider Targets ==================================================== -->
<PropertyGroup>
<AkvProviderProperties>$(CommonProperties)</AkvProviderProperties>
<AkvProviderProperties
Condition="'$(AkvPackageVersion)' != ''">
$(AkvProviderProperties);AkvPackageVersion=$(AkvPackageVersion)
</AkvProviderProperties>
<AkvProviderProperties
Condition="'$(AkvAssemblyFileVersion)' != ''">
$(AkvProviderProperties);AkvAssemblyFileVersion=$(AkvAssemblyFileVersion)
</AkvProviderProperties>
<AkvProviderProperties
Condition="'$(MdsPackageVersion)' != ''">
$(AkvProviderProperties);MdsPackageVersion=$(MdsPackageVersion)
</AkvProviderProperties>
<AkvProviderProperties
Condition="'$(LoggingPackageVersion)' != ''">
$(AkvProviderProperties);LoggingPackageVersion=$(LoggingPackageVersion)
</AkvProviderProperties>
<AkvProviderProperties
Condition="'$(AbstractionsPackageVersion)' != ''">
$(AkvProviderProperties);AbstractionsPackageVersion=$(AbstractionsPackageVersion)
</AkvProviderProperties>
</PropertyGroup>
<Target Name="RestoreAkvProvider">
<MSBuild Projects="@(AKVProvider)" Targets="Restore" Properties="$(AkvProviderProperties)" />
</Target>
<Target Name="BuildAkvProvider" DependsOnTargets="RestoreAkvProvider">
<MSBuild
Projects="@(AKVProvider)"
Targets="Build"
Properties="$(CI);$(AkvProviderProperties)" />
</Target>
<Target Name="PackAkvProvider">
<MSBuild
Projects="@(AKVProvider)"
Targets="Pack"
Properties="$(AkvProviderProperties);NoBuild=true" />
</Target>
</Project>