Skip to content

Commit

Permalink
Fix disable native toolset install logic (#4265)
Browse files Browse the repository at this point in the history
* Fix disable native toolset install logic
  • Loading branch information
chcosta authored and ViktorHofer committed Nov 1, 2019
1 parent 9eac612 commit d2d8d9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions eng/common/tools.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -446,10 +446,7 @@ function GetSdkTaskProject([string]$taskName) {
}

function InitializeNativeTools() {
if ($null -eq $env:DisableNativeToolsetInstalls) {
return
}
if (Get-Member -InputObject $GlobalJson -Name "native-tools") {
if (-Not (Test-Path variable:DisableNativeToolsetInstalls) -And (Get-Member -InputObject $GlobalJson -Name "native-tools")) {
$nativeArgs= @{}
if ($ci) {
$nativeArgs = @{
Expand Down
6 changes: 3 additions & 3 deletions eng/common/tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# CI mode - set to true on CI server for PR validation build or official build.
ci=${ci:-false}
disable_configure_toolset_import=${disable_configure_toolset_import:-null}
disable_configure_toolset_import=${disable_configure_toolset_import:-}

# Set to true to use the pipelines logger which will enable Azure logging output.
# https://github.com/Microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md
Expand Down Expand Up @@ -273,7 +273,7 @@ function GetNuGetPackageCachePath {
}

function InitializeNativeTools() {
if [[ -z "${DisableNativeToolsetInstalls:-}" ]]; then
if [[ -n "${DisableNativeToolsetInstalls:-}" ]]; then
return
fi
if grep -Fq "native-tools" $global_json_file
Expand Down Expand Up @@ -437,7 +437,7 @@ Write-PipelineSetVariable -name "Temp" -value "$temp_dir"
Write-PipelineSetVariable -name "TMP" -value "$temp_dir"

# Import custom tools configuration, if present in the repo.
if [[ "$disable_configure_toolset_import" != null ]]; then
if [[ -z "$disable_configure_toolset_import" ]]; then
configure_toolset_script="$eng_root/configure-toolset.sh"
if [[ -a "$configure_toolset_script" ]]; then
. "$configure_toolset_script"
Expand Down

0 comments on commit d2d8d9f

Please sign in to comment.