Skip to content

Commit ce01397

Browse files
author
Kapil Borle
committed
Add options to buildCoreClr script
1 parent 3dbfedd commit ce01397

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

buildCoreClr.ps1

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
param(
2-
[switch]$build,
3-
[switch]$uninstall,
4-
[switch]$install
2+
[switch]$Build,
3+
[switch]$Uninstall,
4+
[switch]$Install,
5+
6+
[ValidateSet("net451", "netstandard1.6")]
7+
[string]$Framework = "netstandard1.6",
8+
9+
[ValidateSet("Debug", "Release")]
10+
[string]$Configuration = "Debug"
511
)
612

713
$solutionDir = Split-Path $MyInvocation.InvocationName
@@ -10,16 +16,20 @@ if (-not (Test-Path "$solutionDir/global.json"))
1016
throw "Not in solution root"
1117
}
1218

13-
$itemsToCopyCoreCLR = @("$solutionDir\Engine\bin\Debug\netcoreapp1.0\Microsoft.Windows.PowerShell.ScriptAnalyzer.dll",
14-
"$solutionDir\Rules\bin\Debug\netcoreapp1.0\Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.dll")
19+
$itemsToCopyBinaries = @("$solutionDir\Engine\bin\$Configuration\$Framework\Microsoft.Windows.PowerShell.ScriptAnalyzer.dll",
20+
"$solutionDir\Rules\bin\$Configuration\$Framework\Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.dll")
1521

1622
$itemsToCopyCommon = @("$solutionDir\Engine\PSScriptAnalyzer.psd1",
1723
"$solutionDir\Engine\PSScriptAnalyzer.psm1",
1824
"$solutionDir\Engine\ScriptAnalyzer.format.ps1xml",
1925
"$solutionDir\Engine\ScriptAnalyzer.types.ps1xml")
2026

2127
$destinationDir = "$solutionDir/out/PSScriptAnalyzer"
22-
$destinationDirCoreCLR = "$destinationDir/coreclr"
28+
$destinationDirBinaries = "$destinationDir"
29+
if ($Framework -eq "netstandard1.6")
30+
{
31+
$destinationDirBinaries = "$destinationDir/coreclr"
32+
}
2333

2434
if ($build)
2535
{
@@ -47,7 +57,7 @@ if ($build)
4757
CopyToDestinationDir $itemsToCopyCommon $destinationDir
4858
(Get-Content "$destinationDir\PSScriptAnalyzer.psd1") -replace "ModuleVersion = '1.6.0'","ModuleVersion = '0.0.1'" | Out-File "$destinationDir\PSScriptAnalyzer.psd1" -Encoding ascii
4959

50-
CopyToDestinationDir $itemsToCopyCoreCLR $destinationDirCoreCLR
60+
CopyToDestinationDir $itemsToCopyBinaries $destinationDirBinaries
5161
}
5262

5363
$modulePath = "$HOME\Documents\WindowsPowerShell\Modules";

0 commit comments

Comments
 (0)