fixing output clean and making build init vars verbose output

This commit is contained in:
Travis Drake
2018-09-05 11:10:43 -07:00
parent e07e9330b4
commit 4433d8b88f
2 changed files with 20 additions and 16 deletions

View File

@@ -1,9 +1,12 @@
task Clean { task Clean {
'Cleaning Output files...' if (Test-Path $Output)
{
"Cleaning Output files in [$Output]..."
$null = Get-ChildItem -Path $Output -File -Recurse | $null = Get-ChildItem -Path $Output -File -Recurse |
Remove-Item -Force -ErrorAction 'Ignore' Remove-Item -Force -ErrorAction 'Ignore'
'Cleaning Output directories...' "Cleaning Output directories in [$Output]..."
$null = Get-ChildItem -Path $Output -Directory -Recurse | $null = Get-ChildItem -Path $Output -Directory -Recurse |
Remove-Item -Recurse -Force -ErrorAction 'Ignore' Remove-Item -Recurse -Force -ErrorAction 'Ignore'
} }
}

View File

@@ -1,30 +1,31 @@
Write-Verbose "Initializing build variables" Write-Verbose "Initializing build variables" -Verbose
Write-Verbose " Existing BuildRoot [$BuildRoot]" -Verbose
$Script:DocsPath = Join-Path -Path $BuildRoot -ChildPath 'Docs' $Script:DocsPath = Join-Path -Path $BuildRoot -ChildPath 'Docs'
Write-Verbose " DocsPath [$DocsPath]" Write-Verbose " DocsPath [$DocsPath]" -Verbose
$Script:Output = Join-Path -Path $BuildRoot -ChildPath 'Output' $Script:Output = Join-Path -Path $BuildRoot -ChildPath 'Output'
Write-Verbose " Output [$Output]" Write-Verbose " Output [$Output]" -Verbose
$Script:Source = Join-Path -Path $BuildRoot -ChildPath $ModuleName $Script:Source = Join-Path -Path $BuildRoot -ChildPath $ModuleName
Write-Verbose " Source [$Source]" Write-Verbose " Source [$Source]" -Verbose
$Script:Destination = Join-Path -Path $Output -ChildPath $ModuleName $Script:Destination = Join-Path -Path $Output -ChildPath $ModuleName
Write-Verbose " Destination [$Destination]" Write-Verbose " Destination [$Destination]" -Verbose
$Script:ManifestPath = Join-Path -Path $Destination -ChildPath "$ModuleName.psd1" $Script:ManifestPath = Join-Path -Path $Destination -ChildPath "$ModuleName.psd1"
Write-Verbose " ManifestPath [$ManifestPath]" Write-Verbose " ManifestPath [$ManifestPath]" -Verbose
$Script:ModulePath = Join-Path -Path $Destination -ChildPath "$ModuleName.psm1" $Script:ModulePath = Join-Path -Path $Destination -ChildPath "$ModuleName.psm1"
Write-Verbose " ModulePath [$ModulePath]" Write-Verbose " ModulePath [$ModulePath]" -Verbose
$Script:Folders = 'Classes', 'Includes', 'Internal', 'Private', 'Public', 'Resources' $Script:Folders = 'Classes', 'Includes', 'Internal', 'Private', 'Public', 'Resources'
Write-Verbose " Folders [$Folders]" Write-Verbose " Folders [$Folders]" -Verbose
$Script:TestFile = "$BuildRoot\Output\TestResults_PS$PSVersion`_$TimeStamp.xml" $Script:TestFile = "$BuildRoot\Output\TestResults_PS$PSVersion`_$TimeStamp.xml"
Write-Verbose " TestFile [$TestFile]" Write-Verbose " TestFile [$TestFile]" -Verbose
$Script:PSRepository = 'PSGallery' $Script:PSRepository = 'PSGallery'
Write-Verbose " PSRepository [$TestFile]" Write-Verbose " PSRepository [$TestFile]" -Verbose
function taskx($Name, $Parameters) { task $Name @Parameters -Source $MyInvocation } function taskx($Name, $Parameters) { task $Name @Parameters -Source $MyInvocation }