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

Target Cake.Tool #152

Closed
RLittlesII opened this issue Sep 13, 2017 · 16 comments
Closed

Target Cake.Tool #152

RLittlesII opened this issue Sep 13, 2017 · 16 comments
Milestone

Comments

@RLittlesII
Copy link
Contributor

So that Cake.Recipe can load all addins from Cake CoreCLR runner.

@AdmiringWorm
Copy link
Member

@RLittlesII I don't think that would be possible right now.
From what I gather, not every addin that Cake.Recipe uses supports .NET Core yet, and some of them (if I remember correctly), is somewhat of a core feature of the Recipe.

@RLittlesII
Copy link
Contributor Author

@AdmiringWorm It isn't possible right now. I have been working on an initiative to port all the dependencies to netstandard1.6. This issue is part of that project. I am close now, I just need to kick the tires on a few addins to make sure the conversion didn't break anything.

@gep13 gep13 added this to the 2.0.0 milestone Sep 9, 2019
@gep13
Copy link
Member

gep13 commented Sep 9, 2019

@RLittlesII @AdmiringWorm if we go ahead with this, guidance would likely be to use Cake.Tool, rather than CoreCLR, but I think we should still try to be able to do this.

@RLittlesII
Copy link
Contributor Author

@gep13 Correct me if I am wrong. The difference between CoreCLR and Cake.Tool is just the mechanism by which is packaged and delivered? It's still technically the dotnet version of Cake not the .NET Framework version. Correct?

So we are saying that we would only be able to access this through dotnet cake ?

@devlead
Copy link
Member

devlead commented Sep 9, 2019

@RLittlesII Essentially yes, also Cake.CoreCLR is .NET Core 2, Cake.Tool is NET Core 2.1 (soon also 3.0).

If it works with Cake.Tool then it should work with Cake and Cake.CoreCLR too.
But recommendation would be Cake.Tool.

@gep13 gep13 changed the title Target Cake CoreCLR Target Cake.Tool Sep 19, 2019
@gep13
Copy link
Member

gep13 commented Jul 8, 2020

Before we are going to be able to do this, we need to figure out how to fix this:

cake-contrib/Cake.Issues.Reporting.Generic#3

@AdmiringWorm
Copy link
Member

@gep13
Before we are going to be able to do this, we need to figure out how to fix this:

or conditionally disable the reporting functionality (of course this means not loading Cake.Issues recipe as well).

@gep13
Copy link
Member

gep13 commented Jul 9, 2020

Yes, that would be an option if we could conditionally load adding into the running process, but as it stands, that still isn’t possible. We could try to do something “clever” by making the addin directive itself conditional, but I really don’t like that approach. The contributor who was working on getting RazorLight working has at least responded, so it isn’t a complete dead end, so hopefully that addin will be updated soon.

@gep13 gep13 removed this from the 2.0.0 milestone Jul 9, 2020
@AdmiringWorm
Copy link
Member

AdmiringWorm commented Jul 11, 2020

Yeah, did some experiments with conditionally loading Cake.Issues.Recipe by trying to use pre-processor if/else statements that I assumed would have been available with Cake 0.35.0.

Unfortunately, this was not honored, and it would still load Cake.Issues.Recipe.
EDIT: Or at least, I couldn't figure out how.

@gep13
Copy link
Member

gep13 commented Jul 11, 2020

I believe I am right in saying that those if/else statements are outside of the pre-processor logic within Cake, but @patriksvensson @devlead @mholo65 might be able to confirm this. So although a good idea, I don't think that is a route that we can go down 😢

@devlead
Copy link
Member

devlead commented Jul 11, 2020

If else statements are processed in Roslyn after preprocessor statements are processed. They work on a C# level.

Something you could utilize is environment variables which are expanded before directive is processed. So you could switch which version is loaded, even which addin is executed, etc.

https://github.com/cake-build/cake/blob/daa3c4f26a5d54cbb8c0b65301eca098d2703f01/tests/integration/Cake.Core/Scripting/LoadDirective.cake#L2

@bjorkstromm
Copy link
Member

Yes, that's correct. Preprocessor logic is not aware of defines. See issue cake-build/cake#1860

@gep13
Copy link
Member

gep13 commented Jul 11, 2020

@devlead @mholo65 thank you both for the confirmation, this is what I thought.

@pascalberger
Copy link
Member

@gep13
Before we are going to be able to do this, we need to figure out how to fix this:

or conditionally disable the reporting functionality (of course this means not loading Cake.Issues recipe as well).

If someone get conditional loading to work, we should not implement it here, but upstream in Cake.Issues.Recipe.

Beside having the option to toggle individual features, it would also make sense to only load build server integration if running under the specific build server or only loading issue providers which actually are an input file passed.

This is cake-contrib/Cake.Issues.Recipe#17.

@gep13
Copy link
Member

gep13 commented Jul 11, 2020

@pascalberger thats a fair point!

@gep13 gep13 added this to the 2.0.0 milestone Aug 3, 2020
gep13 added a commit that referenced this issue Aug 3, 2020
This should allow execution of Cake.Recipe using Cake .Net Global Tool.
@gep13
Copy link
Member

gep13 commented Aug 4, 2020

I am going to go ahead and close this issue out, as I believe we have got most of this figured out. There might be some additional points that come up related to this, but the guts of the work has been completed, and tested and known to work.

@gep13 gep13 closed this as completed Aug 4, 2020
gep13 added a commit that referenced this issue Aug 7, 2020
Rather than using loaddependencies, which is causing problems when
running on a Mac.
gep13 added a commit that referenced this issue Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants