瀏覽代碼

Update build script to work with cli

Oren Novotny 8 年之前
父節點
當前提交
916603a08a

+ 0 - 23
Ix.NET/Source/NuSpecs/System.Interactive.Async.Providers.nuspec

@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
-  <metadata>
-    <id>System.Interactive.Async.Providers</id>
-    <version>$version$</version>
-    <authors>.NET Foundation and Contributors</authors>
-    <owners>Microsoft,RxTeam</owners>
-    <licenseUrl>http://go.microsoft.com/fwlink/?LinkID=261272</licenseUrl>
-    <projectUrl>http://go.microsoft.com/fwlink/?LinkId=261273</projectUrl>
-    <iconUrl>http://go.microsoft.com/fwlink/?LinkId=261274</iconUrl>
-    <requireLicenseAcceptance>false</requireLicenseAcceptance>
-    <description>Interactive Extensions Providers Library used to build async query providers and express queries over enumerable sequences.</description>
-    <copyright>Copyright (c) .NET Foundation and Contributors. All Rights Reserved</copyright>
-    <language>en-US</language>
-    <tags>Ix Interactive Extensions Enumerable Async</tags>
-    <dependencies>
-      <dependency id="System.Interactive.Async" version="$version$" />
-    </dependencies>
-  </metadata>
-  <files>
-    <file src="..\System.Interactive.Async.Providers\bin\$configuration$\**\System.Interactive.Async.Providers.*" exclude="**\*.deps.json" target="lib" />
-  </files>
-</package>

+ 0 - 27
Ix.NET/Source/NuSpecs/System.Interactive.Async.nuspec

@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
-  <metadata>
-    <id>System.Interactive.Async</id>
-    <title>System.Interactive.Async (Ix Async)</title>
-    <version>$version$</version>
-    <authors>.NET Foundation and Contributors</authors>
-    <owners>Microsoft,RxTeam</owners>
-    <licenseUrl>http://go.microsoft.com/fwlink/?LinkID=261272</licenseUrl>
-    <projectUrl>http://go.microsoft.com/fwlink/?LinkId=261273</projectUrl>
-    <iconUrl>http://go.microsoft.com/fwlink/?LinkId=261274</iconUrl>
-    <requireLicenseAcceptance>false</requireLicenseAcceptance>
-    <description>Interactive Extensions (Ix) Async Library used to express queries over asynchronous enumerable sequences.</description>
-    <copyright>Copyright (c) .NET Foundation and Contributors. All Rights Reserved</copyright>
-    <language>en-US</language>
-    <tags>Ix Interactive Extensions Enumerable Asynchronous</tags>
-    <dependencies>
-     <group targetFramework="netstandard1.0">       
-        <dependency id="NETStandard.Library" version="1.6.0" />
-     </group>
-     <group targetFramework="net45" />
-    </dependencies>
-  </metadata>
-  <files>
-    <file src="..\System.Interactive.Async\bin\$configuration$\**\System.Interactive.Async.*" exclude="**\*.deps.json" target="lib" />
-  </files>
-</package>

+ 0 - 23
Ix.NET/Source/NuSpecs/System.Interactive.Providers.nuspec

@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
-  <metadata>
-    <id>System.Interactive.Providers</id>
-    <version>$version$</version>
-    <authors>.NET Foundation and Contributors</authors>
-    <owners>Microsoft,RxTeam</owners>
-    <licenseUrl>http://go.microsoft.com/fwlink/?LinkID=261272</licenseUrl>
-    <projectUrl>http://go.microsoft.com/fwlink/?LinkId=261273</projectUrl>
-    <iconUrl>http://go.microsoft.com/fwlink/?LinkId=261274</iconUrl>
-    <requireLicenseAcceptance>false</requireLicenseAcceptance>
-    <description>Interactive Extensions Providers Library used to build query providers and express queries over enumerable sequences.</description>
-    <copyright>Copyright (c) .NET Foundation and Contributors. All Rights Reserved</copyright>
-    <language>en-US</language>
-    <tags>Ix Interactive Extensions Enumerable</tags>
-    <dependencies>
-      <dependency id="System.Interactive" version="$version$" />
-    </dependencies>
-  </metadata>
-  <files>
-    <file src="..\System.Interactive.Providers\bin\$configuration$\**\System.Interactive.Providers.*" exclude="**\*.deps.json" target="lib" />
-  </files>
-</package>

+ 0 - 27
Ix.NET/Source/NuSpecs/System.Interactive.nuspec

@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
-  <metadata>
-    <id>System.Interactive</id>
-    <title>System.Interactive (Ix)</title>
-    <version>$version$</version>
-    <authors>.NET Foundation and Contributors</authors>
-    <owners>Microsoft,RxTeam</owners>
-    <licenseUrl>http://go.microsoft.com/fwlink/?LinkID=261272</licenseUrl>
-    <projectUrl>http://go.microsoft.com/fwlink/?LinkId=261273</projectUrl>
-    <iconUrl>http://go.microsoft.com/fwlink/?LinkId=261274</iconUrl>
-    <requireLicenseAcceptance>false</requireLicenseAcceptance>
-    <description>Interactive Extensions (Ix) Main Library used to express queries over enumerable sequences.</description>
-    <copyright>Copyright (c) .NET Foundation and Contributors. All Rights Reserved</copyright>
-    <language>en-US</language>
-    <tags>Ix Interactive Extensions Enumerable</tags>
-    <dependencies>
-     <group targetFramework="netstandard1.0">       
-        <dependency id="NETStandard.Library" version="1.6.0" />
-     </group>
-     <group targetFramework="net45" />
-    </dependencies>
-  </metadata>
-  <files>
-    <file src="..\System.Interactive\bin\$configuration$\**\System.Interactive.*" exclude="**\*.deps.json" target="lib" />
-  </files>
-</package>

二進制
Ix.NET/Source/System.Interactive.Tests.Uwp.DeviceRunner/AppPackages/System.Interactive.Tests.Uwp.DeviceRunner_1.0.0.0_x86_Test/System.Interactive.Tests.Uwp.DeviceRunner_1.0.0.0_x86.appx


+ 3 - 2
Ix.NET/Source/System.Interactive.Tests.Uwp.DeviceRunner/System.Interactive.Tests.Uwp.DeviceRunner.csproj

@@ -17,6 +17,7 @@
     <FileAlignment>512</FileAlignment>
     <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
     <PackageCertificateKeyFile>System.Interactive.Tests.Uwp.DeviceRunner_TemporaryKey.pfx</PackageCertificateKeyFile>
+    <PackageCertificateThumbprint>422BF5D1CFB50C975293A3158EA46852395F42CF</PackageCertificateThumbprint>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
     <DebugSymbols>true</DebugSymbols>
@@ -88,9 +89,9 @@
     <UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
   </PropertyGroup>
   <ItemGroup>
-    <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="5.3.0" />
+    <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="5.3.3" />
     <PackageReference Include="xunit" Version="2.2.0" />
-    <PackageReference Include="xunit.runner.devices" Version="2.2.0-rc1" />
+    <PackageReference Include="xunit.runner.devices" Version="2.2.0" />
     <PackageReference Include="FluentAssertions" Version="4.19.2" />
   </ItemGroup>
   <ItemGroup>

二進制
Ix.NET/Source/System.Interactive.Tests.Uwp.DeviceRunner/System.Interactive.Tests.Uwp.DeviceRunner_TemporaryKey.pfx


+ 39 - 33
Ix.NET/Source/build-new.ps1

@@ -16,21 +16,18 @@ $signClientAppPath = Join-Path (Join-Path (Join-Path .\Packages "SignClient") "T
 #remove any old coverage file
 md -Force $outputLocation | Out-Null
 $outputPath = (Resolve-Path $outputLocation).Path
-$outputFileDotCover1 = Join-Path $outputPath -childpath 'coverage-ix1.dcvr'
-$outputFileDotCover2 = Join-Path $outputPath -childpath 'coverage-ix2.dcvr'
-$outputFileDotCover = Join-Path $outputPath -childpath 'coverage-ix.dcvr'
 $outputFile = Join-Path $outputPath -childpath 'coverage-ix.xml'
 Remove-Item $outputPath -Force -Recurse
 md -Force $outputLocation | Out-Null
 
 if (!(Test-Path .\nuget.exe)) {
-    wget "https://dist.nuget.org/win-x86-commandline/v4.0.0/nuget.exe" -outfile .\nuget.exe
+    wget "https://dist.nuget.org/win-x86-commandline/v4.1.0/nuget.exe" -outfile .\nuget.exe
 }
 
 # get tools
 .\nuget.exe install -excludeversion SignClient -Version 0.7.0 -outputdirectory packages
 .\nuget.exe install -excludeversion JetBrains.dotCover.CommandLineTools -pre -outputdirectory packages
-.\nuget.exe install -excludeversion Nerdbank.GitVersioning -Version 2.0.4-beta -pre -outputdirectory packages
+.\nuget.exe install -excludeversion Nerdbank.GitVersioning -Version 2.0.21-beta -pre -outputdirectory packages
 .\nuget.exe install -excludeversion xunit.runner.console -pre -outputdirectory packages
 .\nuget.exe install -excludeversion ReportGenerator -outputdirectory packages
 #.\nuget.exe install -excludeversion coveralls.io -outputdirectory packages
@@ -47,13 +44,19 @@ New-Item -ItemType Directory -Force -Path $artifacts
 
 Write-Host "Restoring packages for $scriptPath\Ix.NET.sln" -Foreground Green
 # use nuget.exe to restore on the legacy proj type
-.\nuget.exe restore "$scriptPath\System.Interactive.Tests.Uwp.DeviceRunner\System.Interactive.Tests.Uwp.DeviceRunner.csproj"
-msbuild "$scriptPath\Ix.NET.sln" /m /t:restore /p:Configuration=$configuration 
+#.\nuget.exe restore "$scriptPath\System.Interactive.Tests.Uwp.DeviceRunner\System.Interactive.Tests.Uwp.DeviceRunner.csproj"
+dotnet restore "$scriptPath\Ix.NET.sln" -c $configuration 
 # Force a restore again to get proper version numbers https://github.com/NuGet/Home/issues/4337
-msbuild "$scriptPath\Ix.NET.sln" /m /t:restore /p:Configuration=$configuration 
+dotnet restore "$scriptPath\Ix.NET.sln"
 
 Write-Host "Building $scriptPath\Ix.NET.sln" -Foreground Green
-msbuild "$scriptPath\Ix.NET.sln" /m /t:build /p:Configuration=$configuration 
+
+# Using MSBuild here since th UWP test project cannot be built by the dotnet CLI
+#msbuild "$scriptPath\Ix.NET.sln" /m /t:build /p:Configuration=$configuration 
+
+
+Write-Host "Building Packages" -Foreground Green
+dotnet pack "$scriptPath\System.Interactive\System.Interactive.csproj" -c $configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
 if ($LastExitCode -ne 0) { 
         Write-Host "Error with build" -Foreground Red
         if($isAppVeyor) {
@@ -62,12 +65,32 @@ if ($LastExitCode -ne 0) {
         }  
 }
 
+dotnet pack "$scriptPath\System.Interactive.Async\System.Interactive.Async.csproj" -c $configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
+if ($LastExitCode -ne 0) { 
+        Write-Host "Error with build" -Foreground Red
+        if($isAppVeyor) {
+          $host.SetShouldExit($LastExitCode)
+          exit $LastExitCode
+        }  
+}
 
-Write-Host "Building Packages" -Foreground Green
-msbuild "$scriptPath\System.Interactive\System.Interactive.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
-msbuild "$scriptPath\System.Interactive.Async\System.Interactive.Async.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
-msbuild "$scriptPath\System.Interactive.Async.Providers\System.Interactive.Async.Providers.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
-msbuild "$scriptPath\System.Interactive.Providers\System.Interactive.Providers.csproj" /t:pack /p:Configuration=$configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
+dotnet pack "$scriptPath\System.Interactive.Async.Providers\System.Interactive.Async.Providers.csproj" -c $configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
+if ($LastExitCode -ne 0) { 
+        Write-Host "Error with build" -Foreground Red
+        if($isAppVeyor) {
+          $host.SetShouldExit($LastExitCode)
+          exit $LastExitCode
+        }  
+}
+
+dotnet pack "$scriptPath\System.Interactive.Providers\System.Interactive.Providers.csproj" -c $configuration /p:PackageOutputPath=$artifacts /p:NoPackageAnalysis=true
+if ($LastExitCode -ne 0) { 
+        Write-Host "Error with build" -Foreground Red
+        if($isAppVeyor) {
+          $host.SetShouldExit($LastExitCode)
+          exit $LastExitCode
+        }  
+}
 
 if($hasSignClientSecret) {
   Write-Host "Signing Packages" -Foreground Green	
@@ -97,9 +120,9 @@ $testDirectory = Join-Path $scriptPath "Tests"
 
 # OpenCover isn't working currently. So run tests on CI and coverage with JetBrains 
 
-# Run .NET Core only for now until perf improves on the runner for .net desktop
+# Use xUnit CLI as it's significantly faster than vstest (dotnet test)
 $dotnet = "$env:ProgramFiles\dotnet\dotnet.exe"
-.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe cover /targetexecutable="$dotnet" /targetworkingdir="$testDirectory" /targetarguments="test -c $configuration --no-build -f netcoreapp1.1" /output="$outputFileDotCover1" /Filters="+:module=System.Interactive;+:module=System.Interactive.Async;+:module=System.Interactive.Providers;+:module=System.Interactive.Async.Providers;-:type=Xunit*" /DisableDefaultFilters /ReturnTargetExitCode /AttributeFilters="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute"
+.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe analyse /targetexecutable="$dotnet" /targetworkingdir="$testDirectory" /targetarguments="xunit -c $configuration" /Filters="+:module=System.Interactive;+:module=System.Interactive.Async;+:module=System.Interactive.Providers;+:module=System.Interactive.Async.Providers;-:type=Xunit*" /DisableDefaultFilters /ReturnTargetExitCode /AttributeFilters="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute" /output="$outputFile" /ReportType=DetailedXML /HideAutoProperties
 
 if ($LastExitCode -ne 0) { 
 	Write-Host "Error with tests" -Foreground Red
@@ -109,23 +132,6 @@ if ($LastExitCode -ne 0) {
 	}  
 }
 
-# run .net desktop tests
-.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe cover /targetexecutable="$xUnitConsolePath" /targetworkingdir="$testDirectory\bin\$configuration\net461\" /targetarguments="Tests.dll" /output="$outputFileDotCover2" /Filters="+:module=System.Interactive;+:module=System.Interactive.Async;+:module=System.Interactive.Providers;+:module=System.Interactive.Async.Providers;-:type=Xunit*" /DisableDefaultFilters /ReturnTargetExitCode /AttributeFilters="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute"
-
-if ($LastExitCode -ne 0) { 
-	Write-Host "Error with tests" -Foreground Red
-	if($isAppVeyor) {
-	  $host.SetShouldExit($LastExitCode)
-	  exit $LastExitCode
-	}  
-}
-
-# For perf, we need to use the xunit console runner, but that generates two reports. merge into one and generate the detailed xml output
-
-.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe merge /Source="$outputFileDotCover1;$outputFileDotCover2" /Output="$outputFileDotCover"
-.\packages\JetBrains.dotCover.CommandLineTools\tools\dotCover.exe report /Source="$outputFileDotCover" /Output="$outputFile" /ReportType=DetailedXML /HideAutoProperties
-
-
 # Either display or publish the results
 if ($env:CI -eq 'True')
 {