Skip to content

[Feature] Allow to pass extra command line parameters to MSBuild task #3021

Closed
@professor-k

Description

@professor-k

Is your feature request related to a problem? Please describe.
GitVersion has some command line options that can't be passed via MSBuild task, making it impossible to e.g. use non-default config file with stock nuget tasks.

Detailed Description

Current there is no way to insert into $(GitVersion_ToolArgments) anything besides three predefined options.

Context

In my particular case I want to use different configsfor different builds, which is easy with commandline version, but impossible with MSBuild task. There are more options not available via MSBuild too, though not all of them makes sense to expose (e.g. init or /?). Yet I don't see any reason why user wouldn't want to run msbuild with /diag, /overrideconfig or /l + /verbosity.

Possible Implementation

There are two ways it can be acieved.

  1. MsBuild can receive raw piece of command line and pass it directly to Exec.
    • pros:
      • easy to implement
      • absolute flexibility
      • unlimited forward compatibility for future parameters
    • cons:
      • somewhat higher chance to shoot own leg
      • not that elegant
  2. Add separate MsBuild parameter for every option.
    • pros:
      • more elegant
      • harder to do something wrong
    • cons:
      • more code
      • more documentation
      • no automatic support for future keys

In fact, those approaches are not mutually exclusive, they can easily coexist.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions