-
Notifications
You must be signed in to change notification settings - Fork 695
/
NuGet.Build.Tasks.Pack.targets
537 lines (479 loc) · 25.9 KB
/
NuGet.Build.Tasks.Pack.targets
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
<!--
***********************************************************************************************
NuGet.Build.Tasks.Pack.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
Copyright (c) .NET Foundation. All rights reserved.
***********************************************************************************************
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Load NuGet.Build.Tasks.Pack.dll, this can be overridden to use a different version with $(NuGetPackTaskAssemblyFile) -->
<PropertyGroup Condition="$(NuGetPackTaskAssemblyFile) == ''">
<NuGetPackTaskAssemblyFile Condition="'$(MSBuildRuntimeType)' == 'Core'">..\CoreCLR\NuGet.Build.Tasks.Pack.dll</NuGetPackTaskAssemblyFile>
<NuGetPackTaskAssemblyFile Condition="'$(MSBuildRuntimeType)' != 'Core'">..\Desktop\NuGet.Build.Tasks.Pack.dll</NuGetPackTaskAssemblyFile>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<!-- Tasks -->
<UsingTask TaskName="NuGet.Build.Tasks.Pack.PackTask" AssemblyFile="$(NuGetPackTaskAssemblyFile)" />
<UsingTask TaskName="NuGet.Build.Tasks.Pack.GetPackOutputItemsTask" AssemblyFile="$(NuGetPackTaskAssemblyFile)" />
<UsingTask TaskName="NuGet.Build.Tasks.GetProjectTargetFrameworksTask" AssemblyFile="$(NuGetPackTaskAssemblyFile)" />
<UsingTask TaskName="NuGet.Build.Tasks.Pack.GetProjectReferencesFromAssetsFileTask" AssemblyFile="$(NuGetPackTaskAssemblyFile)" />
<UsingTask TaskName="NuGet.Build.Tasks.Pack.IsPackableFalseWarningTask" AssemblyFile="$(NuGetPackTaskAssemblyFile)" />
<PropertyGroup>
<PackageId Condition=" '$(PackageId)' == '' ">$(AssemblyName)</PackageId>
<PackageVersion Condition=" '$(PackageVersion)' == '' ">$(Version)</PackageVersion>
<IncludeContentInPack Condition="'$(IncludeContentInPack)'==''">true</IncludeContentInPack>
<GenerateNuspecDependsOn>_LoadPackInputItems; _GetTargetFrameworksOutput; _WalkEachTargetPerFramework; _GetPackageFiles; $(GenerateNuspecDependsOn)</GenerateNuspecDependsOn>
<PackageDescription Condition="'$(PackageDescription)'==''">$(Description)</PackageDescription>
<PackageDescription Condition="'$(PackageDescription)'==''">Package Description</PackageDescription>
<IsPackable Condition="'$(IsPackable)'=='' AND '$(IsTestProject)'=='true'">false</IsPackable>
<IsPackable Condition="'$(IsPackable)'==''">true</IsPackable>
<IncludeBuildOutput Condition="'$(IncludeBuildOutput)'==''">true</IncludeBuildOutput>
<BuildOutputTargetFolder Condition="'$(BuildOutputTargetFolder)' == '' AND '$(IsTool)' == 'true'">tools</BuildOutputTargetFolder>
<BuildOutputTargetFolder Condition="'$(BuildOutputTargetFolder)' == ''">lib</BuildOutputTargetFolder>
<ContentTargetFolders Condition="'$(ContentTargetFolders)' == ''">content;contentFiles</ContentTargetFolders>
<PackDependsOn>$(BeforePack); _IntermediatePack; GenerateNuspec; $(PackDependsOn)</PackDependsOn>
<IsInnerBuild Condition="'$(TargetFramework)' != '' AND '$(TargetFrameworks)' != ''">true</IsInnerBuild>
<SymbolPackageFormat Condition="'$(SymbolPackageFormat)' == ''">symbols.nupkg</SymbolPackageFormat>
<AddPriFileDependsOn Condition="'$(MicrosoftPortableCurrentVersionPropsHasBeenImported)' == 'true'">DeterminePortableBuildCapabilities</AddPriFileDependsOn>
<WarnOnPackingNonPackableProject Condition="'$(WarnOnPackingNonPackableProject)' == ''">false</WarnOnPackingNonPackableProject>
<ImportNuGetBuildTasksPackTargetsFromSdk Condition="'$(ImportNuGetBuildTasksPackTargetsFromSdk)' == ''">false</ImportNuGetBuildTasksPackTargetsFromSdk>
<AllowedOutputExtensionsInPackageBuildOutputFolder>.dll; .exe; .winmd; .json; .pri; .xml; $(AllowedOutputExtensionsInPackageBuildOutputFolder)</AllowedOutputExtensionsInPackageBuildOutputFolder>
<AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder Condition="'$(SymbolPackageFormat)' != 'snupkg'">.pdb; .mdb; $(AllowedOutputExtensionsInPackageBuildOutputFolder); $(AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder)</AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>
<AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder Condition="'$(SymbolPackageFormat)' == 'snupkg'">.pdb</AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>
<SuppressDependenciesWhenPacking Condition="'$(SuppressDependenciesWhenPacking)' == ''">false</SuppressDependenciesWhenPacking>
</PropertyGroup>
<PropertyGroup Condition="'$(NoBuild)' == 'true' or '$(GeneratePackageOnBuild)' == 'true'">
<GenerateNuspecDependsOn>$(GenerateNuspecDependsOn)</GenerateNuspecDependsOn>
</PropertyGroup>
<PropertyGroup Condition="'$(NoBuild)' != 'true' and '$(GeneratePackageOnBuild)' != 'true'">
<GenerateNuspecDependsOn>Build;$(GenerateNuspecDependsOn)</GenerateNuspecDependsOn>
</PropertyGroup>
<ItemGroup>
<ProjectCapability Include="Pack"/>
</ItemGroup>
<ItemDefinitionGroup>
<BuildOutputInPackage>
<TargetFramework>$(TargetFramework)</TargetFramework>
</BuildOutputInPackage>
</ItemDefinitionGroup>
<PropertyGroup>
<RestoreOutputPath Condition="'$(RestoreOutputPath)' == ''">$(MSBuildProjectExtensionsPath)</RestoreOutputPath>
<PackageOutputPath Condition="'$(PackageOutputPath)' == ''">$(BaseOutputPath)$(Configuration)\</PackageOutputPath>
<NuspecOutputPath Condition="'$(NuspecOutputPath)' == ''">$(BaseIntermediateOutputPath)$(Configuration)\</NuspecOutputPath>
</PropertyGroup>
<!--
============================================================
_GetAbsoluteOutputPathsForPack
Gets the absolute output paths for Pack.
============================================================
-->
<Target Name="_GetAbsoluteOutputPathsForPack">
<ConvertToAbsolutePath Paths="$(RestoreOutputPath)">
<Output TaskParameter="AbsolutePaths" PropertyName="RestoreOutputAbsolutePath" />
</ConvertToAbsolutePath>
<ConvertToAbsolutePath Paths="$(PackageOutputPath)">
<Output TaskParameter="AbsolutePaths" PropertyName="PackageOutputAbsolutePath" />
</ConvertToAbsolutePath>
<ConvertToAbsolutePath Paths="$(NuspecOutputPath)">
<Output TaskParameter="AbsolutePaths" PropertyName="NuspecOutputAbsolutePath" />
</ConvertToAbsolutePath>
</Target>
<!--
============================================================
_GetOutputItemsFromPack
Gets the output '.nupkg' and '.nuspec' absolute file paths.
============================================================
-->
<Target Name="_GetOutputItemsFromPack"
DependsOnTargets="_GetAbsoluteOutputPathsForPack"
Returns="@(_OutputPackItems)">
<!-- 'PackageOutputAbsolutePath' and 'NuspecOutputAbsolutePath' will be provided by '_GetAbsoluteOutputPathsForPack' target -->
<GetPackOutputItemsTask
PackageOutputPath="$(PackageOutputAbsolutePath)"
NuspecOutputPath="$(NuspecOutputAbsolutePath)"
PackageId="$(PackageId)"
PackageVersion="$(PackageVersion)"
IncludeSymbols="$(IncludeSymbols)"
IncludeSource="$(IncludeSource)"
SymbolPackageFormat="$(SymbolPackageFormat)">
<Output
TaskParameter="OutputPackItems"
ItemName="_OutputPackItems" />
</GetPackOutputItemsTask>
</Target>
<!--
============================================================
_GetTargetFrameworksOutput
Read target frameworks from the project.
============================================================
-->
<Target Name="_GetTargetFrameworksOutput"
Returns="@(_TargetFrameworks)">
<PropertyGroup>
<_ProjectFrameworks/>
</PropertyGroup>
<GetProjectTargetFrameworksTask
ProjectPath="$(MSBuildProjectFullPath)"
TargetFrameworks="$(TargetFrameworks)"
TargetFramework="$(TargetFramework)"
TargetFrameworkMoniker="$(TargetFrameworkMoniker)"
TargetPlatformIdentifier="$(TargetPlatformIdentifier)"
TargetPlatformVersion="$(TargetPlatformVersion)"
TargetPlatformMinVersion="$(TargetPlatformMinVersion)">
<Output
TaskParameter="ProjectTargetFrameworks"
PropertyName="_ProjectFrameworks" />
</GetProjectTargetFrameworksTask>
<ItemGroup Condition=" '$(_ProjectFrameworks)' != '' ">
<_TargetFrameworks Include="$(_ProjectFrameworks.Split(';'))" />
</ItemGroup>
</Target>
<!--
============================================================
Pack
Post Build Target
============================================================
-->
<Target Name="_PackAsBuildAfterTarget"
AfterTargets="Build"
Condition="'$(GeneratePackageOnBuild)' == 'true' AND '$(IsInnerBuild)' != 'true'"
DependsOnTargets="Pack">
</Target>
<Target Name="_CleanPackageFiles"
DependsOnTargets="_GetOutputItemsFromPack"
AfterTargets="Clean"
Condition="'$(GeneratePackageOnBuild)' == 'true'">
<ItemGroup>
<_PackageFilesToDelete Include="@(_OutputPackItems)"/>
</ItemGroup>
<Delete Files="@(_PackageFilesToDelete)"/>
</Target>
<Target Name="_CalculateInputsOutputsForPack" DependsOnTargets="_GetOutputItemsFromPack">
<PropertyGroup Condition="$(ContinuePackingAfterGeneratingNuspec) == '' ">
<ContinuePackingAfterGeneratingNuspec>false</ContinuePackingAfterGeneratingNuspec>
</PropertyGroup>
<ItemGroup>
<!--This catches changes to properties-->
<NuGetPackInput Include="$(MSBuildAllProjects)"/>
<NuGetPackInput Include="@(_PackageFiles)"/>
<NuGetPackInput Include="@(_PackageFilesToExclude)"/>
<NuGetPackInput Include="@(_BuildOutputInPackage->'%(FinalOutputPath)')"/>
<NuGetPackInput Include="@(_TargetPathsToSymbols->'%(FinalOutputPath)')"/>
<NuGetPackInput Include="@(_SourceFiles)"/>
<NuGetPackInput Include="@(_References)"/>
<NuGetPackOutput Include="@(_OutputPackItems)" />
</ItemGroup>
</Target>
<!--
============================================================
Pack
Main entry point for packing packages
============================================================
-->
<Target Name="Pack" DependsOnTargets="$(PackDependsOn)">
<IsPackableFalseWarningTask Condition="'$(IsPackable)' == 'false' AND '$(WarnOnPackingNonPackableProject)' == 'true'"/>
</Target>
<Target Name="_IntermediatePack">
<PropertyGroup>
<ContinuePackingAfterGeneratingNuspec>true</ContinuePackingAfterGeneratingNuspec>
</PropertyGroup>
</Target>
<Target Name="GenerateNuspec"
Condition="$(IsPackable) == 'true'"
Inputs="@(NuGetPackInput)" Outputs="@(NuGetPackOutput)"
DependsOnTargets="$(GenerateNuspecDependsOn);_CalculateInputsOutputsForPack;_GetProjectReferenceVersions;_InitializeNuspecRepositoryInformationProperties">
<ConvertToAbsolutePath Condition="$(NuspecFile) != ''" Paths="$(NuspecFile)">
<Output TaskParameter="AbsolutePaths" PropertyName="NuspecFileAbsolutePath" />
</ConvertToAbsolutePath>
<!-- Call Pack -->
<PackTask PackItem="$(PackProjectInputFile)"
PackageFiles="@(_PackageFiles)"
PackageFilesToExclude="@(_PackageFilesToExclude)"
PackageVersion="$(PackageVersion)"
PackageId="$(PackageId)"
Title="$(Title)"
Authors="$(Authors)"
Description="$(PackageDescription)"
Copyright="$(Copyright)"
RequireLicenseAcceptance="$(PackageRequireLicenseAcceptance)"
LicenseUrl="$(PackageLicenseUrl)"
ProjectUrl="$(PackageProjectUrl)"
IconUrl="$(PackageIconUrl)"
ReleaseNotes="$(PackageReleaseNotes)"
Tags="$(PackageTags)"
DevelopmentDependency="$(DevelopmentDependency)"
BuildOutputInPackage="@(_BuildOutputInPackage)"
ProjectReferencesWithVersions="@(_ProjectReferencesWithVersions)"
TargetPathsToSymbols="@(_TargetPathsToSymbols)"
TargetFrameworks="@(_TargetFrameworks)"
FrameworksWithSuppressedDependencies="@(_FrameworksWithSuppressedDependencies)"
AssemblyName="$(AssemblyName)"
PackageOutputPath="$(PackageOutputAbsolutePath)"
IncludeSymbols="$(IncludeSymbols)"
IncludeSource="$(IncludeSource)"
PackageTypes="$(PackageType)"
IsTool="$(IsTool)"
RepositoryUrl="$(RepositoryUrl)"
RepositoryType="$(RepositoryType)"
RepositoryBranch="$(RepositoryBranch)"
RepositoryCommit="$(RepositoryCommit)"
SourceFiles="@(_SourceFiles->Distinct())"
NoPackageAnalysis="$(NoPackageAnalysis)"
NoDefaultExcludes="$(NoDefaultExcludes)"
MinClientVersion="$(MinClientVersion)"
Serviceable="$(Serviceable)"
FrameworkAssemblyReferences="@(_FrameworkAssemblyReferences)"
ContinuePackingAfterGeneratingNuspec="$(ContinuePackingAfterGeneratingNuspec)"
NuspecOutputPath="$(NuspecOutputAbsolutePath)"
IncludeBuildOutput="$(IncludeBuildOutput)"
BuildOutputFolders="$(BuildOutputTargetFolder)"
ContentTargetFolders="$(ContentTargetFolders)"
RestoreOutputPath="$(RestoreOutputAbsolutePath)"
NuspecFile="$(NuspecFileAbsolutePath)"
NuspecBasePath="$(NuspecBasePath)"
NuspecProperties="$(NuspecProperties)"
AllowedOutputExtensionsInPackageBuildOutputFolder="$(AllowedOutputExtensionsInPackageBuildOutputFolder)"
AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder="$(AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder)"
NoWarn="$(NoWarn)"
WarningsAsErrors="$(WarningsAsErrors)"
TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
OutputFileNamesWithoutVersion="$(OutputFileNamesWithoutVersion)"
InstallPackageToOutputPath="$(InstallPackageToOutputPath)"
SymbolPackageFormat="$(SymbolPackageFormat)"
PackageLicenseFile="$(PackageLicenseFile)"
PackageLicenseExpression="$(PackageLicenseExpression)"
PackageLicenseExpressionVersion="$(PackageLicenseExpressionVersion)"
Deterministic="$(Deterministic)"
PackageIcon="$(PackageIcon)"
/>
</Target>
<!--
Initialize Repository* properties from properties set by a source control package, if available in the project.
-->
<Target Name="_InitializeNuspecRepositoryInformationProperties"
DependsOnTargets="InitializeSourceControlInformation"
Condition="'$(SourceControlInformationFeatureSupported)' == 'true'">
<PropertyGroup>
<!-- The project must specify PublishRepositoryUrl=true in order to publish the URL, in order to prevent inadvertent leak of internal URL. -->
<RepositoryUrl Condition="'$(RepositoryUrl)' == '' and '$(PublishRepositoryUrl)' == 'true'">$(PrivateRepositoryUrl)</RepositoryUrl>
<RepositoryCommit Condition="'$(RepositoryCommit)' == ''">$(SourceRevisionId)</RepositoryCommit>
</PropertyGroup>
</Target>
<!--
============================================================
_LoadPackGraphEntryPoints
Find project entry point and load them into items.
============================================================
-->
<Target Name="_LoadPackInputItems">
<!-- Allow overriding items with PackProjectInputFile -->
<PropertyGroup Condition="'$(PackProjectInputFile)' == ''">
<PackProjectInputFile>$(MSBuildProjectFullPath)</PackProjectInputFile>
</PropertyGroup>
</Target>
<Target Name="_GetProjectReferenceVersions"
Condition="'$(NuspecFile)' == ''"
DependsOnTargets="_GetAbsoluteOutputPathsForPack;$(GetPackageVersionDependsOn)">
<!-- 'RestoreOutputAbsolutePath' will be provided by '_GetAbsoluteOutputPathsForPack' target -->
<ConvertToAbsolutePath Condition="'$(ProjectAssetsFile)' != ''" Paths="$(ProjectAssetsFile)">
<Output TaskParameter="AbsolutePaths" PropertyName="ProjectAssetsFileAbsolutePath" />
</ConvertToAbsolutePath>
<GetProjectReferencesFromAssetsFileTask
RestoreOutputAbsolutePath="$(RestoreOutputAbsolutePath)"
ProjectAssetsFileAbsolutePath="$(ProjectAssetsFileAbsolutePath)">
<Output
TaskParameter="ProjectReferences"
ItemName="_ProjectReferencesFromAssetsFile" />
</GetProjectReferencesFromAssetsFileTask>
<MSBuild
Projects="@(_ProjectReferencesFromAssetsFile)"
Targets="_GetProjectVersion"
SkipNonexistentTargets="true"
SkipNonexistentProjects="true"
Properties="BuildProjectReferences=false;">
<Output
TaskParameter="TargetOutputs"
ItemName="_ProjectReferencesWithVersions"/>
</MSBuild>
</Target>
<Target Name="_GetProjectVersion" DependsOnTargets="$(GetPackageVersionDependsOn)"
Returns="@(_ProjectPathWithVersion)">
<ItemGroup>
<_ProjectPathWithVersion Include="$(MSBuildProjectFullPath)">
<ProjectVersion Condition="'$(PackageVersion)' != ''">$(PackageVersion)</ProjectVersion>
<ProjectVersion Condition="'$(PackageVersion)' == ''">1.0.0</ProjectVersion>
</_ProjectPathWithVersion>
</ItemGroup>
</Target>
<Target Name="_WalkEachTargetPerFramework">
<MSBuild
Condition="'$(IncludeBuildOutput)' == 'true'"
Projects="$(MSBuildProjectFullPath)"
Targets="_GetBuildOutputFilesWithTfm"
Properties="TargetFramework=%(_TargetFrameworks.Identity);">
<Output
TaskParameter="TargetOutputs"
ItemName="_BuildOutputInPackage" />
</MSBuild>
<MSBuild
Condition="'$(TargetsForTfmSpecificContentInPackage)' != ''"
Projects="$(MSBuildProjectFullPath)"
Targets="_GetTfmSpecificContentForPackage"
Properties="TargetFramework=%(_TargetFrameworks.Identity);">
<Output
TaskParameter="TargetOutputs"
ItemName="_PackageFiles"/>
</MSBuild>
<MSBuild
Condition="'$(IncludeBuildOutput)' == 'true'"
Projects="$(MSBuildProjectFullPath)"
Targets="_GetDebugSymbolsWithTfm"
Properties="TargetFramework=%(_TargetFrameworks.Identity);">
<Output
TaskParameter="TargetOutputs"
ItemName="_TargetPathsToSymbols" />
</MSBuild>
<MSBuild
Condition="'$(IncludeSource)' == 'true'"
Projects="$(MSBuildProjectFullPath)"
Targets="SourceFilesProjectOutputGroup"
Properties="TargetFramework=%(_TargetFrameworks.Identity);
BuildProjectReferences=false;">
<Output
TaskParameter="TargetOutputs"
ItemName="_SourceFiles" />
</MSBuild>
<MSBuild
Projects="$(MSBuildProjectFullPath)"
Targets="_GetFrameworkAssemblyReferences"
Properties="TargetFramework=%(_TargetFrameworks.Identity);
BuildProjectReferences=false;">
<Output
TaskParameter="TargetOutputs"
ItemName="_FrameworkAssemblyReferences" />
</MSBuild>
<MSBuild
Projects="$(MSBuildProjectFullPath)"
Targets="_GetFrameworksWithSuppressedDependencies"
Properties="TargetFramework=%(_TargetFrameworks.Identity);
BuildProjectReferences=false;">
<Output
TaskParameter="TargetOutputs"
ItemName="_FrameworksWithSuppressedDependencies" />
</MSBuild>
</Target>
<Target Name ="_GetFrameworksWithSuppressedDependencies" Returns="@(_TfmWithDependenciesSuppressed)">
<ItemGroup>
<_TfmWithDependenciesSuppressed Include="$(TargetFramework)" Condition="'$(SuppressDependenciesWhenPacking)' == 'true'"/>
</ItemGroup>
</Target>
<Target Name ="_GetFrameworkAssemblyReferences" DependsOnTargets="ResolveReferences" Returns="@(TfmSpecificFrameworkAssemblyReferences)">
<ItemGroup>
<TfmSpecificFrameworkAssemblyReferences Include="@(ReferencePath->'%(OriginalItemSpec)')"
Condition="'%(ReferencePath.Pack)' != 'false' AND '%(ReferencePath.ResolvedFrom)' == '{TargetFrameworkDirectory}'">
<TargetFramework>$(TargetFramework)</TargetFramework>
</TfmSpecificFrameworkAssemblyReferences>
</ItemGroup>
</Target>
<Target Name="_GetBuildOutputFilesWithTfm"
DependsOnTargets="BuiltProjectOutputGroup;DocumentationProjectOutputGroup;SatelliteDllsProjectOutputGroup;_AddPriFileToPackBuildOutput;$(TargetsForTfmSpecificBuildOutput)"
Returns="@(BuildOutputInPackage)">
<ItemGroup>
<BuildOutputInPackage Include="@(SatelliteDllsProjectOutputGroupOutput);
@(BuiltProjectOutputGroupOutput);
@(DocumentationProjectOutputGroupOutput);
@(_PathToPriFile)"/>
</ItemGroup>
</Target>
<Target Name="_GetTfmSpecificContentForPackage"
DependsOnTargets="$(TargetsForTfmSpecificContentInPackage)"
Returns="@(TfmSpecificPackageFileWithRecursiveDir)">
<!-- The below workaround needs to be done due to msbuild bug https://github.com/Microsoft/msbuild/issues/3121 -->
<ItemGroup>
<TfmSpecificPackageFileWithRecursiveDir Include="@(TfmSpecificPackageFile)">
<NuGetRecursiveDir>%(TfmSpecificPackageFile.RecursiveDir)</NuGetRecursiveDir>
<BuildAction>%(TfmSpecificPackageFile.BuildAction)</BuildAction>
</TfmSpecificPackageFileWithRecursiveDir>
</ItemGroup>
</Target>
<Target Name="_GetDebugSymbolsWithTfm"
DependsOnTargets="DebugSymbolsProjectOutputGroup"
Returns="@(_TargetPathsToSymbolsWithTfm)">
<ItemGroup>
<_TargetPathsToSymbolsWithTfm Include="@(DebugSymbolsProjectOutputGroupOutput)">
<TargetFramework>$(TargetFramework)</TargetFramework>
</_TargetPathsToSymbolsWithTfm>
</ItemGroup>
</Target>
<!--Projects with target framework like UWP, Win8, wpa81 produce a Pri file
in their bin dir. This Pri file is not included in the BuiltProjectGroupOutput, and
has to be added manually here.-->
<Target Name="_AddPriFileToPackBuildOutput"
Returns="@(_PathToPriFile)"
DependsOnTargets="$(AddPriFileDependsOn)">
<ItemGroup Condition="'$(IncludeProjectPriFile)' == 'true'">
<_PathToPriFile Include="$(ProjectPriFullPath)">
<FinalOutputPath>$(ProjectPriFullPath)</FinalOutputPath>
<TargetPath>$(ProjectPriFileName)</TargetPath>
</_PathToPriFile>
</ItemGroup>
</Target>
<!--
============================================================
_GetPackageFiles
Entry point for generating the project to project references.
============================================================
-->
<Target Name="_GetPackageFiles" Condition="$(IncludeContentInPack) == 'true'">
<ItemGroup>
<_PackageFilesToExclude Include="@(Content)" Condition="'%(Content.Pack)' == 'false'"/>
</ItemGroup>
<!-- Include PackageFiles and Content of the project being packed -->
<ItemGroup>
<_PackageFiles Include="@(Content)" Condition=" %(Content.Pack) != 'false' ">
<BuildAction Condition="'%(Content.BuildAction)' == ''">Content</BuildAction>
</_PackageFiles>
<_PackageFiles Include="@(Compile)" Condition=" %(Compile.Pack) == 'true' ">
<BuildAction Condition="'%(Compile.BuildAction)' == ''">Compile</BuildAction>
</_PackageFiles>
<_PackageFiles Include="@(None)" Condition=" %(None.Pack) == 'true' ">
<BuildAction Condition="'%(None.BuildAction)' == ''">None</BuildAction>
</_PackageFiles>
<_PackageFiles Include="@(EmbeddedResource)" Condition=" %(EmbeddedResource.Pack) == 'true' ">
<BuildAction Condition="'%(EmbeddedResource.BuildAction)' == ''">EmbeddedResource</BuildAction>
</_PackageFiles>
<_PackageFiles Include="@(ApplicationDefinition)" Condition=" %(ApplicationDefinition.Pack) == 'true' ">
<BuildAction Condition="'%(ApplicationDefinition.BuildAction)' == ''">ApplicationDefinition</BuildAction>
</_PackageFiles>
<_PackageFiles Include="@(Page)" Condition=" %(Page.Pack) == 'true' ">
<BuildAction Condition="'%(Page.BuildAction)' == ''">Page</BuildAction>
</_PackageFiles>
<_PackageFiles Include="@(Resource)" Condition=" %(Resource.Pack) == 'true' ">
<BuildAction Condition="'%(Resource.BuildAction)' == ''">Resource</BuildAction>
</_PackageFiles>
<_PackageFiles Include="@(SplashScreen)" Condition=" %(SplashScreen.Pack) == 'true' ">
<BuildAction Condition="'%(SplashScreen.BuildAction)' == ''">SplashScreen</BuildAction>
</_PackageFiles>
<_PackageFiles Include="@(DesignData)" Condition=" %(DesignData.Pack) == 'true' ">
<BuildAction Condition="'%(DesignData.BuildAction)' == ''">DesignData</BuildAction>
</_PackageFiles>
<_PackageFiles Include="@(DesignDataWithDesignTimeCreatableTypes)" Condition=" %(DesignDataWithDesignTimeCreatableTypes.Pack) == 'true' ">
<BuildAction Condition="'%(DesignDataWithDesignTimeCreatableTypes.BuildAction)' == ''">DesignDataWithDesignTimeCreatableTypes</BuildAction>
</_PackageFiles>
<_PackageFiles Include="@(CodeAnalysisDictionary)" Condition=" %(CodeAnalysisDictionary.Pack) == 'true' ">
<BuildAction Condition="'%(CodeAnalysisDictionary.BuildAction)' == ''">CodeAnalysisDictionary</BuildAction>
</_PackageFiles>
<_PackageFiles Include="@(AndroidAsset)" Condition=" %(AndroidAsset.Pack) == 'true' ">
<BuildAction Condition="'%(AndroidAsset.BuildAction)' == ''">AndroidAsset</BuildAction>
</_PackageFiles>
<_PackageFiles Include="@(AndroidResource)" Condition=" %(AndroidResource.Pack) == 'true' ">
<BuildAction Condition="'%(AndroidResource.BuildAction)' == ''">AndroidResource</BuildAction>
</_PackageFiles>
<_PackageFiles Include="@(BundleResource)" Condition=" %(BundleResource.Pack) == 'true' ">
<BuildAction Condition="'%(BundleResource.BuildAction)' == ''">BundleResource</BuildAction>
</_PackageFiles>
</ItemGroup>
</Target>
</Project>