Skip to content

Commit

Permalink
Fixed #2814 and #2853.
Browse files Browse the repository at this point in the history
  • Loading branch information
Haplois committed Apr 21, 2021
1 parent 7045302 commit 8950e74
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 6 deletions.
8 changes: 8 additions & 0 deletions scripts/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ function Publish-Package
$netstandard13PackageDir = $(Join-Path $env:TP_OUT_DIR "$TPB_Configuration\$TPB_TargetFrameworkNS13");
$netstandard20PackageDir = $(Join-Path $env:TP_OUT_DIR "$TPB_Configuration\$TPB_TargetFrameworkNS20");
$coreCLR20PackageDir = Get-CoreCLR20PackageDirectory
$coreCLR10PackageDir = Get-CoreCLR10PackageDirectory
$coreCLR20TestHostPackageDir = Get-CoreCLR20TestHostPackageDirectory
$packageProject = Join-Path $env:TP_PACKAGE_PROJ_DIR "package\package.csproj"
$testHostProject = Join-Path $env:TP_ROOT_DIR "src\testhost\testhost.csproj"
Expand Down Expand Up @@ -480,6 +481,8 @@ function Publish-Package
-files @{
$TPB_TargetFramework45 = $fullCLRPackage45Dir # net45
$TPB_TargetFramework451 = $fullCLRPackage451Dir # net451
$TPB_TargetFrameworkCore10 = $coreCLR10PackageDir # netcoreapp1.0
$TPB_TargetFrameworkCore20 = $coreCLR20PackageDir # netcoreapp2.1
$TPB_TargetFrameworkNS10 = $netstandard10PackageDir # netstandard1_0
$TPB_TargetFrameworkNS13 = $netstandard13PackageDir # netstandard1_3
$TPB_TargetFrameworkNS20 = $netstandard20PackageDir # netstandard2_0
Expand Down Expand Up @@ -1042,6 +1045,11 @@ function Get-CoreCLR20PackageDirectory
return $(Join-Path $env:TP_OUT_DIR "$TPB_Configuration\$TPB_TargetFrameworkCore20")
}

function Get-CoreCLR10PackageDirectory
{
return $(Join-Path $env:TP_OUT_DIR "$TPB_Configuration\$TPB_TargetFrameworkCore10")
}

function Get-CoreCLR20TestHostPackageDirectory
{
return $(Join-Path $env:TP_OUT_DIR "$TPB_Configuration\$TPB_TargetFrameworkCore20\TestHost")
Expand Down
4 changes: 2 additions & 2 deletions scripts/verify-nupkgs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ function Verify-Nuget-Packages($packageDirectory, $version)
"Microsoft.NET.Test.Sdk" = 27;
"Microsoft.TestPlatform" = 492;
"Microsoft.TestPlatform.Build" = 21;
"Microsoft.TestPlatform.CLI" = 366;
"Microsoft.TestPlatform.CLI" = 367;
"Microsoft.TestPlatform.Extensions.TrxLogger" = 35;
"Microsoft.TestPlatform.ObjectModel" = 180;
"Microsoft.TestPlatform.ObjectModel" = 238;
"Microsoft.TestPlatform.AdapterUtilities" = 62;
"Microsoft.TestPlatform.Portable" = 596;
"Microsoft.TestPlatform.TestHost" = 214;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
<Import Project="$(TestPlatformRoot)scripts/build/TestPlatform.Settings.targets" />
<PropertyGroup>
<AssemblyName>Microsoft.VisualStudio.TestPlatform.ObjectModel</AssemblyName>
<TargetFrameworks>net45;net451;netstandard2.0;netstandard1.3</TargetFrameworks>
<TargetFrameworks>net45;net451;netcoreapp2.1;netcoreapp1.0;netstandard2.0;netstandard1.3</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);uap10.0;netstandard1.0</TargetFrameworks>
<TargetFrameworks Condition=" '$(DotNetBuildFromSource)' == 'true' ">netstandard2.0;netstandard1.3;netstandard1.0</TargetFrameworks>
<PackageId>Microsoft.TestPlatform.ObjectModel</PackageId>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0'">
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
Expand Down Expand Up @@ -42,7 +43,7 @@
<PackageReference Include="System.Runtime" Version="4.3.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3' OR '$(TargetFramework)' == 'netcoreapp1.0'">
<PackageReference Include="System.Reflection.Metadata" Version="1.6.0" />
<PackageReference Include="System.ComponentModel.EventBasedAsync" Version="4.3.0" />
<PackageReference Include="System.ComponentModel.TypeConverter" Version="4.3.0" />
Expand All @@ -56,7 +57,7 @@
<PackageReference Include="NuGet.Frameworks" Version="4.6.4" />
</ItemGroup>

<ItemGroup Condition="!$(TargetFramework.StartsWith('netstandard1')) AND '$(TargetFramework)' != 'uap10.0'">
<ItemGroup Condition="!$(TargetFramework.StartsWith('netstandard1')) AND '$(TargetFramework)' != 'uap10.0' AND '$(TargetFramework)' != 'netcoreapp1.0'">
<PackageReference Include="System.Reflection.Metadata" Version="1.6.0" />
<PackageReference Include="NuGet.Frameworks" Version="$(NuGetFrameworksVersion)" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private void PopulateCacheForTypeAndMethodSymbols(string binaryPath)
}
catch (FileNotFoundException)
{
#if !NETSTANDARD1_3 && !WINDOWS_UWP
#if !NETSTANDARD1_3 && !WINDOWS_UWP && !NETCOREAPP1_0
// fallback when the assembly is not loaded
asm = Assembly.LoadFile(binaryPath);
#else
Expand Down
31 changes: 31 additions & 0 deletions src/package/nuspec/TestPlatform.ObjectModel.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@
<dependency id="System.Reflection.Metadata" version="[1.6.0, )" />
<dependency id="NuGet.Frameworks" version="[5.0.0, )" />
</group>

<group targetFramework="netcoreapp1.0">
<dependency id="System.Reflection.Metadata" version="[1.6.0, )" />
<dependency id="NuGet.Frameworks" version="4.6.4" />
</group>

<group targetFramework="netcoreapp2.1">
<dependency id="System.Reflection.Metadata" version="[1.6.0, )" />
<dependency id="NuGet.Frameworks" version="[5.0.0, )" />
</group>

<group targetFramework="netstandard1.0">
<dependency id="System.ComponentModel.EventBasedAsync" version="[4.3.0, )" />
Expand Down Expand Up @@ -84,6 +94,7 @@
<files>
<file src="Icon.png" target="" />
<file src="licenses\LICENSE_NET.txt" target="" />

<!-- net45 -->
<file src="net45\$Runtime$\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll" target="lib\net45\" />
<file src="net45\$Runtime$\Microsoft.TestPlatform.CoreUtilities.dll" target="lib\net45\" />
Expand Down Expand Up @@ -152,6 +163,26 @@
<file src="net451\$Runtime$\zh-Hant\Microsoft.TestPlatform.CoreUtilities.resources.dll" target="lib\net451\zh-Hant" />
<!-- /net451 -->

<!-- netcoreapp1.0 -->
<file src="netcoreapp1.0\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll" target="lib\netcoreapp1.0\" />
<file src="netcoreapp1.0\Microsoft.TestPlatform.CoreUtilities.dll" target="lib\netcoreapp1.0\" />
<file src="netcoreapp1.0\Microsoft.TestPlatform.PlatformAbstractions.dll" target="lib\netcoreapp1.0\" />

<!-- Add localized resources -->
<file src="netcoreapp1.0\**\Microsoft.VisualStudio.TestPlatform.ObjectModel.*resources.dll" exclude="**\TestHost\**\*.*" target="lib\netcoreapp1.0\" />
<file src="netcoreapp1.0\**\Microsoft.TestPlatform.CoreUtilities.resources.dll" exclude="**\TestHost\**\*.*" target="lib\netcoreapp1.0\" />
<!-- /netcoreapp1.0 -->

<!-- netcoreapp2.1 -->
<file src="netcoreapp2.1\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll" target="lib\netcoreapp2.1\" />
<file src="netcoreapp2.1\Microsoft.TestPlatform.CoreUtilities.dll" target="lib\netcoreapp2.1\" />
<file src="netcoreapp2.1\Microsoft.TestPlatform.PlatformAbstractions.dll" target="lib\netcoreapp2.1\" />

<!-- Add localized resources -->
<file src="netcoreapp2.1\**\Microsoft.VisualStudio.TestPlatform.ObjectModel.*resources.dll" exclude="**\TestHost\**\*.*" target="lib\netcoreapp2.1\" />
<file src="netcoreapp2.1\**\Microsoft.TestPlatform.CoreUtilities.resources.dll" exclude="**\TestHost\**\*.*" target="lib\netcoreapp2.1\" />
<!-- /netcoreapp2.1 -->

<!-- netstandard 1.0 -->
<file src="$NetStandard10Framework$\Microsoft.VisualStudio.TestPlatform.ObjectModel.dll" target="lib\netstandard1.0\" />
<file src="$NetStandard10Framework$\Microsoft.TestPlatform.CoreUtilities.dll" target="lib\netstandard1.0\" />
Expand Down

0 comments on commit 8950e74

Please sign in to comment.