100_rebuild.ps1 1.8 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #**************************************************************************#
  2. #** QUADARAX DEPLOYMENT SCRIPTS **#
  3. #** File: 100_rebuild.ps1 **#
  4. #** Description: PowerShell script library to build current solution **#
  5. #** Version: 1.0. **#
  6. #** Updated: 26.7.2019 **#
  7. #**************************************************************************#
  8. param(
  9. # Solution file name with full path. If not defined use global solution
  10. [string] $solutionFile,
  11. # Build configuration Debug / Release / All. If not defined use Debug
  12. [string] $configurationName,
  13. # Defines if Clean will be called before build. If not defined use $false
  14. [bool] $cleanBeforeBuild
  15. )
  16. . ./000_bootstrap.ps1
  17. # Validate inputs
  18. if (!$solutionFile) { $solutionFile = $solutionName}
  19. if (!$configurationName) { $configurationName = $buildCfgDebug}
  20. if (!$cleanBeforeBuild) { $cleanBeforeBuild = $false}
  21. # Script body section
  22. Write-Host "*** REBUILD - START ***" -ForegroundColor Green
  23. $slnFullPath = ("{0}\{1}" -f $projectDir, $solutionFile)
  24. Write-Host ("Solution name: {0}" -f $slnFullPath) -ForegroundColor Yellow
  25. Write-host ("Configuration: {0}" -f $configurationName) -ForegroundColor Yellow
  26. if ($configurationName -eq $buildCfgAll){
  27. RebuildSolution -solutionFileName $slnFullPath -configurationName $buildCfgDebug -cleanBeforeBuild $cleanBeforeBuild
  28. RebuildSolution -solutionFileName $slnFullPath -configurationName $buildCfgRelease -cleanBeforeBuild $cleanBeforeBuild
  29. }
  30. else {
  31. RebuildSolution -solutionFileName $slnFullPath -configurationName $configurationName -cleanBeforeBuild $cleanBeforeBuild
  32. }
  33. Write-Host "*** REBUILD - END ***" -ForegroundColor Green