Repairing the first pass call to 'dotnet msbuild'; CLI:master (#8488)
* '$ExtraParametersNoTargets', which is used on the first pass call to 'dotnet msbuild', currently is of type 'string' not 'List'1' as is '$ExtraParameters'. This results in the non-honoring of any parameter other than parameter one. Solution: Make a copy of '$ExtraParameters' to '$ExtraParametersNoTargets' of type 'List'1' and remove the targets from the list. * Swallow the boolean output from '$ExtraParametersNoTargets.Remove' * Specifically capture "/t:" or "/target:" only.
This commit is contained in:
parent
78904831f9
commit
3e35517ce8
2 changed files with 9 additions and 6 deletions
|
@ -29,12 +29,15 @@ if($Help)
|
|||
|
||||
# The first 'pass' call to "dotnet msbuild build.proj" has a hard-coded "WriteDynamicPropsToStaticPropsFiles" target
|
||||
# therefore, this call should not have other targets defined. Remove all targets passed in as 'extra parameters'.
|
||||
$ExtraParametersNoTargets = ""
|
||||
foreach ($param in $ExtraParameters.split())
|
||||
if ($ExtraParameters)
|
||||
{
|
||||
if((-not $param.StartsWith("/t")) -and (-not $param.StartsWith("/T")))
|
||||
$ExtraParametersNoTargets = $ExtraParameters.GetRange(0,$ExtraParameters.Count)
|
||||
foreach ($param in $ExtraParameters)
|
||||
{
|
||||
$ExtraParametersNoTargets += "{0} " -f $param
|
||||
if(($param.StartsWith("/t:", [StringComparison]::OrdinalIgnoreCase)) -or ($param.StartsWith("/target:", [StringComparison]::OrdinalIgnoreCase)))
|
||||
{
|
||||
$ExtraParametersNoTargets.Remove("$param") | Out-Null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -130,8 +130,8 @@ done
|
|||
argsnotargets=( )
|
||||
for arg in ${args[@]}
|
||||
do
|
||||
if [[ $arg != '/t'* ]] && [[ $arg != '/T'* ]]; then
|
||||
argsnotargets+=($arg)
|
||||
if [[ ${arg,,} != '/t:'* ]] && [[ ${arg,,} != '/target:'* ]]; then
|
||||
argsnotargets+=($arg)
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue