Questions tagged [cakebuild]
Cake (C# Make) is a build automation system with a C# DSL to do things like compiling code, copy files/folders, running unit tests, compress files and build NuGet packages.
294
questions
0
votes
0
answers
11
views
Exclusion pattern for CleanDirectory in cake
How can I create an exclusion pattern within CleanDirectory so that one specific file in that folder does not get deleted?
This is my current code but it wipes the entire folder.
var myPath = ...
0
votes
0
answers
23
views
How do you update PackageReferences version numbers?
I thought this would be easy but I'm missing something. How do you update PackageReferences version numbers?
Visual Studio 2022
netstandard 2.0 projects
I have a Shared package that is used in other ...
0
votes
2
answers
86
views
In C# Cake How to Read a Text File into List<string>?
Given a carriage return delimited text file say of folder names, how do I read this file into List in the Cake build system for C#?
When I try to use the File class, it complains that File(string) is ...
1
vote
1
answer
78
views
How to use JFrog cli in cake script
We are using cake script as part of our build process. Please let me know how can I use JFrog cli command in cake script.
https://www.jfrog.com/confluence/display/CLI/JFrog+CLI
jf rt u
0
votes
0
answers
43
views
Publishing to Github Packages from Jenkins Using Cake
I'm having an issue publishing to Github Packages from Jenkins using Cake.
The push task looks like this:
Task(nugetPushTask)
.WithCriteria(() => isPublishBranch)
.IsDependentOn(packTask)
....
0
votes
1
answer
57
views
How to create clickonce deployment package for Dot net widnows application using build.cake?
Is there way to handle dot net clickonce publish using cake file instead of publish wizard?
0
votes
0
answers
19
views
Cake Web Deploy in ubuntu linux machine
In previously we have deployed in windows machine by using the following code and Cake.WebDeply addin.
DeployWebsite(new DeploySettings()
{
SourcePath = "{Source Location}",
SiteName ...
0
votes
1
answer
157
views
Build errors appear when using a Cake script, but the code builds fine in Visual Studio 2022
I have a C# solution targeting .NET framework 4.8, it builds fine in Visual Studio 2022. However when I try and run a build using a Cake script it falls over on the following line at the .:
...
0
votes
2
answers
83
views
Change verbosity for cake frosting project
I'm converting a cake script to a frosting project.
There are instructions for a script's verbosity. For frosting verbosity what I found was the --verbosity foo switch.
I tried two things:
In the ...
1
vote
1
answer
82
views
Debug Cake Frosting project in VSCode
I found an old question related to debugging a cake script in vscode.
How do I debug a "frosting" project?
I added this to .vscode/launch.json, but it runs the project without stopping at ...
0
votes
1
answer
166
views
Custom config in cake.config
Cake supports configuration in a cake.config file.
Can I read my own config key/values from that file?
2
votes
1
answer
64
views
How to write a simple cake module
I want to change the way cake logs results, so I must write a "module".
Unfortuntely there is no documentation for that, just a long and outdated (4+ years) video. I also looked at other ...
0
votes
2
answers
52
views
Run action for success after cake's DoesForEach
I'm using the DoesForEach alias to run a task for a collection.
I want to report/act on success.
I cannot do this because it would run after every item in the collection:
Task("A")
....
1
vote
1
answer
165
views
Parse csproj file using cake's ParseProject
Create minimal repro project:
dotnet new classlib --no-restore --output /tmp/Foo
cd /tmp/Foo
dotnet new tool-manifest
dotnet tool install cake.tool
touch build.cake
Put this minimal script in build....
0
votes
2
answers
78
views
Use cake to perform git commit without name and email
The cake GitCommit alias wants a name and email:
public static GitCommit GitCommit(this ICakeContext context, DirectoryPath repositoryDirectoryPath, string name, string email, string message)
How can ...
0
votes
2
answers
50
views
Cake logging with colours
I've read about cake's console aliases.
Is it possible to log using colours?
For example, I'd log success / warning / error in green / orange / red:
CustomWarning("WARN: Foo bar baz!"); //...
0
votes
1
answer
121
views
Difference between cake concepts addin. module, alias, tool, etc
The cake docs cover items like addins, modules, etc., but does not explain what they are.
For example, the modules page has this: "The module directive lets you bootstrap Cake modules by ...
1
vote
1
answer
173
views
VSCode Intellisense support for Cake
I followed the instructions on the website, but I don't get full cake support.
environment: linux, dotnet (6.0.302), vscode (1.70.0), c# extension (1.25.0), cake extension (2.0.0) - i.e. latest of ...
0
votes
2
answers
444
views
PublishSingleFile error on upgrading from netcoreapp3.1 to net6.0
I am getting this below error while trying to publish my app via the command line after upgrading it from netcoreapp3.1 to net6.0:
dotnet cake build/build.cake --target=Publish --Verbosity=Diagnostic -...
0
votes
1
answer
184
views
How to capture a Cake build failure within an Azure DevOps task?
For the reasons that are beyond the scope of this discussion, I have the following Azure DevOps setup which is being used to build some .NET library:
An Azure DevOps Powershell task:
- task: ...
0
votes
0
answers
205
views
Can .NET Cake be used to build projects in Debug configurations, rather than Release?
Referenced this SO question first, to no avail - Use Cake to build .Net Core project using Debug configuration
Also checked out the Cake docs, as well as their github, these two pages looking ...
0
votes
1
answer
1k
views
Cake Addins install fail error during build
I am using net 4.8 framework. and cake version 0.38.2.
During build in Teamcity, it has to install addins cake.npm, cake.filehelpers. But following error happens
Could not find any assemblies ...
0
votes
1
answer
113
views
Cake script works locally, but fails on docker env - error CS0117
I have added few lines to working cake build script. It executes properly on my local machine, but when trying to implement it on docker, where it worked fine till now - it gives me error:
error ...
1
vote
1
answer
326
views
The Cake GetVersion - Duplicate 'AssemblyInformationalVersion' attribute
For some reason, there is an error during cakebuild.net task execution.
The root cause of error is UpdateAssemblyInfo = true property. It's look like attribute duplication happens.
But it's not ...
0
votes
2
answers
143
views
Need help for Checkmarx.Api cake plugin
I am trying to incorporate "Checkmarx" Static code scans as a stage into my devops pipeline. Currently our code uses "cake" files to excute the stages (invoked by PowerShell).
I ...
0
votes
1
answer
70
views
Does cake have support for windows impersonation
I need to use cake to install an application, and I need it to run as the user that later will run the application. Is this possible with cake in windows, by impersonation this user?
0
votes
1
answer
270
views
Exists a way to configure cake so it uses inside DotNetCorePublishSettings the switch self contained
MSBuild has a switch "--self-contained" what publishes also the used .NET framework. So cake has a Function "DotNetCorePublish". Exists any way to set up that function so it ...
0
votes
1
answer
115
views
Cake -> AdbInstall -> Object reference not set to an instance of an object
How can I use cake ADB in the right way?
My laptop -> Mackbook M1
#addin "nuget:?package=Cake.Xamarin&version=3.0.2"
#addin "nuget:?package=Cake.Android.Adb&version=3.2.0&...
0
votes
1
answer
157
views
How can you conditionally set services in the docker-compose.yml file?
I'm new to using Docker and Cake. At the moment we have a simple Cake task that runs the DockerComposeUp() method that takes a DockerComposeUpSettings object. The docker-compose.yaml file holds some ...
3
votes
1
answer
61
views
How to addin specific package if cake running in windows
I have cake file that I want to run in Windows and Ubuntu.
In Windows we need Cake.EntityFramework addin and in Ubuntu we do not need it.
So I want to write some platform specific addin like below
#if ...
0
votes
1
answer
435
views
How to specify Cake.Tool version on yaml task in Azure devops pipelines
I have this yaml task to run a build.cake file.
- task: cake-build.cake.cake-build-task.Cake@2
displayName: 'Build Sources'
inputs:
script: devops/build.cake
target: Default
verbosity: ...
0
votes
2
answers
413
views
How to pass command line arguments to Cake (Frosting), when these arguments are already collected with System.CommandLine?
I'm developing a .net tool for building our projects. I'm using System.CommandLine package for collect command line argument without sweat. My build command looks like this:
[Command(Description = ...
1
vote
1
answer
157
views
Xamarin iOS: error MSB4018: The "CompileITunesMetadata" task failed unexpectedly
After updating our iOS build server from Mac OS Catalina to Big Sur our GitLab pipelines (running cakebuild) are failing with some cryptic Xamarin specific error message for one specific project (...
0
votes
1
answer
499
views
Run DotCover dotnet test with Cake
Currently I run DotCover for each text project in my solution.
I want to change this to only run DotCover once for the whole solution.
I found this command which works:
C:\_git\MyApp\build\tools\...
2
votes
2
answers
2k
views
Cake NuGetRestore Could not locate nuget.exe
I have created simple .NET5 console application which can be successfully run using "dotnet restore" and "dotnet run". Application is using one package Newtonsoft.Json.
I want to ...
0
votes
1
answer
174
views
Push commit to Azure Repo using Cake Build (C# Make)
Im trying pushing changes in a project with cake. This is my code
[TaskName("GitPush")]
public sealed class GitPushTask : FrostingTask<BuildContext>
{
public override void Run(...
0
votes
1
answer
253
views
Expose MSBuild property in Cake script after build step
Can you get property set by MSBuild inside your cake script?
I currently have a target that runs after compilation to indicate whether it has run, or whether it was an incremental build.
I want to ...
1
vote
1
answer
709
views
How to install nupkg from local file which is generated after done gulp build
I want to install the below nupkg from my local machine throw powershell.
C:\ServerPublishing\build\javascript\reports\release\packages\BoldReport.Server.3.1.92.nupkg
I have tried and get the below ...
0
votes
2
answers
336
views
How To Pushing a Docker image to Azure Container Registry using Cake Building?
I need build a task on Cake building that allow my to push a docker image to Azure Container Registry. Im searching in internet but I not find how to do that... someone had the same problem?
0
votes
1
answer
419
views
Getting errors in Cake.Sonar on Cake Frosting
Im trying to use sonarqube from a Frosting cake project.
There are my tasks:
using Cake.Common;
using Cake.Common.IO;
using Cake.Common.Tools.DotNetCore;
using Cake.Common.Tools.DotNetCore.Build;
...
0
votes
2
answers
767
views
Error: One or more errors occurred. too many redirects or authentication replays
Task("Clone")
.Does(() =>
{
GitClone(@"https://gitlab.organization.com/bold-reports/javascript.git",
@"C:\ServerPublishing\build",
...
1
vote
1
answer
199
views
How to pass multiple flags as a Cake argument?
We have a number of build flags we'd like to be able to pass to our Cake script as a single argument. Based on this answer and the TypeConverter documentation, I would expect the following simplified ...
2
votes
2
answers
735
views
Cake Clean task is skipped on cake build
Brand-new Cake project, build.cake written as in Setting Up A New Project, added to a net5.0 console application.
When running dotnet cake, the task Clean is silently skipped by runner.
I ran dotnet ...
0
votes
1
answer
542
views
Cake Running Nunit 3 using DotNetCoreTest Is Failing
Task("Nunit")
.Does(() => {
DotNetCoreTest("D:\Workspace\Proj14\test\test\WebAutomation\NUnit\UserManageLMTWS.cs", );
});
Currently have by build.cake defining the task ...
2
votes
1
answer
160
views
OmniSharp hangs when loading Cake.Bakery.exe
I am new to Cake.
I am trying to configure IntelliSense for Cake VSCode as described here:
https://cakebuild.net/docs/integrations/editors/vscode/intellisense
I am getting the following OmniSharp ...
0
votes
2
answers
447
views
Access target branch name from GitHub Pull Requests in Cake
I'm working with Cake and Teamcity and I'm trying to access which branch a GitHub PR is targeting
Been trying to find a GitHub API wrapper for Cake do to the job, or a plugin/script to TeamCity to ...
0
votes
3
answers
463
views
How to find type of project with cake build system?
I use cake build system to automate building my solution and I want to automate testing my project with cake in our CI,
My NUnit projects have many types such as asp.net dot net framework 4.6.1 or dot ...
3
votes
1
answer
543
views
Cake runner for .NET Framework (4.8) doesn't pick up environment variables
I'm using the Cake runner for .NET Framework to build a .NET Framework 4.8 console application. I got build.ps1 using:
Invoke-WebRequest https://cakebuild.net/download/bootstrapper/windows -OutFile ...
0
votes
2
answers
470
views
How do you pass empty arguments in Cake v1?
According to the upgrade document it is no longer possible to ./build.sh arg= as of v1.0. Indeed, that produces:
Error: Expected an option value.
However it also doesn't work with arg=''. I could ...
2
votes
1
answer
358
views
How to download nuget package without its dependencies?
Im using below code to install nuget packages in CI process,
Cake.Common.Tools.NuGet.NuGetAliases.NuGetInstall(context, packageid, new NuGetInstallSettings { NoCache = true, OutputDirectory = "../...