Skip to content

Commit 1e8635f

Browse files
committed
Update build drop script to allow specifying which command packages to build and exclude
1 parent 1902b9f commit 1e8635f

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

tools/CLU/BuildDrop.ps1

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
param([string]$dropLocation, [string]$packageVersion="0.0.1", [switch] $excludeCommandPackages, [switch] $excludeCluRun)
1+
param([string]$dropLocation, [string]$packageVersion="0.0.1", [string] $commandPackagesToBuild = "*", [string] $exceptCommandPackagesToBuild, [switch] $excludeCluRun)
22

33
$thisScriptDirectory = Split-Path $MyInvocation.MyCommand.Path -Parent
44

@@ -26,21 +26,21 @@ if (!(Test-Path -Path $dropLocation -PathType Container))
2626

2727

2828

29-
if (!($excludeCommandPackages.IsPresent))
30-
{
31-
# Grap all command packages to build.
32-
# We'll assume that all directories that contain a *.nuspec.template file is a command package and that the name of the package is everything leading up to .nuspec.template
33-
$commandPackages = Get-ChildItem -path $sourcesRoot -Filter '*.nuspec.template' -Recurse -File | ForEach-Object { New-Object PSObject -Property @{Directory=$_.DirectoryName; Package=$_.Name.Substring(0, $_.Name.Length - ".nuspec.template".Length)} }
29+
# Grab all command packages to build.
30+
# We'll assume that all directories that contain a *.nuspec.template file is a command package and that the name of the package is everything leading up to .nuspec.template
31+
$commandPackages = Get-ChildItem -path $sourcesRoot -Filter '*.nuspec.template' -Recurse -File |
32+
ForEach-Object { New-Object PSObject -Property @{Directory=$_.DirectoryName; Package=$_.Name.Substring(0, $_.Name.Length - ".nuspec.template".Length)} } |
33+
Where-Object -Property Package -Like -Value $commandPackagesToBuild |
34+
Where-Object -Property Package -NotLike -Value $exceptCommandPackagesToBuild
3435

35-
foreach($commandPackage in $commandPackages)
36-
{
37-
$commandPackageName = $commandPackage.Package
38-
$commandPackageDir = $commandPackage.Directory
39-
$buildOutputDirectory = Join-Path -path $commandPackageDir -ChildPath "bin\Debug\publish"
36+
foreach($commandPackage in $commandPackages)
37+
{
38+
$commandPackageName = $commandPackage.Package
39+
$commandPackageDir = $commandPackage.Directory
40+
$buildOutputDirectory = Join-Path -path $commandPackageDir -ChildPath "bin\Debug\publish"
4041

4142

42-
Invoke-Expression "& $buildProfileScriptPath $commandPackageDir $commandPackageName $buildOutputDirectory $packageVersion $dropLocation\CommandRepo"
43-
}
43+
Invoke-Expression "& $buildProfileScriptPath $commandPackageDir $commandPackageName $buildOutputDirectory $packageVersion $dropLocation\CommandRepo"
4444
}
4545

4646
if (!($excludeCluRun))

0 commit comments

Comments
 (0)