|
|
@@ -2,10 +2,10 @@ $scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
|
|
|
|
|
|
$configuration = "Release"
|
|
|
|
|
|
-$nuspecDir = Join-Path $scriptPath "NuSpecs"
|
|
|
$isAppVeyor = Test-Path -Path env:\APPVEYOR
|
|
|
$outputLocation = Join-Path $scriptPath "testResults"
|
|
|
$openCoverPath = ".\packages\OpenCover\tools\OpenCover.Console.exe"
|
|
|
+$artifacts = Join-Path $scriptPath "artifacts"
|
|
|
|
|
|
$signClientSettings = Join-Path (Join-Path (Get-Item $scriptPath).Parent.Parent.FullName "scripts") "SignClientSettings.json"
|
|
|
$hasSignClientSecret = !([string]::IsNullOrEmpty($env:SignClientSecret))
|
|
|
@@ -21,90 +21,21 @@ md -Force $outputLocation | Out-Null
|
|
|
if (!(Test-Path .\nuget.exe)) {
|
|
|
wget "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" -outfile .\nuget.exe
|
|
|
}
|
|
|
-$msbuild = Get-ItemProperty "hklm:\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0"
|
|
|
|
|
|
-# TODO: if not found, bail out
|
|
|
-$msbuildExe = Join-Path $msbuild.MSBuildToolsPath "msbuild.exe"
|
|
|
-
|
|
|
-# get version
|
|
|
-.\nuget.exe install -excludeversion gitversion.commandline -pre -outputdirectory packages
|
|
|
+# get tools
|
|
|
.\nuget.exe install -excludeversion SignClient -Version 0.5.0-beta4 -pre -outputdirectory packages
|
|
|
.\nuget.exe install -excludeversion OpenCover -outputdirectory packages
|
|
|
.\nuget.exe install -excludeversion ReportGenerator -outputdirectory packages
|
|
|
.\nuget.exe install -excludeversion coveralls.io -outputdirectory packages
|
|
|
|
|
|
+New-Item -ItemType Directory -Force -Path .\artifacts
|
|
|
|
|
|
-#update version
|
|
|
-.\packages\gitversion.commandline\tools\gitversion.exe /l console /output buildserver /updateassemblyinfo
|
|
|
-
|
|
|
-$versionObj = .\packages\gitversion.commandline\tools\gitversion.exe | ConvertFrom-Json
|
|
|
-
|
|
|
-$version = $versionObj.MajorMinorPatch
|
|
|
-$tag = $versionObj.PreReleaseLabel
|
|
|
-$preRelNum = $versionObj.CommitsSinceVersionSourcePadded
|
|
|
-$preRelNum2 = $versionObj.PreReleaseNumber
|
|
|
-
|
|
|
-if($tag -ne ""){
|
|
|
- if($preRelNum -ne "00000") {
|
|
|
- $version = "$version-$tag-$preRelNum"
|
|
|
- }
|
|
|
- elseif ($preRelNum2 -ne "0") {
|
|
|
- $version = "$version-$tag$preRelNum2"
|
|
|
- }
|
|
|
- else {
|
|
|
- $version = "$version-$tag"
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-Write-Host "Version: $version"
|
|
|
-
|
|
|
-Write-Host "Restoring packages" -Foreground Green
|
|
|
-dotnet restore $scriptPath | out-null
|
|
|
-
|
|
|
-#need to ensure core is built first due to bad dependency order determination by dotnet build
|
|
|
-
|
|
|
-$coreDir = gci $scriptPath -Directory | where-object {$_.Name -eq "System.Reactive.Core"} | Select -First 1
|
|
|
-dotnet build -c "$configuration" $coreDir.FullName
|
|
|
-
|
|
|
-Write-Host "Building projects" -Foreground Green
|
|
|
-$projects = gci $scriptPath -Directory `
|
|
|
- | Where-Object { ($_.Name -notlike "*DeviceRunner") -and (Test-Path (Join-Path $_.FullName "project.json")) } `
|
|
|
-
|
|
|
-foreach ($project in $projects) {
|
|
|
- dotnet build -c "$configuration" $project.FullName
|
|
|
- if ($LastExitCode -ne 0) {
|
|
|
- Write-Host "Error building project $project" -Foreground Red
|
|
|
- if($isAppVeyor) {
|
|
|
- $host.SetShouldExit($LastExitCode)
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-Write-Host "Building Packages" -Foreground Green
|
|
|
-$nuspecs = ls $nuspecDir\*.nuspec | Select -ExpandProperty FullName
|
|
|
+Write-Host "Restoring packages for $scriptPath\System.Reactive.sln" -Foreground Green
|
|
|
+msbuild "$scriptPath\System.Reactive.sln" /t:restore /p:Configuration=$configuration
|
|
|
|
|
|
-New-Item -ItemType Directory -Force -Path .\artifacts
|
|
|
+Write-Host "Building $scriptPath\System.Reactive\System.Reactive.csproj" -Foreground Green
|
|
|
+msbuild "$scriptPath\System.Reactive\System.Reactive.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=.\artifacts
|
|
|
|
|
|
-foreach ($nuspec in $nuspecs)
|
|
|
-{
|
|
|
- $symbolSwitch = "-symbols"
|
|
|
-
|
|
|
- # nuget will error if we pass -symbols to the meta-package
|
|
|
- if($nuSpec -like "*\System.Reactive.nuspec")
|
|
|
- {
|
|
|
- $symbolSwitch = ""
|
|
|
- }
|
|
|
-
|
|
|
- .\nuget pack $nuspec $symbolSwitch -Version $version -Properties "Configuration=$configuration" -MinClientVersion 2.12 -outputdirectory .\artifacts
|
|
|
- if ($LastExitCode -ne 0) {
|
|
|
- Write-Host "Error packing NuGet $nuspec" -Foreground Red
|
|
|
- if($isAppVeyor) {
|
|
|
- $host.SetShouldExit($LastExitCode)
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
|
|
|
if($hasSignClientSecret) {
|
|
|
Write-Host "Signing Packages" -Foreground Green
|
|
|
@@ -128,6 +59,8 @@ if($hasSignClientSecret) {
|
|
|
Write-Host "Client Secret not found, not signing packages"
|
|
|
}
|
|
|
|
|
|
+exit # TODO
|
|
|
+
|
|
|
Write-Host "Running tests" -Foreground Green
|
|
|
$testDirectory = Join-Path $scriptPath "Tests.System.Reactive"
|
|
|
|
|
|
@@ -150,9 +83,4 @@ else
|
|
|
{
|
|
|
.\packages\ReportGenerator\tools\ReportGenerator.exe -reports:"$outputFile" -targetdir:"$outputPath"
|
|
|
&$outPutPath/index.htm
|
|
|
-}
|
|
|
-
|
|
|
-if ($env:CI -ne 'True') {
|
|
|
- Write-Host "Reverting AssemblyInfo's" -Foreground Green
|
|
|
- gci $scriptPath -re -in AssemblyInfo.cs | %{ git checkout $_ }
|
|
|
}
|