PoshCode Archive  Artifact [25a3cf74d5]

Artifact 25a3cf74d51b399c4cc116c3267cac9d5801b53db202d13008ba1958abc5a0c5:

  • File Call-WSPBuilder.ps1 — part of check-in [95309ad210] at 2018-06-10 12:56:57 on branch trunk — Small snippet of my build script, I think this is a good template to use when calling the command-line WSPBuilder. (user: Peter size: 1188)

# encoding: ascii
# api: powershell
# title: Call WSPBuilder
# description: Small snippet of my build script, I think this is a good template to use when calling the command-line WSPBuilder.
# version: 0.1
# type: function
# author: Peter
# license: CC0
# function: Run-DosCommand
# x-poshcode-id: 1365
# x-archived: 2013-11-14T16:46:32
# x-published: 2009-10-02T11:52:00
#
#
function Run-DosCommand($program, [string[]]$programArgs)
{
	write-host "Running command: $program";
	write-host " Args:"
	0..($programArgs.Count-1) | foreach { Write-Host "  $($programArgs[$_])" }
	& $program $programArgs
}

#Get-FullPath function defined elsewhere, refers to a "base directory" which allows me to make
#all path references RELATIVE to this base directory. Feel free to hardcode the path instead.
$wspbuilder = Get-FullPath("tools\WSPBuilder.exe")
function Run-WspBuilder($rootDirectory)
{
	pushd
	cd $rootDirectory
	Run-DosCommand -program $WSPBuilder -programArgs @("-BuildWSP", 
		"true", 
		"-OutputPath", 
		(Get-FullPath 'deployment'), 
		"-ExcludePaths",
		(Join-Path -path (Get-FirstDirectoryUnderneathSrc).fullname -childPath "bin\Debug"))
	popd
}