Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
os: [ ubuntu-18.04, windows-2019, macos-10.15 ]

steps:
- uses: actions/checkout@v2.3.4
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.ref }}
Expand All @@ -31,7 +31,7 @@ jobs:
script-path: recipe.cake
target: CI
verbosity: Diagnostic
cake-version: 0.38.4
cake-version: 0.38.5
cake-bootstrap: true
# currently, Cake.Recipe does not upload artifacts when run on gh-actions
- name: Upload Issues
Expand All @@ -44,7 +44,7 @@ jobs:
BuildArtifacts/**/coverlet/*.xml
- name: Upload Packages
uses: actions/upload-artifact@v2
if: matrix.os == 'windows-latest'
if: runner.os == 'Windows'
with:
if-no-files-found: warn
name: package
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
runs-on: ubuntu-18.04

strategy:
fail-fast: false
Expand All @@ -30,7 +30,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2
with:
fetch-depth: 0

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

- run: ./build.ps1
- run: ./build.ps1 --target=DotNetCore-Build
shell: pwsh

- name: Perform CodeQL Analysis
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publishDocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@v2.3.4 #https://github.com/actions/checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # GitVersion is somewhat irritated when fetch-depth is "1"....
ref: ${{ github.event.ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/updateToc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2.3.4
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.ref }}
Expand Down
Empty file modified build.sh
100644 → 100755
Empty file.
18 changes: 9 additions & 9 deletions docs/input/guidelines/CakeContribIcon.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Title: CakeContrib-Icon
- [Related rules](#related-rules)
- [Usage](#usage)
- [Settings](#settings)
- [Icon-Location](#icon-location)
- [Icon include in project](#icon-include-in-project)
- [Migrating from an existing project](#migrating-from-an-existing-project)

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

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

## Settings

### Icon-Location
<?! Include "../settings/fragments/IconDestinationLocation.md" /?>

### Icon include in project
<?! Include "../settings/fragments/IconOmitImport.md" /?>

## Migrating from an existing project

No steps are needed anymore. Existing settings will be detected and honored.

Optionally:
* remove the existing icon
* remove the `Include` of the icon from the project-file
* add a reference to CakeContrib.Guidelines
* build the project
* set `PackageIcon` to `icon.png`
* remove the `PackageIcon` from the project-file
* remove the `PackageIconUrl` from the project-file
10 changes: 2 additions & 8 deletions docs/input/rules/ccg0001.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,9 @@ To that end, setting `PackageIcon` is required.

## How to fix violations

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

```xml
<PropertyGroup>
<PackageIcon>$(CakeContribGuidelinesIconDestinationLocation)</PackageIcon>
</PropertyGroup>
```

to the project.
To fix this error, you need to remove the definition of `CakeContribGuidelinesIconOmitImport` or define a `PackageIcon` manually.

## Related guidelines

Expand Down
23 changes: 17 additions & 6 deletions docs/input/rules/ccg0003.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
Order: 3
Title: CCG0003
Description: PackageIcon points to wrong place
Description: PackageIcon can not be updated
---

> PackageIcon points to wrong place
> The PackageIcon source (path/to/icon.jpeg) has an extension of jpeg. It can not be set from the CakeContrib-Icon.

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
Expand All @@ -19,16 +19,27 @@ Description: PackageIcon points to wrong place

## Cause

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

## Description

Since the correct icon is copied to `$(CakeContribGuidelinesIconDestinationLocation)` it is expected, that this icon is packaged into the nupkg.
The default package icon is a `png` and will be used to update outdated icons.
If a different icon format than `png` is used, simply updating that icon with a
`png` content will break the icon.

If a `PackageIcon` is set, but no corresponding icon reference could be
found, a reference should be added automatically. However, if `PackageIcon`
is not set to a `png` file, such reference would not be possible.
In this case `CCG0003` is an error and will break the build.

If a `PackageIcon` is set with a corresponding icon reference but not to
a `png` file, a test whether the icon is up-to-date is not possible.
In this case `CCG0003` is a warning .

## How to fix violations

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

## Related guidelines

Expand Down
18 changes: 0 additions & 18 deletions docs/input/settings/fragments/IconDestinationLocation.md

This file was deleted.

11 changes: 5 additions & 6 deletions docs/input/settings/fragments/IconOmitImport.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@

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

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

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

```xml
<PropertyGroup>
<CakeContribGuidelinesIconOmitImport>1</CakeContribGuidelinesIconOmitImport>
<CakeContribGuidelinesIconOmitImport>True</CakeContribGuidelinesIconOmitImport>
<PackageIcon>logo.png</PackageIcon>
</PropertyGroup>
<ItemGroup>
<None Include="$(CakeContribGuidelinesIconDestinationLocation)">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
<None Include="icons/logo.png" Pack="True" PackagePath="" />
</ItemGroup>
```
4 changes: 0 additions & 4 deletions docs/input/settings/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ NoSidebar: true
- [General](#general)
- [ProjectType](#projecttype)
- [Icons](#icons)
- [IconDestinationLocation](#icondestinationlocation)
- [IconOmitImport](#iconomitimport)
- [Opt-Out](#opt-out)
- [OmitRecommendedConfigFile](#omitrecommendedconfigfile)
Expand Down Expand Up @@ -41,9 +40,6 @@ different values than `addin` or `module` might yield unexpected results.

## Icons

### IconDestinationLocation
<?! Include "./fragments/IconDestinationLocation.md" /?>

### IconOmitImport
<?! Include "./fragments/IconOmitImport.md" /?>

Expand Down
2 changes: 0 additions & 2 deletions src/Guidelines/build/CakeContrib.Guidelines.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@
<UsingTask
TaskName="$(CakeContribGuidelinesCustomTasksNamespace).CcgLogWarning"
AssemblyFile="$(CakeContribGuidelinesCustomTasksAssembly)" />

<Import Project="$(MSBuildThisFileDirectory)Icon.props" />
</Project>
20 changes: 0 additions & 20 deletions src/Guidelines/build/Icon.props

This file was deleted.

92 changes: 51 additions & 41 deletions src/Guidelines/build/Icon.targets
Original file line number Diff line number Diff line change
@@ -1,44 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
Always copy/replace the icon.png
There is no opt-out of this feature, as the opt-out is removing the reference to CakeContrib.Guidelines
-->
<Target Name="_CopyCakeContribGuidelinesIcon" AfterTargets="BeforeBuild" BeforeTargets="CoreBuild">
<Copy
SourceFiles="$(MSBuildThisFileDirectory)/../images/icon.png"
DestinationFiles="$(MSBuildProjectDirectory)/$(CakeContribGuidelinesIconDestinationLocation)" />
<Message
Importance="normal"
Text="Copied cake-contrib icon to $(MSBuildProjectDirectory)/$(CakeContribGuidelinesIconDestinationLocation)" />
<Message
Condition="$(CakeContribGuidelinesIconOmitImport) != ''"
Importance="normal"
Text="CakeContribGuidelinesIconOmitImport is set, so icon-include will be omitted" />

<!-- check PackageIcon -->
<Message
Importance="low"
Text="PackageIcon is set to $(PackageIcon)" />
<CcgLogError
Condition="$(PackageIcon) == ''"
CcgId="1"
File="$(MSBuildProjectFullPath)"
Text="PackageIcon is empty. Since you're using CakeContrib.Guidelines the PackageIcon should be set." />
<CcgLogWarning
Condition="$(PackageIcon) != '$(CakeContribGuidelinesIconDestinationLocation)'"
CcgId="3"
File="$(MSBuildProjectFullPath)"
Text="PackageIcon should point to $(CakeContribGuidelinesIconDestinationLocation)." />

<!-- check PackageIconUrl -->
<Message
Importance="low"
Text="PackageIconUrl is set to $(PackageIconUrl)" />
<CcgLogWarning
Condition="$(PackageIconUrl) == ''"
CcgId="2"
File="$(MSBuildProjectFullPath)"
Text="PackageIconUrl is empty. For compatibility it should be set." />

<UsingTask
TaskName="$(CakeContribGuidelinesCustomTasksNamespace).EnsureCakeContribIcon"
AssemblyFile="$(CakeContribGuidelinesCustomTasksAssembly)" />
<UsingTask
TaskName="$(CakeContribGuidelinesCustomTasksNamespace).EnsureCakeContribIconUrl"
AssemblyFile="$(CakeContribGuidelinesCustomTasksAssembly)" />

<Target Name="_EnsureCakeContribGuidelinesIcon"
AfterTargets="BeforeBuild"
BeforeTargets="CoreBuild;SetNuspecProperties;GenerateNuspec;_GetPackageFiles">
<EnsureCakeContribIcon
ProjectFile="$(MSBuildProjectFullPath)"
PackageIcon="$(PackageIcon)"
NoneReferences="@(None)"
CakeContribIconPath="$(MSBuildThisFileDirectory)/../images/icon.png"
OmitIconImport="$(CakeContribGuidelinesIconOmitImport)">
<Output PropertyName="TempPackageIcon" TaskParameter="PackageIconOutput" />
<Output ItemName="TempNone" TaskParameter="AdditionalNoneRefOutput" />
</EnsureCakeContribIcon>

<CreateProperty
Condition="$(TempPackageIcon) != ''"
Value="$(TempPackageIcon)">
<Output
TaskParameter="Value"
PropertyName="PackageIcon" />
</CreateProperty>
<CreateItem
Condition="@(TempNone) != ''"
Include="@(TempNone)">
<Output
TaskParameter="Include"
ItemName="None" />
</CreateItem>

<EnsureCakeContribIconUrl
ProjectFile="$(MSBuildProjectFullPath)"
PackageIconUrl="$(PackageIconUrl)"
OmitIconImport="$(CakeContribGuidelinesIconOmitImport)"
CakeContribIconUrl="https://cdn.jsdelivr.net/gh/cake-contrib/graphics/png/cake-contrib-medium.png">
<Output PropertyName="TempPackageIconUrl" TaskParameter="PackageIconUrlOutput" />
</EnsureCakeContribIconUrl>
<CreateProperty
Condition="$(TempPackageIconUrl) != ''"
Value="$(TempPackageIconUrl)">
<Output
TaskParameter="Value"
PropertyName="PackageIconUrl" />
</CreateProperty>
</Target>
</Project>
</Project>
1 change: 1 addition & 0 deletions src/Guidelines/build/TargetFrameworkVersions.targets
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<!-- All other rules have some "configuration" here, this rules required/suggested targets are hard-coded in the task. Sadly. -->

<TargetFrameworkVersions
ProjectFile="$(MSBuildProjectFullPath)"
References="@(PackageReference)"
TargetFramework="$(TargetFramework)"
TargetFrameworks="$(TargetFrameworks)"
Expand Down
13 changes: 6 additions & 7 deletions src/Guidelines/content/readme.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
Thanks for installing CakeContrib.Guidelines.

Currently your Visual Studio might show the icon.png as missing (with a red "x").
This is due to the fact, that is not actually there. It will, however be copied upon build.
MIGRATING FROM A PREVIOUS VERSION?
We've eliminated the need to have a project-local copy of
the Cake-Contrib icon.

WHAT YOU HAVE TO DO:

Once you have built the project the "icon.png" will exist. After that open
project-properties -> Package -> IconFile and input "icon.png"
You can - if you like - remove the <PackageIcon> and <PackageIconUrl>
tags from the csproj, as well as the local copy of the icon.

Is there more?
Yes. Read the docs at https://github.com/cake-contrib/CakeContrib.Guidelines/
Yes. Read the docs at https://github.com/cake-contrib/CakeContrib.Guidelines/
Loading