Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit a0976ec

Browse files
committed
update build
1 parent 61c8d76 commit a0976ec

File tree

3 files changed

+34
-13
lines changed

3 files changed

+34
-13
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# directories created during build
22
bin/
33
obj/
4+
out/
45
project.lock.json
56

67
# VSCode directories that are not at the repository root

build.ps1

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,34 @@
1-
# Copyright (c) Microsoft Corporation. All rights reserved.
2-
# Licensed under the MIT License.
1+
2+
## Copyright (c) Microsoft Corporation.
3+
## Licensed under the MIT License.
34

45
[CmdletBinding()]
5-
param(
6-
[switch] $Clean = $false
6+
param (
7+
[Parameter()]
8+
[string]
9+
$Configuration = "Debug",
10+
11+
[Parameter()]
12+
[switch]
13+
$Clean
714
)
815

9-
Push-Location $PSScriptRoot/src/code
10-
if ($Clean) {
11-
Remove-Item -Recurse -Path ./bin -Force -ErrorAction SilentlyContinue
12-
Remove-Item -Recurse -Path ./obj -Force -ErrorAction SilentlyContinue
13-
}
16+
try {
17+
Push-Location "$PSScriptRoot/src/code"
18+
19+
$outPath = "$PSScriptRoot/out"
1420

15-
dotnet build
16-
Pop-Location
21+
if ($Clean) {
22+
if (Test-Path $outPath) {
23+
Write-Verbose "Deleting $outPath"
24+
Remove-Item -recurse -force -path $outPath
25+
}
26+
27+
dotnet clean
28+
}
29+
30+
dotnet publish --output "$PSScriptRoot/out" --configuration $Configuration
31+
}
32+
finally {
33+
Pop-Location
34+
}

src/code/Microsoft.PowerShell.TextUtility.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
<FileVersion>1.0.0</FileVersion>
1010
<InformationalVersion>1.0.0</InformationalVersion>
1111
<TargetFramework>netstandard2.0</TargetFramework>
12-
</PropertyGroup>
13-
12+
<IsPackable>true</IsPackable>
13+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
14+
</PropertyGroup>
15+
1416
<ItemGroup>
1517
<PackageReference Include="PowerShellStandard.Library" Version="5.1.0-*" />
1618
</ItemGroup>

0 commit comments

Comments
 (0)