Skip to content

Commit c7c7ad3

Browse files
authored
version 7 prerelease 1 (PowerShell#77)
* Make sure that TokenTraits type has the proper attribute * remove deleted types and methods * Remove extraneous whitespace * A number of types (and some associated methods) have been removed from Standard 7 * A number of changes needed to nuspec file to bring it up to MS standard
1 parent 6c56952 commit c7c7ad3

13 files changed

+885
-936
lines changed

PowerShellStandard.psm1

+28-10
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
function Start-Build {
22
param ( [switch]$CoreOnly )
3-
$versions = 3,5
3+
# $versions = 3,5
4+
$versions = 5
45
$srcBase = Join-Path $PsScriptRoot src
56
foreach ( $version in $versions ) {
67
try {
78
$srcDir = Join-Path $srcBase $version
89
Push-Location $srcDir
9-
dotnet restore
10+
Write-Verbose -Verbose "restoring in $srcDir"
11+
$result = dotnet restore
12+
if ( ! $? ) { throw "$result" }
1013
if ( $CoreOnly ) {
11-
dotnet build --configuration Release --framework netstandard2.0
14+
Write-Verbose -Verbose "building netstandard in $srcDir"
15+
$result = dotnet build --configuration Release --framework netstandard2.0
16+
if ( ! $? ) { throw "$result" }
1217
}
1318
else {
14-
dotnet build --configuration Release
19+
Write-Verbose -Verbose "building default in $srcDir"
20+
$result = dotnet build --configuration Release
21+
if ( ! $? ) { throw "$result" } else { Write-Verbose -Verbose "$result" }
1522
}
1623
}
1724
finally {
@@ -23,8 +30,12 @@ function Start-Build {
2330
try {
2431
$templateBase = Join-Path $srcBase dotnetTemplate
2532
Push-Location $templateBase
26-
dotnet restore
27-
dotnet build --configuration Release
33+
Write-Verbose -Verbose "restoring in $templateBase"
34+
$result = dotnet restore
35+
if ( ! $? ) { throw "$result" }
36+
Write-Verbose -Verbose "building in $templateBase"
37+
$result = dotnet build --configuration Release
38+
if ( ! $? ) { throw "$result" } else { Write-Verbose -Verbose "$result" }
2839
}
2940
finally {
3041
Pop-Location
@@ -41,7 +52,9 @@ function Start-Clean {
4152
try {
4253
$fileDir = Join-Path $baseDir $version
4354
Push-Location $fileDir
44-
dotnet clean
55+
"Cleaning in $fileDir"
56+
$result = dotnet clean
57+
if ( ! $? ) { write-error "$result" }
4558
if ( test-path obj ) { remove-item -recurse -force obj }
4659
if ( test-path bin ) { remove-item -recurse -force bin }
4760
remove-item "PowerShellStandard.Library.${version}*.nupkg" -ErrorAction SilentlyContinue
@@ -77,11 +90,13 @@ function Invoke-Test {
7790
try {
7891
Push-Location $framework
7992
if ( $CoreOnly ) {
80-
dotnet build --configuration Release --framework netstandard2.0
93+
$result = dotnet build --configuration Release --framework netstandard2.0
94+
if ( ! $? ) { throw "$result" }
8195
Invoke-Pester
8296
}
8397
else {
84-
dotnet build --configuration Release
98+
$result = dotnet build --configuration Release
99+
if ( ! $? ) { throw "$result" }
85100
Invoke-Pester
86101
}
87102
}
@@ -108,12 +123,14 @@ function Export-NuGetPackage
108123
{
109124
# create the package
110125
# it will automatically build
111-
$versions = 3,5
126+
# $versions = 3,5
127+
$versions = 5
112128
$srcBase = Join-Path $PsScriptRoot src
113129
foreach ( $version in $versions ) {
114130
try {
115131
$srcDir = Join-Path $srcBase $version
116132
Push-Location $srcDir
133+
Write-Verbose -Verbose "Creating nupkg for $version"
117134
$result = dotnet pack --configuration Release
118135
if ( $? ) {
119136
Copy-Item -verbose:$true (Join-Path $srcDir "bin/Release/PowerShellStandard.Library*.nupkg") $PsScriptRoot
@@ -130,6 +147,7 @@ function Export-NuGetPackage
130147
try {
131148
$templateDir = Join-Path $PsScriptRoot src/dotnetTemplate
132149
Push-Location $templateDir
150+
Write-Verbose -Verbose "creating nupkg in $templateDir"
133151
$result = dotnet pack --configuration Release
134152
if ( $? ) {
135153
Copy-Item -verbose:$true (Join-Path $templateDir "bin/Release/*.nupkg") $PsScriptRoot

build.ps1

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ param (
66
[Parameter(HelpMessage="Build only for netstandard2.0")][switch]$CoreOnly
77
)
88

9+
Write-Progress -Activity "Importing module"
910
import-module $PSScriptRoot/PowerShellStandard.psm1 -force
1011

1112
if ( $Clean ) {
@@ -20,6 +21,7 @@ if ( $IsLinux -or $IsMacOS ) {
2021
$CoreOnly = $true
2122
}
2223

24+
Write-Progress -Activity "Starting Build"
2325
if ( $Pack ) {
2426
if ( $CoreOnly ) {
2527
Write-Warning "Must build both netstandard2.0 and net452 to build package"
@@ -32,6 +34,9 @@ else {
3234
}
3335

3436
if ( $Test ) {
37+
if ( $psversiontable.psversion.major -lt 6 ) {
38+
throw "Must run tests on PowerShell Core 6 or above"
39+
}
3540
Invoke-Test -CoreOnly:$CoreOnly
3641
}
3742

0 commit comments

Comments
 (0)