11<?xml version =" 1.0" encoding =" utf-8" ?>
22<Project ToolsVersion =" 14.0" xmlns =" http://schemas.microsoft.com/developer/msbuild/2003" >
3- <!--
4- Always copy/replace the icon.png
5- There is no opt-out of this feature, as the opt-out is removing the reference to CakeContrib.Guidelines
6- -->
7- <Target Name =" _CopyCakeContribGuidelinesIcon" AfterTargets =" BeforeBuild" BeforeTargets =" CoreBuild" >
8- <Copy
9- SourceFiles =" $(MSBuildThisFileDirectory)/../images/icon.png"
10- DestinationFiles =" $(MSBuildProjectDirectory)/$(CakeContribGuidelinesIconDestinationLocation)" />
11- <Message
12- Importance =" normal"
13- Text =" Copied cake-contrib icon to $(MSBuildProjectDirectory)/$(CakeContribGuidelinesIconDestinationLocation)" />
14- <Message
15- Condition =" $(CakeContribGuidelinesIconOmitImport) != ''"
16- Importance =" normal"
17- Text =" CakeContribGuidelinesIconOmitImport is set, so icon-include will be omitted" />
18-
19- <!-- check PackageIcon -->
20- <Message
21- Importance =" low"
22- Text =" PackageIcon is set to $(PackageIcon)" />
23- <CcgLogError
24- Condition =" $(PackageIcon) == ''"
25- CcgId =" 1"
26- File =" $(MSBuildProjectFullPath)"
27- Text =" PackageIcon is empty. Since you're using CakeContrib.Guidelines the PackageIcon should be set." />
28- <CcgLogWarning
29- Condition =" $(PackageIcon) != '$(CakeContribGuidelinesIconDestinationLocation)'"
30- CcgId =" 3"
31- File =" $(MSBuildProjectFullPath)"
32- Text =" PackageIcon should point to $(CakeContribGuidelinesIconDestinationLocation)." />
33-
34- <!-- check PackageIconUrl -->
35- <Message
36- Importance =" low"
37- Text =" PackageIconUrl is set to $(PackageIconUrl)" />
38- <CcgLogWarning
39- Condition =" $(PackageIconUrl) == ''"
40- CcgId =" 2"
41- File =" $(MSBuildProjectFullPath)"
42- Text =" PackageIconUrl is empty. For compatibility it should be set." />
3+
4+ <UsingTask
5+ TaskName =" $(CakeContribGuidelinesCustomTasksNamespace).EnsureCakeContribIcon"
6+ AssemblyFile =" $(CakeContribGuidelinesCustomTasksAssembly)" />
7+ <UsingTask
8+ TaskName =" $(CakeContribGuidelinesCustomTasksNamespace).EnsureCakeContribIconUrl"
9+ AssemblyFile =" $(CakeContribGuidelinesCustomTasksAssembly)" />
10+
11+ <Target Name =" _CopyCakeContribGuidelinesIcon"
12+ AfterTargets =" BeforeBuild"
13+ BeforeTargets =" CoreBuild;SetNuspecProperties;GenerateNuspec;_GetPackageFiles" >
14+ <EnsureCakeContribIcon
15+ ProjectFile =" $(MSBuildProjectFullPath)"
16+ PackageIcon =" $(PackageIcon)"
17+ NoneReferences =" @(None)"
18+ CakeContribIconPath =" $(MSBuildThisFileDirectory)/../images/icon.png"
19+ OmitIconImport =" $(CakeContribGuidelinesIconOmitImport)" >
20+ <Output PropertyName =" TempPackageIcon" TaskParameter =" PackageIconOutput" />
21+ <Output ItemName =" TempNone" TaskParameter =" AdditionalNoneRefOutput" />
22+ </EnsureCakeContribIcon >
23+
24+ <CreateProperty
25+ Condition =" $(TempPackageIcon) != ''"
26+ Value =" $(TempPackageIcon)" >
27+ <Output
28+ TaskParameter =" Value"
29+ PropertyName =" PackageIcon" />
30+ </CreateProperty >
31+ <CreateItem
32+ Condition =" @(TempNone) != ''"
33+ Include =" @(TempNone)" >
34+ <Output
35+ TaskParameter =" Include"
36+ ItemName =" None" />
37+ </CreateItem >
38+
39+ <EnsureCakeContribIconUrl
40+ ProjectFile =" $(MSBuildProjectFullPath)"
41+ PackageIconUrl =" $(PackageIconUrl)"
42+ OmitIconImport =" $(CakeContribGuidelinesIconOmitImport)"
43+ CakeContribIconUrl =" https://cdn.jsdelivr.net/gh/cake-contrib/graphics/png/cake-contrib-medium.png" >
44+ <Output ItemName =" TempPackageIconUrl" TaskParameter =" PackageIconUrlOutput" />
45+ </EnsureCakeContribIconUrl >
46+ <CreateProperty
47+ Condition =" $(TempPackageIconUrl) != ''"
48+ Value =" $(TempPackageIconUrl)" >
49+ <Output
50+ TaskParameter =" Value"
51+ PropertyName =" PackageIconUrl" />
52+ </CreateProperty >
4353 </Target >
44- </Project >
54+ </Project >
0 commit comments