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

Make the task detection independent of build.cake position #30

Closed
pitermarx opened this issue Sep 26, 2016 · 9 comments
Closed

Make the task detection independent of build.cake position #30

pitermarx opened this issue Sep 26, 2016 · 9 comments
Assignees
Labels

Comments

@pitermarx
Copy link

It seems to me that build.cake cannot be on a sibiling path of the solution, but only on a parent path.

With
\git\MyProject\src\MySolution.sln
\git\MyProject\BuildScripts\build.cake
The tasks are not detected

When i moved to
\git\MyProject\build.cake
it was detected

@agc93 agc93 self-assigned this Sep 26, 2016
@agc93 agc93 added the Bug label Sep 26, 2016
@agc93
Copy link
Member

agc93 commented Oct 6, 2016

Unfortunately, this is a limitation in Visual Studio.

VS looks for the "config file" for Task Runners (in our case, that's your build.cake file), in the project root folder, then traverses upwards to find it. Scripts in subfolders, or folders outside that "chain" won't be found, but we unfortunately can't change this.

One workaround is that, when 0.2.0 is released, the task runner will support nested Cake files (using the #load directive), so you could put a single build.cake file in \git\MyProject\build.cake (to use your example), and #load in any scripts from the BuildScripts folder, and they should still appear and be usable from the task runner.

@gep13
Copy link
Member

gep13 commented Oct 6, 2016

Conversation where this was discussed: https://gitter.im/Microsoft/extendvs?at=57f52e3729403a416fcb7cbe

@pitermarx
Copy link
Author

I understand. That's sad though.
As far as I am concerned, you can close this when 0.2.0 is released

@nnyegaard
Copy link

nnyegaard commented Oct 12, 2016

It seems that the task runner can't detect the task in the cake file even though it is in root.

I have a ASP.NET Core app with paths:
root\src
root\test
root\Api.sln
\root\build.cake

And the task runner detects the cake file, but it does not show any tasks

@gep13
Copy link
Member

gep13 commented Oct 12, 2016

@nnyegaard is this a public repo that we can take a look at? If so, where is it?

Also, is that a typo in your comment? You have cake.build rather than build.cake.

@nnyegaard
Copy link

Yes sorry build.cake.

I have published the repo here: https://github.com/nnyegaard/cakebuild

@agc93
Copy link
Member

agc93 commented Oct 12, 2016

@nnyegaard I can see the tasks showing up when I open that repo. For the tasks to be loaded, you either a) need to have run the bootstrapper at least once or b) have Cake.exe available on your PATH.

Do you have your tools/addins installed in a custom directory for that solution?

screenshot 85

@nnyegaard
Copy link

nnyegaard commented Oct 12, 2016

I had yet to run the bootstrapper (build.ps1), but after I did, I got the tasks.

Thanks a lot guys!

@gep13
Copy link
Member

gep13 commented Dec 15, 2020

I have just read through the discussion here, and I believe that this issue can now be closed.

If this isn't the case, then please comment again.

@gep13 gep13 closed this as completed Dec 15, 2020
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

4 participants