Browse Source

Merge pull request #30 from shiftbot/scripts-cleanup

cleanup build scripts
Brendan Forster 9 năm trước cách đây
mục cha
commit
05acd81561
4 tập tin đã thay đổi với 37 bổ sung20 xóa
  1. 0 1
      Ix.NET/Source/Tests/AssertEx.cs
  2. 9 11
      Ix.NET/Source/build-new.ps1
  3. 14 8
      Rx.NET/Source/build-new.ps1
  4. 14 0
      build.ps1

+ 0 - 1
Ix.NET/Source/Tests/AssertEx.cs

@@ -4,7 +4,6 @@ using System;
 
 namespace Tests
 {
-    [Obsolete("Switch over to xUnit asserts wherever possible")]
     internal class AssertEx
     {
         internal static void Throws<T>(Action action)

+ 9 - 11
Ix.NET/Source/build-new.ps1

@@ -1,25 +1,23 @@
+$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
+
 $msbuild = Get-ItemProperty "hklm:\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0"
-# TODO: if not found, bail out
 
+# TODO: if not found, bail out
 $msbuildExe = Join-Path $msbuild.MSBuildToolsPath "msbuild.exe"
-$build = "1.0.0-rc1-update1"
-
-Write-Host "Setting DNVM version" -Foreground Green
-dnvm use $build -r clr -arch x64 -p
-
-$runtimeDir = Join-Path $env:USERPROFILE "\.dnx\runtimes\dnx-clr-win-x64.$build"
 
 Write-Host "Restoring packages" -Foreground Green
-dnu restore . --quiet | out-null
+dnu restore $scriptPath --quiet | out-null
 
 Write-Host "Building projects" -Foreground Green
-$projects = gci . -Directory `
+$projects = gci $scriptPath -Directory `
   | Where-Object { Test-Path (Join-Path $_.FullName "project.json")  } `
-  | Select -ExpandProperty Name
+  | Select -ExpandProperty FullName
 
 foreach ($project in $projects) {
   dnu build $project --quiet
 }
 
 Write-Host "Running tests" -Foreground Green
-dnx -p "Tests" test
+$testDirectory = Join-Path $scriptPath "Tests"
+dnx -p $testDirectory test
+

+ 14 - 8
Rx.NET/Source/build-new.ps1

@@ -1,19 +1,25 @@
+$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
+
 $msbuild = Get-ItemProperty "hklm:\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0"
-# TODO: if not found, bail out
 
+# TODO: if not found, bail out
 $msbuildExe = Join-Path $msbuild.MSBuildToolsPath "msbuild.exe"
-$build = "1.0.0-rc1-update1"
 
-Write-Host "Setting DNVM version" -Foreground Green
-dnvm use $build -r clr -arch x64 -p
+$active = dnvm list -PassThru | Where-Object {$_.Active -eq $true }
+
+$version = $active | Select -ExpandProperty Version
+$runtime = $active | Select -ExpandProperty Runtime
+$architecture = $active | Select -ExpandProperty Architecture
 
-$runtimeDir = Join-Path $env:USERPROFILE "\.dnx\runtimes\dnx-clr-win-x64.$build"
+$runtimeDir = Join-Path $env:USERPROFILE "\.dnx\runtimes\dnx-$runtime-win-$architecture.$version"
 
 Write-Host "Restoring packages" -Foreground Green
-dnu restore . --quiet | out-null
+dnu restore $scriptPath --quiet | out-null
 
 Write-Host "Building projects" -Foreground Green
-. $msbuildExe .\Rx-New.sln /m /p:Configuration=Release /p:RuntimeToolingDirectory=$runtimeDir /v:q
+$solutionPath = Join-Path $scriptPath "Rx-New.sln"
+. $msbuildExe $solutionPath /m /p:Configuration=Release /p:RuntimeToolingDirectory=$runtimeDir /v:q
 
 Write-Host "Running tests" -Foreground Green
-dnx -p "Tests.System.Reactive" test
+$testDirectory = Join-Path $scriptPath "Tests.System.Reactive"
+dnx -p $testDirectory test

+ 14 - 0
build.ps1

@@ -0,0 +1,14 @@
+Param(
+  [string]$build = "1.0.0-rc1-update1",
+  [string]$runtime = "clr",
+  [string]$architecture = "x64"
+)
+
+Write-Host "Setting DNVM version" -Foreground Green
+dnvm use $build -r $runtime -arch $architecture -p
+
+Write-Host "Building Rx.NET" -ForegroundColor Green
+.\Rx.NET\Source\build-new
+
+Write-Host "Building Ix.NET" -ForegroundColor Green
+.\Ix.NET\Source\build-new