updated build.ps1
This commit is contained in:
parent
c8a48d5df3
commit
14e20f425c
|
@ -138,3 +138,4 @@ _output/
|
||||||
_rawPackage/
|
_rawPackage/
|
||||||
NzbDrone.zip
|
NzbDrone.zip
|
||||||
_dotTrace*
|
_dotTrace*
|
||||||
|
_tests/
|
||||||
|
|
|
@ -250,6 +250,7 @@ Global
|
||||||
{F6FC6BE7-0847-4817-A1ED-223DC647C3D7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
{F6FC6BE7-0847-4817-A1ED-223DC647C3D7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||||
{F6FC6BE7-0847-4817-A1ED-223DC647C3D7}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
{F6FC6BE7-0847-4817-A1ED-223DC647C3D7}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||||
{F6FC6BE7-0847-4817-A1ED-223DC647C3D7}.Release|x86.ActiveCfg = Release|Any CPU
|
{F6FC6BE7-0847-4817-A1ED-223DC647C3D7}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{F6FC6BE7-0847-4817-A1ED-223DC647C3D7}.Release|x86.Build.0 = Release|Any CPU
|
||||||
{CBF6B8B0-A015-413A-8C86-01238BB45770}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{CBF6B8B0-A015-413A-8C86-01238BB45770}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{CBF6B8B0-A015-413A-8C86-01238BB45770}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{CBF6B8B0-A015-413A-8C86-01238BB45770}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{CBF6B8B0-A015-413A-8C86-01238BB45770}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
{CBF6B8B0-A015-413A-8C86-01238BB45770}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||||
|
@ -260,6 +261,7 @@ Global
|
||||||
{CBF6B8B0-A015-413A-8C86-01238BB45770}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
{CBF6B8B0-A015-413A-8C86-01238BB45770}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||||
{CBF6B8B0-A015-413A-8C86-01238BB45770}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
{CBF6B8B0-A015-413A-8C86-01238BB45770}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||||
{CBF6B8B0-A015-413A-8C86-01238BB45770}.Release|x86.ActiveCfg = Release|Any CPU
|
{CBF6B8B0-A015-413A-8C86-01238BB45770}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{CBF6B8B0-A015-413A-8C86-01238BB45770}.Release|x86.Build.0 = Release|Any CPU
|
||||||
{8CEFECD0-A6C2-498F-98B1-3FBE5820F9AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{8CEFECD0-A6C2-498F-98B1-3FBE5820F9AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{8CEFECD0-A6C2-498F-98B1-3FBE5820F9AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{8CEFECD0-A6C2-498F-98B1-3FBE5820F9AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{8CEFECD0-A6C2-498F-98B1-3FBE5820F9AB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
{8CEFECD0-A6C2-498F-98B1-3FBE5820F9AB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||||
|
@ -270,6 +272,7 @@ Global
|
||||||
{8CEFECD0-A6C2-498F-98B1-3FBE5820F9AB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
{8CEFECD0-A6C2-498F-98B1-3FBE5820F9AB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||||
{8CEFECD0-A6C2-498F-98B1-3FBE5820F9AB}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
{8CEFECD0-A6C2-498F-98B1-3FBE5820F9AB}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||||
{8CEFECD0-A6C2-498F-98B1-3FBE5820F9AB}.Release|x86.ActiveCfg = Release|Any CPU
|
{8CEFECD0-A6C2-498F-98B1-3FBE5820F9AB}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{8CEFECD0-A6C2-498F-98B1-3FBE5820F9AB}.Release|x86.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
37
build.ps1
37
build.ps1
|
@ -1,32 +1,53 @@
|
||||||
$msBuild = 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe'
|
$msBuild = 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe'
|
||||||
$outputFolder = '.\_output'
|
$outputFolder = '.\_output'
|
||||||
|
$testSearchPattern = '*.Test\bin\x86\Release'
|
||||||
|
$testPackageFolder = '.\_tests\'
|
||||||
|
|
||||||
Function Build()
|
Function Build()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
$clean = $msbuild + " nzbdrone.sln /t:Clean /m"
|
$clean = $msbuild + " nzbdrone.sln /t:Clean /m"
|
||||||
$build = $msbuild + " nzbdrone.sln /p:Configuration=Release /p:Platform=x86 /t:Build"
|
$build = $msbuild + " nzbdrone.sln /p:Configuration=Release /p:Platform=x86 /t:Build /m"
|
||||||
|
|
||||||
if(Test-Path $outputFolder)
|
if(Test-Path $outputFolder)
|
||||||
{
|
{
|
||||||
Remove-Item -Recurse -Force $outputFolder -ErrorAction Continue
|
Remove-Item -Recurse -Force $outputFolder -ErrorAction Continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Invoke-Expression $clean
|
Invoke-Expression $clean
|
||||||
Invoke-Expression $build
|
Invoke-Expression $build
|
||||||
|
CleanFolder $outputFolder
|
||||||
}
|
}
|
||||||
|
|
||||||
Function Package()
|
Function CleanFolder($path)
|
||||||
{
|
{
|
||||||
Write-Host Removing XMLDoc files
|
Write-Host Removing XMLDoc files
|
||||||
get-childitem $outputFolder -include *.xml -recurse | foreach ($_) {remove-item $_.fullname}
|
get-childitem $path -File -Filter *.xml | foreach ($_) {remove-item $_.fullname}
|
||||||
|
|
||||||
Write-Host Removing FluentValidation.resources
|
Write-Host Removing FluentValidation.Resources files
|
||||||
get-childitem $outputFolder -include FluentValidation.resources.dll -recurse | foreach ($_) {remove-item $_.fullname}
|
get-childitem $path -File -Filter FluentValidation.resources.dll -recurse | foreach ($_) {remove-item $_.fullname}
|
||||||
|
|
||||||
|
Write-Host Removing Empty folders
|
||||||
|
while (Get-ChildItem $path -recurse | where {!@(Get-ChildItem -force $_.fullname)} | Test-Path) {
|
||||||
|
Get-ChildItem $path -recurse | where {!@(Get-ChildItem -force $_.fullname)} | Remove-Item
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Function PackageTests()
|
||||||
|
{
|
||||||
|
Write-Host Packagin Tests
|
||||||
|
|
||||||
|
if(Test-Path $testPackageFolder)
|
||||||
|
{
|
||||||
|
Remove-Item -Recurse -Force $testPackageFolder -ErrorAction Continue
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Get-ChildItem -Recurse -Directory | Where-Object {$_.FullName -like $testSearchPattern} | foreach($_){
|
||||||
|
Copy-Item -Recurse ($_.FullName + "\*") $testPackageFolder -ErrorAction Ignore
|
||||||
|
}
|
||||||
|
|
||||||
|
CleanFolder $testPackageFolder
|
||||||
|
}
|
||||||
|
|
||||||
Build
|
Build
|
||||||
Package
|
Package
|
Loading…
Reference in New Issue