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
|
# 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'.
|
# therefore, this call should not have other targets defined. Remove all targets passed in as 'extra parameters'.
|
||||||
$ExtraParametersNoTargets = ""
|
if ($ExtraParameters)
|
||||||
foreach ($param in $ExtraParameters.split())
|
|
||||||
{
|
{
|
||||||
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,7 +130,7 @@ done
|
||||||
argsnotargets=( )
|
argsnotargets=( )
|
||||||
for arg in ${args[@]}
|
for arg in ${args[@]}
|
||||||
do
|
do
|
||||||
if [[ $arg != '/t'* ]] && [[ $arg != '/T'* ]]; then
|
if [[ ${arg,,} != '/t:'* ]] && [[ ${arg,,} != '/target:'* ]]; then
|
||||||
argsnotargets+=($arg)
|
argsnotargets+=($arg)
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue