#**************************************************************************#
#**  QUADARAX DEPLOYMENT SCRIPTS                                         **#
#**  File: 101_clean.ps1                                                 **#
#**  Description: PowerShell script library to clean current solution    **#
#**  Version: 1.0.                                                       **#
#**  Updated: 26.7.2019                                                  **# 
#**************************************************************************#
param(
        # Solution file name with full path. If not defined use global solution
        [string] $solutionFile,
        # Build configuration Debug / Release / All. If not defined use Debug
        [string] $configurationName        
)
. ./000_bootstrap.ps1

# Validate inputs
if (!$solutionFile) { $solutionFile = $solutionName}
if (!$configurationName) { $configurationName = $buildCfgDebug}

# Script body section
Write-Host "*** CLEAN - START ***" -ForegroundColor Green
$slnFullPath = ("{0}\{1}" -f $projectDir, $solutionFile)
Write-Host ("Solution name: {0}" -f $slnFullPath) -ForegroundColor Yellow
Write-host ("Configuration: {0}" -f $configurationName) -ForegroundColor Yellow
if ($configurationName -eq $buildCfgAll){
        CleanSolution $slnFullPath $buildCfgDebug
        CleanSolution $slnFullPath $buildCfgRelease
}
else {
        CleanSolution $slnFullPath $configurationName
}
Write-Host "*** CLEAN - END ***" -ForegroundColor Green