From be1d4ce4c62e9bc70843a9665622088c6ec8b75d Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 25 Dec 2014 21:35:22 -0800 Subject: [PATCH] Fixing the build --- build.ps1 | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/build.ps1 b/build.ps1 index afba8e4a9..a5459df3f 100644 --- a/build.ps1 +++ b/build.ps1 @@ -15,12 +15,12 @@ Function Build() $clean = $msbuild + " src\nzbdrone.sln /t:Clean /m" $build = $msbuild + " src\nzbdrone.sln /p:Configuration=Release /p:Platform=x86 /t:Build /m" - + if(Test-Path $outputFolder) { Remove-Item -Recurse -Force $outputFolder -ErrorAction Continue } - + Invoke-Expression $clean CheckExitCode @@ -34,7 +34,7 @@ Function Build() Write-Host "Removing Mono.Posix.dll" Remove-Item "$outputFolder\Mono.Posix.dll" - Write-Host "##teamcity[progressFinish 'Build']" + Write-Host "##teamcity[progressFinish 'Build']" } Function CleanFolder($path, $keepConfigFiles) @@ -56,12 +56,12 @@ Function CleanFolder($path, $keepConfigFiles) } get-childitem $path -File -Filter *.transform -Recurse | foreach ($_) {remove-item $_.fullname} - + if($keepConfigFiles -ne $true) { get-childitem $path -File -Filter *.dll.config -Recurse | foreach ($_) {remove-item $_.fullname} } - + Write-Host Removing FluentValidation.Resources files get-childitem $path -File -Filter FluentValidation.resources.dll -recurse | foreach ($_) {remove-item $_.fullname} @@ -72,15 +72,15 @@ Function CleanFolder($path, $keepConfigFiles) Write-Host Removing vshost files get-childitem $path -File -Filter *.vshost.exe -Recurse | foreach ($_) {remove-item $_.fullname} - + if(Test-Path $$path\NuGet) { Write-Host Removing NuGet Remove-Item -Recurse -Force "$path\NuGet" } - + Write-Host Removing Empty folders - while (Get-ChildItem $path -recurse | where {!@(Get-ChildItem -force $_.fullname)} | Test-Path) + while (Get-ChildItem $path -recurse | where {!@(Get-ChildItem -force $_.fullname)} | Test-Path) { Get-ChildItem $path -Directory -recurse | where {!@(Get-ChildItem -force $_.fullname)} | Remove-Item } @@ -109,7 +109,7 @@ Function PackageMono() Write-Host Removing Service helpers get-childitem $outputFolderMono -File -Filter ServiceUninstall.* -Recurse | foreach ($_) {remove-item $_.fullname} get-childitem $outputFolderMono -File -Filter ServiceInstall.* -Recurse | foreach ($_) {remove-item $_.fullname} - + Write-Host Removing native windows binaries Sqlite, MediaInfo get-childitem $outputFolderMono -File -Filter sqlite3.* -Recurse | foreach ($_) {remove-item $_.fullname} get-childitem $outputFolderMono -File -Filter MediaInfo.* -Recurse | foreach ($_) {remove-item $_.fullname} @@ -169,7 +169,7 @@ Function PackageOsxApp() } Copy-Item .\osx\Sonarr.app $outputFolderOsxApp\Sonarr.app -recurse - Copy-Item $outputFolderOsx\* $outputFolderOsxApp\Sonarr.app\Contents\MacOS -recurse + Copy-Item $outputFolderOsx $outputFolderOsxApp\Sonarr.app\Contents\MacOS -recurse Write-Host "##teamcity[progressFinish 'Creating OS X App Package']" } @@ -186,27 +186,27 @@ Function PackageTests() Write-Host Packaging Tests Write-Host "##teamcity[progressStart 'Creating Test Package']" - + if(Test-Path $testPackageFolder) { Remove-Item -Recurse -Force $testPackageFolder -ErrorAction Continue } - Get-ChildItem -Recurse -Directory | Where-Object {$_.FullName -like $testSearchPattern} | foreach($_){ + Get-ChildItem -Recurse -Directory | Where-Object {$_.FullName -like $testSearchPattern} | foreach($_){ Copy-Item -Recurse ($_.FullName + "\*") $testPackageFolder -ErrorAction Ignore } - .\src\.nuget\NuGet.exe install NUnit.Runners -Version 2.6.1 -Output $testPackageFolder + .\src\.nuget\NuGet.exe install NUnit.Runners -Version 2.6.1 -Output $testPackageFolder Copy-Item $outputFolder\*.dll -Destination $testPackageFolder -Force Copy-Item $outputFolder\*.pdb -Destination $testPackageFolder -Force Copy-Item .\*.sh -Destination $testPackageFolder -Force - + Write-Host Creating MDBs for tests get-childitem $testPackageFolder -File -Include @("*.exe", "*.dll") -Exclude @("MediaInfo.dll", "sqlite3.dll") -Recurse | foreach ($_) { Write-Host "Creating .mdb for $_" & "tools\pdb2mdb\pdb2mdb.exe" $_.fullname - } + } get-childitem $testPackageFolder -File -Filter *log.config | foreach ($_) {remove-item $_.fullname} @@ -224,7 +224,7 @@ Function RunGulp() $gulpPath = '.\node_modules\gulp\bin\gulp' Invoke-Expression 'npm install' CheckExitCode - + Invoke-Expression ('node ' + $gulpPath + ' build') -ErrorAction Continue -Verbose CheckExitCode