Repository navigation
Expand file tree
/
Copy pathinitialize-standard-nuspec-properties.targets
More file actions
142 lines (122 loc) · 5.93 KB
/
Copy pathinitialize-standard-nuspec-properties.targets
File metadata and controls
142 lines (122 loc) · 5.93 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
<?xml version="1.0" encoding="utf-8"?>
<!--
Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.
This MSBuild target based on the code of Microsoft.DotNet.Arcade.Sdk.
https://github.com/dotnet/arcade/blob/master/src/Microsoft.DotNet.Arcade.Sdk/tools/Workarounds.targets
-->
<Project>
<!--
Workarounds for insufficient support for tools packages by NuGet Pack: https://github.com/NuGet/Home/issues/6321.
Project that produce tools packages use .nuspec file in order to include all the needed dependencies.
This target translates common msbuild properties to NuSpec properties.
-->
<Target Name="InitializeStandardNuspecProperties"
BeforeTargets="GenerateNuspec"
Condition="'$(IsPackable)' == 'true'">
<PropertyGroup>
<PackageId Condition="'$(NuspecPackageId)' != ''">$(NuspecPackageId)</PackageId>
<PackageProjectUrl Condition="'$(PackageProjectUrl)' == ''">$(RepositoryUrl)</PackageProjectUrl>
</PropertyGroup>
<Error Text="PackageDescription must be specified" Condition="'$(PackageDescription)' == ''"/>
<Error Text="PackageProjectUrl must be specified" Condition="'$(PackageProjectUrl)' == ''"/>
<Error Text="RepositoryUrl must be specified" Condition="'$(RepositoryUrl)' == ''"/>
<Error Text="RepositoryType must be specified" Condition="'$(RepositoryType)' == ''"/>
<Error Text="Either PackageLicenseExpression or PackageLicenseFile must be specified" Condition="'$(PackageLicenseExpression)' == '' and '$(PackageLicenseFile)' == ''"/>
<PropertyGroup Condition="'$(NuspecFile)' != '' and '$(NuspecProperties)' == ''">
<_TitleElement/>
<_TitleElement Condition="'$(Title)' != ''">
<title>$(Title)</title>
</_TitleElement>
<_ReadmeElement/>
<_ReadmeElement Condition="'$(PackageReadmeFile)' != ''">
<readme>$(PackageReadmeFile)</readme>
</_ReadmeElement>
<_ReadmeFileElement/>
<_ReadmeFileElement Condition="'$(PackageReadmeFile)' != ''">
<file src="$(PackageReadmeFullPath)" target="$(PackageReadmeFile)" />
</_ReadmeFileElement>
<_LicenseElement/>
<_LicenseElement Condition="'$(PackageLicenseExpression)' != ''">
<license type="expression">$(PackageLicenseExpression)</license>
</_LicenseElement>
<_LicenseElement Condition="'$(PackageLicenseFile)' != ''">
<license type="file">$(PackageLicenseFile)</license>
</_LicenseElement>
<_LicenseFileElement/>
<_LicenseFileElement Condition="'$(PackageLicenseFullPath)' != '' and '$(PackageLicenseFile)' != ''">
<file src="$(PackageLicenseFullPath)" target="$(PackageLicenseFile)" />
</_LicenseFileElement>
<_LicenseFileElement Condition="'$(PackageLicenseFullPath)' != '' and '$(PackageLicenseFile)' == ''">
<file src="$(PackageLicenseFullPath)" target="/" />
</_LicenseFileElement>
<_TagsElement/>
<_TagsElement Condition="'$(PackageTags)' != ''">
<tags>$(PackageTags.Replace(';', ' '))</tags>
</_TagsElement>
<_IconUrlElement/>
<_IconUrlElement Condition="'$(PackageIconUrl)' != ''">
<iconUrl>$(PackageIconUrl)</iconUrl>
</_IconUrlElement>