Skip to content

Commit 24b8eba

Browse files
authored
Continuous Integration Publish: 71ad377
Merge pull request #107 from cake-contrib/feature/GH-80 (GH-80) existing icons will be honored
1 parent 0cbf610 commit 24b8eba

14 files changed

+43
-349
lines changed

feed.atom

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
<title>CakeContrib.Guidelines</title>
55
<link rel="self" href="https://cake-contrib.github.io/CakeContrib.Guidelines" />
66
<rights>2021</rights>
7-
<updated>2021-03-03T19:50:40Z</updated>
7+
<updated>2021-03-12T07:24:11Z</updated>
88
</feed>

feed.rss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<link>https://cake-contrib.github.io/CakeContrib.Guidelines</link>
66
<description />
77
<copyright>2021</copyright>
8-
<pubDate>Wed, 03 Mar 2021 19:50:40 GMT</pubDate>
9-
<lastBuildDate>Wed, 03 Mar 2021 19:50:40 GMT</lastBuildDate>
8+
<pubDate>Fri, 12 Mar 2021 07:24:11 GMT</pubDate>
9+
<lastBuildDate>Fri, 12 Mar 2021 07:24:11 GMT</lastBuildDate>
1010
</channel>
1111
</rss>

guidelines/CakeContribIcon.html

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ <h2 id="table-of-contents">Table of Contents</h2>
123123
<li><a href="#usage">Usage</a></li>
124124
<li><a href="#settings">Settings</a>
125125
<ul>
126-
<li><a href="#icon-location">Icon-Location</a></li>
127126
<li><a href="#icon-include-in-project">Icon include in project</a></li>
128127
</ul>
129128
</li>
@@ -146,44 +145,35 @@ <h2 id="usage">Usage</h2>
146145
<p>Using this package automatically enables this guideline.</p>
147146
<p>With no special settings at all (i.e. &quot;The Standard&quot;):</p>
148147
<ul>
149-
<li>the current cake-contrib icon will be copied as &quot;icon.png&quot; in the project-directory</li>
150-
<li>the icon will be included in the project</li>
148+
<li>if no <code>PackageIcon</code> property is specified, a default will be assigned.</li>
149+
<li>if no icon (matching the <code>PackageIcon</code> property) is referenced in the project, a default will be referenced.</li>
150+
<li>if the referenced icon is not binary equal to the default icon, it will be updated.</li>
151+
<li>if no <code>PackageIconUrl</code> property is specified, a default will be assigned.</li>
151152
</ul>
152153
<h2 id="settings">Settings</h2>
153-
<h3 id="icon-location">Icon-Location</h3>
154-
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
155-
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
156-
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
157-
<p>The default location of the cake-contrib icon is <code>icon.png</code>, next to the csproj (i.e. <code>$(MSBuildProjectDirectory)/icon.png</code>).</p>
158-
<p>Setting <code>CakeContribGuidelinesIconDestinationLocation</code> makes it possible to override the default location of the Icon. For example setting</p>
159-
<pre><code class="language-xml">&lt;PropertyGroup&gt;
160-
&lt;CakeContribGuidelinesIconDestinationLocation&gt;../logo.png&lt;/CakeContribGuidelinesIconDestinationLocation&gt;
161-
&lt;/PropertyGroup&gt;
162-
</code></pre>
163-
<p>in the csproj will place the icon as <code>logo.png</code> one folder up (relative to the current project).</p>
164154
<h3 id="icon-include-in-project">Icon include in project</h3>
165155
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
166156
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
167157
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
168-
<p>The cake-contrib icon will be automatically included in the project, unless <code>CakeContribGuidelinesIconOmitImport</code> was defined.</p>
158+
<p>The cake-contrib icon will be automatically included in the project, unless
159+
<code>CakeContribGuidelinesIconOmitImport</code> is set to <code>True</code>.</p>
169160
<p>To to use a &quot;custom&quot; import the following could be used:</p>
170161
<pre><code class="language-xml">&lt;PropertyGroup&gt;
171-
&lt;CakeContribGuidelinesIconOmitImport&gt;1&lt;/CakeContribGuidelinesIconOmitImport&gt;
162+
&lt;CakeContribGuidelinesIconOmitImport&gt;True&lt;/CakeContribGuidelinesIconOmitImport&gt;
163+
&lt;PackageIcon&gt;logo.png&lt;/PackageIcon&gt;
172164
&lt;/PropertyGroup&gt;
173165
&lt;ItemGroup&gt;
174-
&lt;None Include=&quot;$(CakeContribGuidelinesIconDestinationLocation)&quot;&gt;
175-
&lt;Pack&gt;True&lt;/Pack&gt;
176-
&lt;PackagePath&gt;&lt;/PackagePath&gt;
177-
&lt;/None&gt;
166+
&lt;None Include=&quot;icons/logo.png&quot; Pack=&quot;True&quot; PackagePath=&quot;&quot; /&gt;
178167
&lt;/ItemGroup&gt;
179168
</code></pre>
180169
<h2 id="migrating-from-an-existing-project">Migrating from an existing project</h2>
170+
<p>No steps are needed anymore. Existing settings will be detected and honored.</p>
171+
<p>Optionally:</p>
181172
<ul>
182173
<li>remove the existing icon</li>
183174
<li>remove the <code>Include</code> of the icon from the project-file</li>
184-
<li>add a reference to CakeContrib.Guidelines</li>
185-
<li>build the project</li>
186-
<li>set <code>PackageIcon</code> to <code>icon.png</code></li>
175+
<li>remove the <code>PackageIcon</code> from the project-file</li>
176+
<li>remove the <code>PackageIconUrl</code> from the project-file</li>
187177
</ul>
188178

189179
</section>

rules/ccg0001.html

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,8 @@ <h2 id="description">Description</h2>
127127
<p>The guideline <a href="../guidelines/CakeContribIcon">CakeContrib-Icon</a> states, that the icon should be embedded.
128128
To that end, setting <code>PackageIcon</code> is required.</p>
129129
<h2 id="how-to-fix-violations">How to fix violations</h2>
130-
<p>Add</p>
131-
<pre><code class="language-xml">&lt;PropertyGroup&gt;
132-
&lt;PackageIcon&gt;$(CakeContribGuidelinesIconDestinationLocation)&lt;/PackageIcon&gt;
133-
&lt;/PropertyGroup&gt;
134-
</code></pre>
135-
<p>to the project.</p>
130+
<p>This error will only show, if <code>CakeContribGuidelinesIconOmitImport</code> is <code>True</code> and no manual include of the icon was done.</p>
131+
<p>To fix this error, you need to remove the definition of <code>CakeContribGuidelinesIconOmitImport</code> or define a <code>PackageIcon</code> manually.</p>
136132
<h2 id="related-guidelines">Related guidelines</h2>
137133
<ul>
138134
<li><a href="../guidelines/CakeContribIcon">CakeContrib-Icon</a></li>

rules/ccg0003.html

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ <h1>CCG0003</h1>
109109
</section>
110110
<section class="content">
111111
<blockquote class="blockquote">
112-
<p>PackageIcon points to wrong place</p>
112+
<p>The PackageIcon source (path/to/icon.jpeg) has an extension of jpeg. It can not be set from the CakeContrib-Icon.</p>
113113
</blockquote>
114114
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
115115
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
@@ -122,12 +122,21 @@ <h2 id="table-of-contents">Table of Contents</h2>
122122
</ul>
123123
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
124124
<h2 id="cause">Cause</h2>
125-
<p>This warning is raised, when <code>PackageIcon</code> does not point to the copied icon.
126-
(I.e. <code>PackageIcon</code> is not equal to <code>$(CakeContribGuidelinesIconDestinationLocation)</code>)</p>
125+
<p>This warning/error is raised, when the source of <code>PackageIcon</code> was outdated
126+
but could not be updated.</p>
127127
<h2 id="description">Description</h2>
128-
<p>Since the correct icon is copied to <code>$(CakeContribGuidelinesIconDestinationLocation)</code> it is expected, that this icon is packaged into the nupkg.</p>
128+
<p>The default package icon is a <code>png</code> and will be used to update outdated icons.
129+
If a different icon format than <code>png</code> is used, simply updating that icon with a
130+
<code>png</code> content will break the icon.</p>
131+
<p>If a <code>PackageIcon</code> is set, but no corresponding icon reference could be
132+
found, a reference should be added automatically. However, if <code>PackageIcon</code>
133+
is not set to a <code>png</code> file, such reference would not be possible.
134+
In this case <code>CCG0003</code> is an error and will break the build.</p>
135+
<p>If a <code>PackageIcon</code> is set with a corresponding icon reference but not to
136+
a <code>png</code> file, a test whether the icon is up-to-date is not possible.
137+
In this case <code>CCG0003</code> is a warning .</p>
129138
<h2 id="how-to-fix-violations">How to fix violations</h2>
130-
<p>Modify <code>PackageIcon</code> to point to the same place as <code>$(CakeContribGuidelinesIconDestinationLocation)</code>.</p>
139+
<p>Modify <code>PackageIcon</code> to point to a <code>png</code> file or remove the custom file entirely.</p>
131140
<h2 id="related-guidelines">Related guidelines</h2>
132141
<ul>
133142
<li><a href="../guidelines/CakeContribIcon">CakeContrib-Icon</a></li>

rules/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ <h1>Rules</h1>
127127
<tr>
128128
<td><strong><a href="/CakeContrib.Guidelines/rules/ccg0003">CCG0003</a></strong></td>
129129
<td>
130-
PackageIcon points to wrong place </td>
130+
PackageIcon can not be updated </td>
131131
</tr>
132132
<tr>
133133
<td><strong><a href="/CakeContrib.Guidelines/rules/ccg0004">CCG0004</a></strong></td>

0 commit comments

Comments
 (0)