-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
… syntax support shims for netfx40, so that to hide them from the compiler and prevent ambiguity when compiling for netfx45+ (gh-20). Added a testbed usage which demonstrated the problem and got fixed.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ namespace Microsoft.Build.Utilities | |
/// -- Functional double quotes (for example to handle spaces) are best put around both name and value | ||
/// in switches like /Dname=value. | ||
/// </summary> | ||
public sealed class CommandLineBuilder | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ArsenShnurkov
|
||
internal sealed class CommandLineBuilder | ||
{ | ||
public static readonly string License = | ||
@" | ||
|
4 comments
on commit 857eb7c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and after making it "internal" GitExtensions build gives the error:
UserControls/ConsoleEmulatorOutputControl.cs(88,19): error CS0122: `Microsoft.Build.Utilities.CommandLineBuilder' is inaccessible due to its protection level
/usr/lib/mono/gac/ConEmu.WinForms/1.0.0.0__00340228797aafb8/ConEmu.WinForms.dll (Location of the symbol related to previous error)
...
Done building target "CoreCompile" in project "/var/calculate/remote/distfiles/egit-src/gitextensions.git/GitUI/GitUI.csproj".-- FAILED
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made all the utility code internal, so that it wouldn't show up in your solution and cause ambiguity in code completion etc.
As the cmdline formatter is useful in clients as well, I'd rather make it back public and make the name a bit more unique maybe.
#29
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider making ConEmuStartInfo.ConsoleProcessCommandLine
of the new type (CommandLineBuilder) instead of string. It will give a hint that the ConsoleProcessCommandLine has to be escaped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible.
This is not 100% correct because the escaping is not formally required, the target process receives the command line string AS IS and can parse it at its own discretion with any escaping rules it likes. Actually, escaping rules do vary from app to app, and the CommandLineBuilder
implements some average sane rules.
But it allows to submit unescaped raw text if needed, so would do for all uses.
Why was this class made internal? It breaks https://github.com/gitextensions/gitextensions/blob/master/GitUI/UserControls/ConsoleEmulatorOutputControl.cs#L76 when trying to upgrade nuget package.