Skip to content

Commit 1ed48e7

Browse files
author
Kapil Borle
committed
Modify build task to take in parameters
1 parent 10a4fdb commit 1ed48e7

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

.build.ps1

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,25 @@ $resourceScript = Join-Path $BuildRoot "New-StronglyTypedCsFileForResx.ps1"
1010
$outPath = "$BuildRoot/out"
1111
$modulePath = "$outPath/PSScriptAnalyzer"
1212

13+
$buildData = @{}
14+
if ($BuildTask -eq "release") {
15+
$buildData = @{
16+
Frameworks = @{
17+
"net451" = @{
18+
Configuration = @('Release', "PSV3Release")
19+
}
20+
"netstandard1.6" = @{
21+
Configuration = @('Release')
22+
}
23+
}
24+
}
25+
}
26+
else {
27+
$buildData.Add("Frameworks", @{})
28+
$buildData["Frameworks"].Add($Framework, @{})
29+
$buildData["Frameworks"][$Framework].Add("Configuration", $Configuration)
30+
}
31+
1332
function CreateIfNotExists([string] $folderPath) {
1433
if (-not (Test-Path $folderPath)) {
1534
New-Item -Path $folderPath -ItemType Directory -Verbose:$verbosity
@@ -36,7 +55,16 @@ function Get-BuildOutputs($project) {
3655

3756
function Get-BuildTaskParams($project) {
3857
$taskParams = @{
39-
Jobs = {dotnet build --framework $Framework --configuration $Configuration}
58+
Data = $buildData
59+
Jobs = {
60+
$d = $($Task.Data)
61+
foreach ($frmwrk in $d.Frameworks.Keys) {
62+
foreach ($config in $d.Frameworks[$frmwrk].Configuration) {
63+
Write-Verbose -message "$config $framework" -Verbose:$true
64+
dotnet build --framework $frmwrk --configuration $config
65+
}
66+
}
67+
}
4068
}
4169

4270
$outputs = (Get-BuildOutputs $project)

0 commit comments

Comments
 (0)