Skip to content
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

Consider using a custom package type for addins / modules #66

Open
pascalberger opened this issue Mar 20, 2020 · 1 comment
Open

Consider using a custom package type for addins / modules #66

pascalberger opened this issue Mar 20, 2020 · 1 comment
Labels

Comments

@pascalberger
Copy link
Member

We should consider using a custom package type for Cake addins, modules and recipes.

This could help in discovery of these packages from nuget.org.

@augustoproiete
Copy link
Member

TL;DR;

Custom package types work well with Cake build scripts, but with Frosting it would impose limitations in the way a package can be installed. Namely, it's not possible to install packages with custom types via the Visual Studio User Interface... (it only works if you edit the .csproj manually yourself and type/paste a <PackageReference ... />.

For now we've decided to propose a feature request to the NuGet team which would allow the installation of NuGet packages with custom types on Frosting projects without limitations, and revisit this issue in the future.


Long version

As as proof-of-concept I created three NuGet packages and published to nuget.org:

Package ID Description Package Type
📦 Cake.PackageType.Addin Sample Cake addin with Hello aliases CakeAddin
📦 Cake.PackageType.Module Sample Cake module with a hello scheme for the #tool directive CakeModule
📦 Cake.PackageType.Recipe Sample Cake recipe with a couple of helper methods CakeRecipe

The source code of the packages above is available on here.


Test Results

Test Result
List packages via NuGet Gallery Works as expected / No difference in behavior
List packages via VS NuGet Package Manager UI Works as expected / No difference in behavior
List packages via NuGet API Works as expected / No difference in behavior
List packages via NuGet.exe Works as expected / No difference in behavior
Cake script: Use addin in a Cake build script Works as expected / No difference in behavior
Cake script: Use module in a Cake build script Works as expected / No difference in behavior
Cake script: Use recipe in a Cake build script Works as expected / No difference in behavior
Frosting: Add package to .csproj via PackageReference Works as expected / No difference in behavior
Frosting: Add package to .csproj via dotnet add package Works as expected / No difference in behavior
Frosting: Add package to .csproj via VS Package Manager UI Error / package type not supported
Frosting: Add package to .csproj via Install-Package from VS Error / package type not supported

Screenshots

Visual Studio NuGet Package Manager UI

image

Error messages in the failed tests

image

image

image

Conclusion

For now we've decided to propose a feature request to the NuGet team which would allow the installation of NuGet packages with custom types on Frosting projects without limitations, and revisit this issue in the future.

N.B.: Given that the limitation is only with Frosting, if we wanted to start using custom package types for Recipes today, we could.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants