-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rule to suggest
using a global variable for supported cake version
#79
Comments
We need to be careful. If we make a suggestion for guidelines for Cake-Contrib addins, this won't be something which we can use for documentation, as there are a lot of addins which are not part of cake-contrib. But detection of target Cake version is something which we already have implemented in addin discoverer and website (through reference). |
I understand. I am not suggestion it should be part of the guidelines itself though, but more of an informational suggestion to the addin developer, especially if the cake version is used in several places (like in the PackageReference and the description).
Correct me if I am wrong, but I believe the addin discoverer detects the Cake version by directly parsing the csproj file, so if a variable is being used it may not detect the correct version specified (I do not know about the website though). |
There was a time when the addin discoverer indeed parsed .csproj to detect the referenced version of Cake.Core and Cake.Common but it's no longer the case (the logic changed some time during the summer of 2018 if I remember correctly). The currently logic is to use reflection on the addin assembly and inspect the referenced assemblies. |
@AdmiringWorm The issue with having a specific version hard-coded inside of the addin is that it doesn't age well when new versions of Cake are released. For example, your Cake.Transifex addin referencing Cake.Core v1.0.0 is likely to be compatible with a future Cake v1.8.6 without having to do a new release to target the newer API unless you need to. On the website we already handle compatibility ranges for you based on the Cake reference that your addin has and we show it to the user - and this is updated as Cake versions are released. |
While I can certainly test for the existence of such a variable, I'm not sure I could detect it's usage (not easily, anyways..) |
for cake.core, cake.common and cake.testing
(GH-79) suggest using the same cake versions
I would like to suggest to add a new rule suggestion (not a warning) to recommend users to use a global variable with the version of cake being targeted/supported.
This variable could then be re-used in the documentation, and for the PackageReference to Cake.Core.
As an example, see my commit here: cake-contrib/Cake.Transifex@31ded53
If it gets added, it may be something that needs to be done in conjunction with the project @Jericho is working on/maintaining.
The text was updated successfully, but these errors were encountered: