|
37 | 37 | <!-- Only difference is we don't copy either to output directory --> |
38 | 38 |
|
39 | 39 | <!-- Project-level icon/readme will already be part of None items --> |
40 | | - <None Update="@(None -> WithMetadataValue('Filename', 'icon'))" |
41 | | - Pack="true" PackagePath="%(Filename)%(Extension)" |
42 | | - CopyToOutputDirectory="Never" |
43 | | - Condition="'$(PackageIcon)' != ''" /> |
44 | | - |
45 | | - <None Update="@(None -> WithMetadataValue('Filename', 'readme'))" |
46 | | - Pack="true" PackagePath="%(Filename)%(Extension)" |
47 | | - CopyToOutputDirectory="Never" |
48 | | - Condition="'$(PackReadme)' != 'false' and '$(PackageReadmeFile)' != ''" /> |
| 40 | + <None Update="@(None -> WithMetadataValue('Filename', 'icon'))" Pack="true" PackagePath="%(Filename)%(Extension)" CopyToOutputDirectory="Never" Condition="'$(PackageIcon)' != ''" /> |
| 41 | + |
| 42 | + <None Update="@(None -> WithMetadataValue('Filename', 'readme'))" Pack="true" PackagePath="%(Filename)%(Extension)" CopyToOutputDirectory="Never" Condition="'$(PackReadme)' != 'false' and '$(PackageReadmeFile)' != ''" /> |
49 | 43 |
|
50 | 44 | <!-- src-level will need explicit inclusion --> |
51 | | - <None Include="$(MSBuildThisFileDirectory)icon.png" Link="icon.png" Visible="false" |
52 | | - Pack="true" PackagePath="%(Filename)%(Extension)" |
53 | | - CopyToOutputDirectory="Never" |
54 | | - Condition="Exists('$(MSBuildThisFileDirectory)icon.png') and !Exists('$(MSBuildProjectDirectory)\icon.png')" /> |
55 | | - |
56 | | - <None Include="$(MSBuildThisFileDirectory)readme.md" Link="readme.md" |
57 | | - Pack="true" PackagePath="%(Filename)%(Extension)" |
58 | | - CopyToOutputDirectory="Never" |
59 | | - Condition="'$(PackReadme)' != 'false' and Exists('$(MSBuildThisFileDirectory)readme.md') and !Exists('$(MSBuildProjectDirectory)\readme.md')" /> |
| 45 | + <None Include="$(MSBuildThisFileDirectory)icon.png" Link="icon.png" Visible="false" Pack="true" PackagePath="%(Filename)%(Extension)" CopyToOutputDirectory="Never" Condition="Exists('$(MSBuildThisFileDirectory)icon.png') and !Exists('$(MSBuildProjectDirectory)\icon.png')" /> |
| 46 | + |
| 47 | + <None Include="$(MSBuildThisFileDirectory)readme.md" Link="readme.md" Pack="true" PackagePath="%(Filename)%(Extension)" CopyToOutputDirectory="Never" Condition="'$(PackReadme)' != 'false' and Exists('$(MSBuildThisFileDirectory)readme.md') and !Exists('$(MSBuildProjectDirectory)\readme.md')" /> |
60 | 48 | </ItemGroup> |
61 | 49 |
|
62 | 50 | <!-- Microsoft.NET.Sdk\targets\Microsoft.NET.DefaultAssemblyInfo.targets does this and is imported |
|
115 | 103 | <!-- Consider the project out of date if any of these files changes --> |
116 | 104 | <UpToDateCheck Include="@(None);@(Content);@(EmbeddedResource)" /> |
117 | 105 | <!-- Opt-in to typed resource generation by setting custom tool to MSBuild:Compile --> |
118 | | - <EmbeddedResource Update="@(EmbeddedResource -> WithMetadataValue('Generator', 'MSBuild:Compile'))" Type="Resx"> |
| 106 | + <EmbeddedResource Update="@(EmbeddedResource -> WithMetadataValue('Generator', 'MSBuild:Compile'))" Type="Resx"> |
119 | 107 | <!-- Default to Just Works resources generation. See https://www.cazzulino.com/resources.html --> |
120 | 108 | <StronglyTypedFileName>$(IntermediateOutputPath)\$([MSBuild]::ValueOrDefault('%(RelativeDir)', '').Replace('\', '.').Replace('/', '.'))%(Filename).g$(DefaultLanguageSourceExtension)</StronglyTypedFileName> |
121 | 109 | <StronglyTypedLanguage>$(Language)</StronglyTypedLanguage> |
|
141 | 129 | </ItemGroup> |
142 | 130 |
|
143 | 131 | <!-- Make sure the source control info is available before calling source generators --> |
144 | | - <Target Name="EnsureProjectInformation" |
145 | | - BeforeTargets="GenerateMSBuildEditorConfigFileShouldRun" |
146 | | - AfterTargets="InitializeSourceControlInformation" |
147 | | - DependsOnTargets="InitializeSourceControlInformation"> |
| 132 | + <Target Name="EnsureProjectInformation" BeforeTargets="GenerateMSBuildEditorConfigFileShouldRun" AfterTargets="InitializeSourceControlInformation" DependsOnTargets="InitializeSourceControlInformation"> |
148 | 133 |
|
149 | 134 | <PropertyGroup Condition="'$(SourceControlInformationFeatureSupported)' == 'true'"> |
150 | 135 | <!-- The project must specify PublishRepositoryUrl=true in order to publish the URL, in order to prevent inadvertent leak of internal URL. --> |
|
160 | 145 |
|
161 | 146 | <!-- Add SourceRoot as a project property too --> |
162 | 147 | <ItemGroup> |
163 | | - <_GitSourceRoot Include="@(SourceRoot -> WithMetadataValue('SourceControl', 'git'))" /> |
| 148 | + <_GitSourceRoot Include="@(SourceRoot -> WithMetadataValue('SourceControl', 'git'))" /> |
164 | 149 | </ItemGroup> |
165 | 150 |
|
166 | 151 | <PropertyGroup> |
|
169 | 154 |
|
170 | 155 | </Target> |
171 | 156 |
|
172 | | - <Target Name="UpdatePackageMetadata" |
173 | | - BeforeTargets="PrepareForBuild;GenerateMSBuildEditorConfigFileShouldRun;GetAssemblyVersion;GetPackageMetadata;GenerateNuspec;Pack" |
174 | | - DependsOnTargets="EnsureProjectInformation" |
175 | | - Condition="'$(SourceControlInformationFeatureSupported)' == 'true' And |
176 | | - '$(IsPackable)' == 'true'"> |
| 157 | + <Target Name="UpdatePackageMetadata" BeforeTargets="PrepareForBuild;GenerateMSBuildEditorConfigFileShouldRun;GetAssemblyVersion;GetPackageMetadata;GenerateNuspec;Pack" DependsOnTargets="EnsureProjectInformation" Condition="'$(SourceControlInformationFeatureSupported)' == 'true' And '$(IsPackable)' == 'true'"> |
177 | 158 | <PropertyGroup> |
178 | 159 | <PackageProjectUrl Condition="'$(PackageProjectUrl)' == '' and '$(PublishRepositoryUrl)' == 'true'">$(RepositoryUrl)</PackageProjectUrl> |
179 | 160 | <PackageDescription>$(Description)</PackageDescription> |
|
182 | 163 | </Target> |
183 | 164 |
|
184 | 165 | <!-- Import before UsingTask because first to declare tasks wins --> |
185 | | - <Import Project="Directory.targets" Condition="Exists('Directory.targets')"/> |
| 166 | + <Import Project="Directory.targets" Condition="Exists('Directory.targets')" /> |
186 | 167 | <Import Project="Directory.targets.user" Condition="Exists('Directory.targets.user')" /> |
187 | 168 |
|
188 | 169 | </Project> |
0 commit comments