PoshCode Archive  Artifact [72b12a30df]

Artifact 72b12a30df324a4228ce6d2313779ae56f870dbee1b5de60ee6aa574b7590ae0:

  • File Call-WSPBuilder.ps1 — part of check-in [632a6396b1] 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: 1194)

# 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: 1366
# x-archived: 2013-11-16T08:49:54
# x-published: 2009-10-02T12:10: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
}