diff --git a/TestFx.sln b/TestFx.sln index 33d02154c..71f533abb 100644 --- a/TestFx.sln +++ b/TestFx.sln @@ -86,7 +86,6 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Package", "Package", "{E374A3A6-C364-4890-B315-D60F5C682B6E}" ProjectSection(SolutionItems) = preProject src\Package\MSTest.Internal.TestFx.Documentation.nuspec = src\Package\MSTest.Internal.TestFx.Documentation.nuspec - src\Package\MSTest.TestAdapter.Dotnet.nuspec = src\Package\MSTest.TestAdapter.Dotnet.nuspec src\Package\MSTest.TestAdapter.Enu.nuspec = src\Package\MSTest.TestAdapter.Enu.nuspec src\Package\MSTest.TestAdapter.nuspec = src\Package\MSTest.TestAdapter.nuspec src\Package\MSTest.TestAdapter.symbols.nuspec = src\Package\MSTest.TestAdapter.symbols.nuspec @@ -142,8 +141,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "targets", "targets", "{F60B ProjectSection(SolutionItems) = preProject scripts\build\TestFx.Loc.targets = scripts\build\TestFx.Loc.targets scripts\build\TestFx.Settings.targets = scripts\build\TestFx.Settings.targets - scripts\build\TestFx.Versions.targets = scripts\build\TestFx.Versions.targets scripts\build\TestFx.targets = scripts\build\TestFx.targets + scripts\build\TestFx.Versions.targets = scripts\build\TestFx.Versions.targets EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{BCF525B1-E67F-486D-B091-06A8BB8A2793}" @@ -186,7 +185,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeploymentTestProjectNetCor EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TimeoutTestProjectNetCore", "test\E2ETests\TestAssets\TimeoutTestProjectNetCore\TimeoutTestProjectNetCore.csproj", "{ED27A844-6870-4FE6-8FEF-3ABDD1ED6564}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharpTestProject", "test\E2ETests\TestAssets\FSharpTestProject\FSharpTestProject.fsproj", "{E5E58613-82FC-44CD-B75F-4F1C7ED52D0D}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharpTestProject", "test\E2ETests\TestAssets\FSharpTestProject\FSharpTestProject.fsproj", "{E5E58613-82FC-44CD-B75F-4F1C7ED52D0D}" EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution diff --git a/scripts/Build.ps1 b/scripts/Build.ps1 index 618ab1f4d..1e83bcd09 100644 --- a/scripts/Build.ps1 +++ b/scripts/Build.ps1 @@ -49,6 +49,9 @@ Param( [Alias("tpv")] [string] $TestPlatformVersion = $null, + [Alias("np")] + [Switch] $DisallowPrereleaseMSBuild, + [Alias("f")] [Switch] $Force, @@ -111,20 +114,23 @@ function Print-Help { Write-Host -object "" Write-Host -object "********* MSTest Adapter Build Script *********" Write-Host -object "" - Write-Host -object " Help (-h) - [Switch] - Prints this help message." - Write-Host -object " Clean (-cl) - [Switch] - Indicates that this should be a clean build." - Write-Host -object " SkipRestore (-sr) - [Switch] - Indicates nuget package restoration should be skipped." - Write-Host -object " ClearPackageCache (-cache) - [Switch] - Indicates local package cache should be cleared before restore." - Write-Host -object " Updatexlf (-uxlf) - [Switch] - Indicates that there are resource changes and that these need to be copied to other languages as well." - Write-Host -object " IsLocalizedBuild (-loc) - [Switch] - Indicates that the build needs to generate resource assemblies as well." - Write-Host -object " Official - [Switch] - Indicates that this is an official build. Only used in CI builds." - Write-Host -object " Full - [Switch] - Indicates to perform a full build which includes Adapter, Framework" + Write-Host -object " Help (-h) - [switch] - Prints this help message." + Write-Host -object " Clean (-cl) - [switch] - Indicates that this should be a clean build." + Write-Host -object " SkipRestore (-sr) - [switch] - Indicates nuget package restoration should be skipped." + Write-Host -object " ClearPackageCache (-cache) - [switch] - Indicates local package cache should be cleared before restore." + Write-Host -object " Updatexlf (-uxlf) - [switch] - Indicates that there are resource changes and that these need to be copied to other languages as well." + Write-Host -object " IsLocalizedBuild (-loc) - [switch] - Indicates that the build needs to generate resource assemblies as well." + Write-Host -object " Official - [switch] - Indicates that this is an official build. Only used in CI builds." + Write-Host -object " Full - [switch] - Indicates to perform a full build which includes Adapter, Framework" + Write-Host -object " DisallowPrereleaseMSBuild (-np) - [switch] - Uses an RTM version of MSBuild to build the projects" + Write-Host -object "" + Write-Host -object " Configuration (-c) - [string] - Specifies the build configuration. Defaults to 'Debug'." + Write-Host -object " FrameworkVersion (-fv) - [string] - Specifies the version of the Test Framework nuget package." + Write-Host -object " AdapterVersion (-av) - [string] - Specifies the version of the Test Adapter nuget package." + Write-Host -object " VersionSuffix (-vs) - [string] - Specifies the version suffix for the nuget packages." + Write-Host -object " Target - [string] - Specifies the build target. Defaults to 'Build'." Write-Host -object "" - Write-Host -object " Configuration (-c) - [String] - Specifies the build configuration. Defaults to 'Debug'." - Write-Host -object " FrameworkVersion (-fv) - [String] - Specifies the version of the Test Framework nuget package." - Write-Host -object " AdapterVersion (-av) - [String] - Specifies the version of the Test Adapter nuget package." - Write-Host -object " VersionSuffix (-vs) - [String] - Specifies the version suffix for the nuget packages." - Write-Host -object " Target - [String] - Specifies the build target. Defaults to 'Build'." + Write-Host -object " Steps (-s) - [string[]] - List of build steps to run, valid steps: `"UpdateTPVersion`", `"Restore`", `"Build`", `"Publish`"" Write-Host -object "" Exit 0 @@ -259,6 +265,8 @@ function Create-NugetPackages { Copy-Item $tfSrcPackageDir\$file $stagingDir -Force } + Copy-Item -Path "$($env:TF_PACKAGES_DIR)\microsoft.testplatform.adapterutilities\$TestPlatformVersion\lib" -Destination "$($stagingDir)\Microsoft.TestPlatform.AdapterUtilities" -Recurse -Force + # Copy over LICENSE file to staging directory $licenseFilePath = Join-Path $env:TF_ROOT_DIR "LICENSE" Copy-Item $licenseFilePath $stagingDir -Force @@ -279,7 +287,7 @@ function Create-NugetPackages { } Write-Verbose "$nugetExe pack $stagingDir\$file -OutputDirectory $packageOutDir -Version=$version -Properties Version=$version" - & $nugetExe pack $stagingDir\$file -OutputDirectory $packageOutDir -Version $version -Properties Version=$version`;Srcroot=$env:TF_SRC_DIR`;Packagesroot=$env:TF_PACKAGES_DIR + & $nugetExe pack $stagingDir\$file -OutputDirectory $packageOutDir -Version $version -Properties Version=$version`;Srcroot=$env:TF_SRC_DIR`;Packagesroot=$env:TF_PACKAGES_DIR`;TestPlatformVersion=$TestPlatformVersion if ($lastExitCode -ne 0) { throw "Nuget pack failed with an exit code of '$lastExitCode'." @@ -299,17 +307,15 @@ function Replace-InFile($File, $RegEx, $ReplaceWith) { } function Sync-PackageVersions { - $versionsFile = "$PSScriptRoot\build\TestFx.Versions.targets" - $versionsRegex = '(?mi)<(TestPlatformVersion.*?)>(.*?)<\/TestPlatformVersion>' $packageRegex = '(?mi)$TestPlatformVersion" + Replace-InFile -File $TF_VERSIONS_FILE -RegEx $versionsRegex -ReplaceWith "<`$1>$TestPlatformVersion" } (Get-ChildItem "$PSScriptRoot\..\src\*packages.config", "$PSScriptRoot\..\test\*packages.config" -Recurse) | ForEach-Object { diff --git a/scripts/common.lib.ps1 b/scripts/common.lib.ps1 index 213eae1fe..91785b438 100644 --- a/scripts/common.lib.ps1 +++ b/scripts/common.lib.ps1 @@ -20,6 +20,10 @@ $env:TF_SRC_DIR = Join-Path $env:TF_ROOT_DIR "src" $env:TF_TEST_DIR = Join-Path $env:TF_ROOT_DIR "test" $env:TF_PACKAGES_DIR = Join-Path $env:TF_ROOT_DIR "packages" +$TF_VERSIONS_FILE = "$PSScriptRoot\build\TestFx.Versions.targets" +if ([String]::IsNullOrWhiteSpace($TestPlatformVersion)) { + $TestPlatformVersion = (([XML](Get-Content $TF_VERSIONS_FILE)).Project.PropertyGroup.TestPlatformVersion).InnerText +} function Create-Directory([string[]] $path) { if (!(Test-Path -path $path)) { @@ -136,7 +140,7 @@ function Locate-VsInstallPath($hasVsixExtension = "false") { Write-Verbose "$vswhere -latest -products * -requires $requiredPackageIds -property installationPath" try { - if ($Official) { + if ($Official -or $DisallowPrereleaseMSBuild) { $vsInstallPath = & $vswhere -latest -products * -requires $requiredPackageIds -property installationPath } else { diff --git a/src/Package/MSTest.TestAdapter.Enu.nuspec b/src/Package/MSTest.TestAdapter.Enu.nuspec index 03e0416cc..2982e3765 100644 --- a/src/Package/MSTest.TestAdapter.Enu.nuspec +++ b/src/Package/MSTest.TestAdapter.Enu.nuspec @@ -24,16 +24,16 @@ - + - + - + @@ -46,15 +46,18 @@ + + + diff --git a/src/Package/MSTest.TestAdapter.nuspec b/src/Package/MSTest.TestAdapter.nuspec index f639e0599..a89adf275 100644 --- a/src/Package/MSTest.TestAdapter.nuspec +++ b/src/Package/MSTest.TestAdapter.nuspec @@ -21,7 +21,7 @@ © Microsoft Corporation. All rights reserved. MSTest TestFramework TestAdapter VisualStudio Unittest MSTestV2 Microsoft - + @@ -75,6 +75,7 @@ + + diff --git a/src/Package/MSTest.TestAdapter.symbols.nuspec b/src/Package/MSTest.TestAdapter.symbols.nuspec index df91647c7..84d1743c8 100644 --- a/src/Package/MSTest.TestAdapter.symbols.nuspec +++ b/src/Package/MSTest.TestAdapter.symbols.nuspec @@ -20,11 +20,11 @@ http://go.microsoft.com/fwlink/?LinkID=288859 © Microsoft Corporation. All rights reserved. MSTest TestFramework TestAdapter VisualStudio Unittest MSTestV2 Microsoft - - - - - + + + + + @@ -33,7 +33,7 @@ - + diff --git a/src/Package/MSTest.TestFramework.enu.nuspec b/src/Package/MSTest.TestFramework.enu.nuspec index 8b0aa95e2..9ed64007c 100644 --- a/src/Package/MSTest.TestFramework.enu.nuspec +++ b/src/Package/MSTest.TestFramework.enu.nuspec @@ -9,14 +9,14 @@ Microsoft This is MSTest V2, the evolution of Microsoft's Test Framework. - This is MSTest V2, the evolution of Microsoft's Test Framework. + This is MSTest V2, the evolution of Microsoft's Test Framework. - Supported platforms: - - .NET 4.5.0+ - - .NET Core 1.0+ (Universal Windows Apps 10+, DNX Core 5+) - - ASP.NET Core 1.0+ + Supported platforms: + - .NET 4.5.0+ + - .NET Core 1.0+ (Universal Windows Apps 10+, DNX Core 5+) + - ASP.NET Core 1.0+ - To discover and execute tests install MSTest.TestAdapter. + To discover and execute tests install MSTest.TestAdapter. To discover and execute tests for project.json based projects install dotnet-test-mstest. @@ -29,16 +29,16 @@ - + - + - + diff --git a/src/Package/MSTest.TestFramework.symbols.nuspec b/src/Package/MSTest.TestFramework.symbols.nuspec index 11166e7c7..f394319e7 100644 --- a/src/Package/MSTest.TestFramework.symbols.nuspec +++ b/src/Package/MSTest.TestFramework.symbols.nuspec @@ -8,14 +8,14 @@ Microsoft Microsoft - This is MSTest V2, the evolution of Microsoft's Test Framework. + This is MSTest V2, the evolution of Microsoft's Test Framework. - Supported platforms: - - .NET 4.5.0+ - - .NET Core 1.0+ (Universal Windows Apps 10+, DNX Core 5+) - - ASP.NET Core 1.0+ + Supported platforms: + - .NET 4.5.0+ + - .NET Core 1.0+ (Universal Windows Apps 10+, DNX Core 5+) + - ASP.NET Core 1.0+ - To discover and execute tests install MSTest.TestAdapter. + To discover and execute tests install MSTest.TestAdapter. To discover and execute tests for project.json based projects install dotnet-test-mstest. @@ -35,7 +35,7 @@ - +