You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched issues to ensure it has not already been reported
Cake runner
Cake .NET Tool
Cake version
2.3.0
Operating system
Windows
Operating system architecture
64-Bit
CI Server
No response
What are you seeing?
I'm experimenting a bit with multi-layered cake files
Currently working on putting all the base building/testing in a single cake file, and use that for more specific packing tasks in other files
Running inhertiance between the setuped implementation and an abstract base class in the base cake file gives the following error
An error occurred when executing task 'Build'.
Error: The context data has not been setup.
That seems to indicate that it doesn't consider or support reading context data based on inherited classes?
What is expected?
To be able to use data in a base class, in Does calls typed to the baseclass
Steps to Reproduce
Base.cake file:
internal abstract class BaseCake
{
public FilePath SolutionFile { get; set; }
}
var buildTask = Task("Build")
.Does<BaseCake>(bc =>
{
var settings = new DotNetBuildSettings
{
Configuration = "Debug"
};
DotNetBuild(bc.SolutionFile.FullPath, settings);
});
Pacakge.cake
#load Base.cake
internal class PackageCake : BaseCake
{
}
Setup<PackageCake>(ctx => {
var pc = new PackageCake(); //code
return pc;
});
var packTask = Task("Pack")
.IsDependentOn(buildTask)
.Does<PackageCake>(pc =>
{
//code
});
This will casue the Package.cake to fail with
An error occurred when executing task 'Build'.
Error: The context data has not been setup.
Output log
No response
The text was updated successfully, but these errors were encountered:
This is by design, you can register multiple types by running Setup multiple with different types, if base type was registered this wouldn't be possible.
But you could opt-in to register your base type, i.e. something like below
Prerequisites
Cake runner
Cake .NET Tool
Cake version
2.3.0
Operating system
Windows
Operating system architecture
64-Bit
CI Server
No response
What are you seeing?
I'm experimenting a bit with multi-layered cake files
Currently working on putting all the base building/testing in a single cake file, and use that for more specific packing tasks in other files
Running inhertiance between the setuped implementation and an abstract base class in the base cake file gives the following error
That seems to indicate that it doesn't consider or support reading context data based on inherited classes?
What is expected?
To be able to use data in a base class, in
Does
calls typed to the baseclassSteps to Reproduce
Base.cake file:
Pacakge.cake
This will casue the Package.cake to fail with
Output log
No response
The text was updated successfully, but these errors were encountered: