cake-build / cake-build/cake

Consider adding shallow clone support to ToolSettings

Open
#3,045 1 comment 0 reactions 0 assignees View on GitHub
Improvement
Dominant language
C#
Stars
4.2k
Forks
778
Avg merge
1h 15m
Merged PRs (30d)
19

Description

_Tracking suggestion by @mholo65 and @patriksvensson on discussion related to https://github.com/cake-build/cake/discussions/3044_

### Goal: Define default values for tool settings. For example, `MSBuildSettings`: set a number of values, and use that as a default when calling `MSBuild`.

Pseudo-code of possible usage:

```csharp
var msbuildDefaultSettings = new MSBuildSettings
{
// By default, we want to use MSBuild VS2017 on all tasks
ToolVersion = MSBuildToolVersion.VS2017,

// ... (set other defaults)
};

Task("A")
.Does(_ =>
{
var msbuildSettings = msbuildDefaultSettings.Clone();

msbuildSettings.Configuration = "Debug";
// ... (override other properties of msbuildSettings as needed)

MSBuild("./MyConsoleApp/MyConsoleApp.csproj", msbuildSettings);
});

Task("B")
.Does(_ =>
{
var msbuildSettings = msbuildDefaultSettings.Clone();

msbuildSettings.Configuration = "Release";
// ... (override other properties of msbuildSettings as needed)

MSBuild("./MyConsoleApp/MyConsoleApp.csproj", msbuildSettings);
});

// ...
```

Contributor guide

Open the contributing guide

Research direction

The issue names ToolSettings and MSBuildSettings but no files, tests, or entry points. Start by reviewing the linked discussion and locating the ToolSettings implementation and existing settings-copy behavior. Done means defining shallow clone support so default settings can be copied and individual values overridden for separate MSBuild calls.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.