Browse Source

add refgen

Oren Novotny 9 years ago
parent
commit
aa71b9c156
2 changed files with 20 additions and 4 deletions
  1. 1 0
      Rx.NET/Source/NuGet.Config
  2. 19 4
      Rx.NET/Source/build-new.ps1

+ 1 - 0
Rx.NET/Source/NuGet.Config

@@ -3,6 +3,7 @@
   <packageSources>
     <clear />
     <add key="Build Packages" value="https://www.myget.org/F/c037199d-41df-4567-b966-25ff65324688/api/v3/index.json" />
+    <add key="CI (RefGen)" value="https://www.myget.org/F/refgen/api/v3/index.json" />
     <add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />    
     <add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
   </packageSources>

+ 19 - 4
Rx.NET/Source/build-new.ps1

@@ -2,6 +2,8 @@ $scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
 
 $configuration = "Release"
 
+$nuspecDir = Join-Path $scriptPath "NuSpecs"
+
 if (!(Test-Path .\nuget.exe)) {
     wget "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" -outfile .\nuget.exe
 }
@@ -20,20 +22,33 @@ $version = $versionObj.NuGetVersionV2
 
 Write-Host "Version: $version"
 
+# Get Reference Generator
+.\nuget.exe install -excludeversion -pre NuSpec.ReferenceGenerator -outputdirectory packages
+
 Write-Host "Restoring packages" -Foreground Green
 dotnet restore $scriptPath | out-null
 
 Write-Host "Building projects" -Foreground Green
 $projects = gci $scriptPath -Directory `
   | Where-Object { Test-Path (Join-Path $_.FullName "project.json")  } `
-  | Select -ExpandProperty FullName
 
 foreach ($project in $projects) {
-  dotnet build -c "$configuration" $project
+  dotnet build -c "$configuration" $project.FullName  
+  
+  $ns = Join-Path $nuSpecDir "$($project.Name).nuspec"  
+    
+  if(Test-Path $ns)
+  {
+    Write-Host "Invoking RefGen on $ns" 
+    
+    $baseDir = Join-Path $project.FullName "bin" | join-path -ChildPath "$configuration"
+    $projJson = Join-Path $project.FullName "project.json"    
+    
+    Write-Host RefGen.exe `"$projJson`" `"$baseDir`" `"$($project.Name).dll`" `"$ns`"
+    .\packages\nuspec.referencegenerator\tools\RefGen.exe "$projJson" "$baseDir" "$($project.Name).dll" "$ns"
+  }
 }
 
-$nuspecDir = Join-Path $scriptPath "NuSpecs"
-
 Write-Host "Building Packages" -Foreground Green
 $nuspecs = ls $nuspecDir\*.nuspec | Select -ExpandProperty FullName