Use cake build language in classes
See original GitHub issueI’d like to structure my build scripts into different classes. E.g one for default directory definitions. I noticed that I’m not able to use the cake build language there e.g.
public class DefaultDirectories
{
public static DirectoryPath WorkingCopyRoot = MakeAbsolute(Directory("."))
public static DirectoryPath Binaries = WorkingCopyRoot.Combine(new DirectoryPath("bin"));
...
}
MakeAbsolute and Directory cannot be interpreted correctly by CAKE.
For now I created a workaround but that may be not possible for other cases
public class DefaultDirectories
{
public static DirectoryPath WorkingCopyRoot = new DirectoryPath(System.IO.Directory.GetCurrentDirectory());
public static DirectoryPath Binaries = WorkingCopyRoot.Combine(new DirectoryPath("bin"));
...
}
Do I miss something or is that not intended to be done like that?
Another newbie question: How do you edit your build scripts, can this be done somehow in Visual Studio where compilation errors might be shown as under normal C# development?
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Cake Build
Cake supports the most common tools used during builds such as MSBuild, .NET Core CLI, MSTest, xUnit, NUnit, NuGet, ILMerge, WiX and SignTool...
Read more >Reference
This reference guide describes the various methods and properties which make up the Cake build language, or DSL. The DSL is made up...
Read more >Building and Deploying Applications with Cake
This course will teach you how to use Cake to compile, test, version, package, and deploy your .NET or .NET Core application.
Read more >Using Cake build scripts for your .NET Core web apps
Cake is a build automation system for .NET Developers to script their build processes using a C# Domain Specific Language (DSL).
Read more >Cake Build Tool
The Cake build tool is a build tool that utilizes the Roslyn ... can write very precise build scripts using very familiar C#...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Alas, there are no plans of supporting Cake alias methods in classes. A workaround for your problem would be something like this:
That’s fine, didn’t know how to adress the context…