# ============LICENSE_START=======================================================
#  Copyright (C) 2018-2020 Nordix Foundation.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================

# Wrapper function for choco (Software management automation for Windows)
function Install-Choco {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory)]
        [string] $PackageName,
        [string[]] $ArgumentList
    )

    process {
        $count = 1
        while($true)
        {
            Write-Host "Running [#$count]: choco install $packageName -y $ArgumentList"
            choco install $packageName -y @ArgumentList

            $pkg = choco list --localonly $packageName --exact --all --limitoutput
            if ($pkg) {
                Write-Host "Package installed: $pkg"
                break
            }
            else {
                $count++
                if ($count -ge 5) {
                    Write-Host "Could not install $packageName after $count attempts"
                    exit 1
                }
                Start-Sleep -Seconds 30
            }
        }
    }
}

# Get required version of geode server to execute geode-native (client) tests
function Get-GeodeServer {
    [CmdletBinding()]
    param(
        [Parameter(Mandatory)]
        [string] $GeodeVersion,
        [Parameter(Mandatory)]
        [string] $LocationPath
    )
    process {
        $GeodeURL = "https://downloads.apache.org/geode/" + $GeodeVersion + "/apache-geode-" + $GeodeVersion + ".tgz"
        $GeodePackage = "apache-geode-" + $GeodeVersion + ".tgz"
        Write-Host "`nDownloading Geode Server version: $GeodeVersion"
        Write-Host "from URL: $GeodeURL `n"
        wget -Verbose $GeodeURL -OutFile $GeodePackage
        If(!(test-path $LocationPath))
        {
            New-Item -ItemType Directory -Force -Path $LocationPath
        }
        Write-Host "`nExtracting Geode Server to: ${LocationPath}apache-geode-${GeodeVersion} `n"
        tar -xzvf $GeodePackage -C $LocationPath
        $env:GEODE_HOME = $LocationPath + "\apache-geode-" + $GeodeVersion
    }
}

Write-Host "Install Git, version: latest"
Install-Choco -PackageName git.install

Write-Host "Install Doxygen, version: latest"
Install-Choco -PackageName doxygen.install

Write-Host "Install NUnit, version: ${ENV:NUNIT_VERSION}"
Install-Choco -PackageName nunit.install -ArgumentList "--version",${ENV:NUNIT_VERSION},"--allow-downgrade"

Write-Host "Install OpenSSL, version: latest"
Install-Choco -PackageName openssl

Write-Host "Install CMake, version: latest"
Install-Choco -PackageName cmake.portable

Write-Host "Install Dogtail, version: ${ENV:DOTNET_VERSION}"
Install-Choco -PackageName dotnet${ENV:DOTNET_VERSION}

Write-Host "Install .NET Framework and DevPack, version: ${ENV:DEV_DOTNET_VERSION}"
Install-Choco -PackageName "dotnet${ENV:DEV_DOTNET_VERSION}"
Install-Choco -PackageName "netfx-${ENV:DEV_DOTNET_VERSION}-devpack" -ArgumentList "--allowEmptyChecksums","-confirm"

Write-Host "Install GNU Win32 Core utilities, version: latest"
Install-Choco -PackageName gnuwin32-coreutils.portable

Write-Host "Install NSIS, version: latest"
Install-Choco -PackageName nsis

Write-Host "Install patch, version: latest"
Install-Choco -PackageName patch

Write-Host "Install NuGet, version: latest"
Install-Choco -PackageName nuget.commandline

Get-GeodeServer -GeodeVersion ${ENV:GEODE_SERVER_VERSION} -LocationPath ${ENV:GEODE_SERVER_PATH}