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

Consider adding shallow clone support to ToolSettings #3045

Open
augustoproiete opened this issue Jan 22, 2021 · 1 comment
Open

Consider adding shallow clone support to ToolSettings #3045

augustoproiete opened this issue Jan 22, 2021 · 1 comment

Comments

@augustoproiete
Copy link
Member

Tracking suggestion by @mholo65 and @patriksvensson on discussion related to #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:

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);
});

// ...
@augustoproiete
Copy link
Member Author

Relates to #2103. This is about adding clone support to the base class ToolSettings whereas #2103 is about adding clone specifically to MSBuildSettings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant