Skip to content

Commit 71ad377

Browse files
authored
Merge pull request #107 from cake-contrib/feature/GH-80
(GH-80) existing icons will be honored
2 parents 0d4670f + a5d451d commit 71ad377

34 files changed

+1143
-153
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
1414
strategy:
1515
matrix:
16-
os: [windows-latest, ubuntu-latest, macos-latest]
16+
os: [ ubuntu-18.04, windows-2019, macos-10.15 ]
1717

1818
steps:
19-
- uses: actions/checkout@v2.3.4
19+
- uses: actions/checkout@v2
2020
with:
2121
fetch-depth: 0
2222
ref: ${{ github.event.ref }}
@@ -31,7 +31,7 @@ jobs:
3131
script-path: recipe.cake
3232
target: CI
3333
verbosity: Diagnostic
34-
cake-version: 0.38.4
34+
cake-version: 0.38.5
3535
cake-bootstrap: true
3636
# currently, Cake.Recipe does not upload artifacts when run on gh-actions
3737
- name: Upload Issues
@@ -44,7 +44,7 @@ jobs:
4444
BuildArtifacts/**/coverlet/*.xml
4545
- name: Upload Packages
4646
uses: actions/upload-artifact@v2
47-
if: matrix.os == 'windows-latest'
47+
if: runner.os == 'Windows'
4848
with:
4949
if-no-files-found: warn
5050
name: package

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
jobs:
1818
analyze:
1919
name: Analyze
20-
runs-on: ubuntu-latest
20+
runs-on: ubuntu-18.04
2121

2222
strategy:
2323
fail-fast: false
@@ -30,7 +30,7 @@ jobs:
3030

3131
steps:
3232
- name: Checkout repository
33-
uses: actions/checkout@v2.3.4
33+
uses: actions/checkout@v2
3434
with:
3535
fetch-depth: 0
3636

@@ -49,7 +49,7 @@ jobs:
4949
# Prefix the list here with "+" to use these queries and those in the config file.
5050
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5151

52-
- run: ./build.ps1
52+
- run: ./build.ps1 --target=DotNetCore-Build
5353
shell: pwsh
5454

5555
- name: Perform CodeQL Analysis

.github/workflows/publishDocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
steps:
1717
- name: checkout
18-
uses: actions/checkout@v2.3.4 #https://github.com/actions/checkout
18+
uses: actions/checkout@v2
1919
with:
2020
fetch-depth: 0 # GitVersion is somewhat irritated when fetch-depth is "1"....
2121
ref: ${{ github.event.ref }}

.github/workflows/updateToc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v2.3.4
16+
- uses: actions/checkout@v2
1717
with:
1818
fetch-depth: 0
1919
ref: ${{ github.event.ref }}

build.sh

100644100755
File mode changed.

docs/input/guidelines/CakeContribIcon.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Title: CakeContrib-Icon
1111
- [Related rules](#related-rules)
1212
- [Usage](#usage)
1313
- [Settings](#settings)
14-
- [Icon-Location](#icon-location)
1514
- [Icon include in project](#icon-include-in-project)
1615
- [Migrating from an existing project](#migrating-from-an-existing-project)
1716

@@ -34,21 +33,22 @@ Title: CakeContrib-Icon
3433
Using this package automatically enables this guideline.
3534

3635
With no special settings at all (i.e. "The Standard"):
37-
* the current cake-contrib icon will be copied as "icon.png" in the project-directory
38-
* the icon will be included in the project
36+
* if no `PackageIcon` property is specified, a default will be assigned.
37+
* if no icon (matching the `PackageIcon` property) is referenced in the project, a default will be referenced.
38+
* if the referenced icon is not binary equal to the default icon, it will be updated.
39+
* if no `PackageIconUrl` property is specified, a default will be assigned.
3940

4041
## Settings
4142

42-
### Icon-Location
43-
<?! Include "../settings/fragments/IconDestinationLocation.md" /?>
44-
4543
### Icon include in project
4644
<?! Include "../settings/fragments/IconOmitImport.md" /?>
4745

4846
## Migrating from an existing project
4947

48+
No steps are needed anymore. Existing settings will be detected and honored.
49+
50+
Optionally:
5051
* remove the existing icon
5152
* remove the `Include` of the icon from the project-file
52-
* add a reference to CakeContrib.Guidelines
53-
* build the project
54-
* set `PackageIcon` to `icon.png`
53+
* remove the `PackageIcon` from the project-file
54+
* remove the `PackageIconUrl` from the project-file

docs/input/rules/ccg0001.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,9 @@ To that end, setting `PackageIcon` is required.
2828

2929
## How to fix violations
3030

31-
Add
31+
This error will only show, if `CakeContribGuidelinesIconOmitImport` is `True` and no manual include of the icon was done.
3232

33-
```xml
34-
<PropertyGroup>
35-
<PackageIcon>$(CakeContribGuidelinesIconDestinationLocation)</PackageIcon>
36-
</PropertyGroup>
37-
```
38-
39-
to the project.
33+
To fix this error, you need to remove the definition of `CakeContribGuidelinesIconOmitImport` or define a `PackageIcon` manually.
4034

4135
## Related guidelines
4236

docs/input/rules/ccg0003.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
Order: 3
33
Title: CCG0003
4-
Description: PackageIcon points to wrong place
4+
Description: PackageIcon can not be updated
55
---
66

7-
> PackageIcon points to wrong place
7+
> The PackageIcon source (path/to/icon.jpeg) has an extension of jpeg. It can not be set from the CakeContrib-Icon.
88
99
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
1010
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
@@ -19,16 +19,27 @@ Description: PackageIcon points to wrong place
1919

2020
## Cause
2121

22-
This warning is raised, when `PackageIcon` does not point to the copied icon.
23-
(I.e. `PackageIcon` is not equal to `$(CakeContribGuidelinesIconDestinationLocation)`)
22+
This warning/error is raised, when the source of `PackageIcon` was outdated
23+
but could not be updated.
2424

2525
## Description
2626

27-
Since the correct icon is copied to `$(CakeContribGuidelinesIconDestinationLocation)` it is expected, that this icon is packaged into the nupkg.
27+
The default package icon is a `png` and will be used to update outdated icons.
28+
If a different icon format than `png` is used, simply updating that icon with a
29+
`png` content will break the icon.
30+
31+
If a `PackageIcon` is set, but no corresponding icon reference could be
32+
found, a reference should be added automatically. However, if `PackageIcon`
33+
is not set to a `png` file, such reference would not be possible.
34+
In this case `CCG0003` is an error and will break the build.
35+
36+
If a `PackageIcon` is set with a corresponding icon reference but not to
37+
a `png` file, a test whether the icon is up-to-date is not possible.
38+
In this case `CCG0003` is a warning .
2839

2940
## How to fix violations
3041

31-
Modify `PackageIcon` to point to the same place as `$(CakeContribGuidelinesIconDestinationLocation)`.
42+
Modify `PackageIcon` to point to a `png` file or remove the custom file entirely.
3243

3344
## Related guidelines
3445

docs/input/settings/fragments/IconDestinationLocation.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

docs/input/settings/fragments/IconOmitImport.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,17 @@
55

66
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
77

8-
The cake-contrib icon will be automatically included in the project, unless `CakeContribGuidelinesIconOmitImport` was defined.
8+
The cake-contrib icon will be automatically included in the project, unless
9+
`CakeContribGuidelinesIconOmitImport` is set to `True`.
910

1011
To to use a "custom" import the following could be used:
1112

1213
```xml
1314
<PropertyGroup>
14-
<CakeContribGuidelinesIconOmitImport>1</CakeContribGuidelinesIconOmitImport>
15+
<CakeContribGuidelinesIconOmitImport>True</CakeContribGuidelinesIconOmitImport>
16+
<PackageIcon>logo.png</PackageIcon>
1517
</PropertyGroup>
1618
<ItemGroup>
17-
<None Include="$(CakeContribGuidelinesIconDestinationLocation)">
18-
<Pack>True</Pack>
19-
<PackagePath></PackagePath>
20-
</None>
19+
<None Include="icons/logo.png" Pack="True" PackagePath="" />
2120
</ItemGroup>
2221
```

0 commit comments

Comments
 (0)