Skip to content

Commit 935b524

Browse files
author
Oren Novotny
authored
Merge pull request #859 from dotnet/linux-tests
Handle Windows Desktop for .NET Core 3 in a way that works for Linux/non-Windows Desktop
2 parents 1ec1197 + e127ac4 commit 935b524

File tree

14 files changed

+395
-93
lines changed

14 files changed

+395
-93
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.28407.52
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LinuxTests", "LinuxTests\LinuxTests.csproj", "{E5607740-EAAC-4A42-B59C-3B2387582559}"
7+
EndProject
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowsDesktopTests", "WindowsDesktopTests\WindowsDesktopTests.csproj", "{EFAFAEC1-AB20-4B16-8D6C-005052866B3F}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{E5607740-EAAC-4A42-B59C-3B2387582559}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{E5607740-EAAC-4A42-B59C-3B2387582559}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{E5607740-EAAC-4A42-B59C-3B2387582559}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{E5607740-EAAC-4A42-B59C-3B2387582559}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{EFAFAEC1-AB20-4B16-8D6C-005052866B3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{EFAFAEC1-AB20-4B16-8D6C-005052866B3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{EFAFAEC1-AB20-4B16-8D6C-005052866B3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{EFAFAEC1-AB20-4B16-8D6C-005052866B3F}.Release|Any CPU.Build.0 = Release|Any CPU
24+
EndGlobalSection
25+
GlobalSection(SolutionProperties) = preSolution
26+
HideSolutionNode = FALSE
27+
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {2ABA1A1F-6AEE-4AB5-A710-4D7474576023}
30+
EndGlobalSection
31+
EndGlobal
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFrameworks>netcoreapp3.0;netcoreapp2.1</TargetFrameworks>
4+
<NoWarn>$(NoWarn);CS0618</NoWarn>
5+
<LangVersion>latest</LangVersion>
6+
<AssemblyName>Tests.System.Reactive</AssemblyName>
7+
<RootNamespace>Tests.System.Reactive</RootNamespace>
8+
<SignAssembly>true</SignAssembly>
9+
<AssemblyOriginatorKeyFile>..\..\Source\ReactiveX.snk</AssemblyOriginatorKeyFile>
10+
</PropertyGroup>
11+
12+
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp2.1'">
13+
<DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING</DefineConstants>
14+
</PropertyGroup>
15+
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
16+
<DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;LINUX</DefineConstants>
17+
</PropertyGroup>
18+
19+
<ItemGroup>
20+
<Content Include="..\..\Source\tests\Tests.System.Reactive\xunit.runner.json">
21+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
22+
</Content>
23+
<Compile Include="..\..\Source\tests\Tests.System.Reactive\**\*.cs" Exclude="..\..\Source\tests\Tests.System.Reactive\obj\**" />
24+
</ItemGroup>
25+
26+
<ItemGroup>
27+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.0-preview-20181205-02" />
28+
<PackageReference Include="xunit" Version="2.4.1" />
29+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
30+
<PackageReference Include="System.Reactive" Version="4.2.0-preview.63" />
31+
<PackageReference Include="Microsoft.Reactive.Testing" Version="4.2.0-preview.63" />
32+
<PackageReference Include="System.Reactive.Observable.Aliases" Version="4.2.0-preview.63" />
33+
</ItemGroup>
34+
</Project>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Placeholder to keep this directory

Rx.NET/Integration/NuGet.Config

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
3-
<packageSources>
4-
<add key="AppVeyor (CI) rxnet" value="https://ci.appveyor.com/nuget/rx-net-ljfp6fos5bxs" />
3+
<packageSources>
54
<add key="myget.org rxnet" value="https://dotnet.myget.org/F/rx/api/v3/index.json" />
65
<add key="Build Packages" value="https://www.myget.org/F/c037199d-41df-4567-b966-25ff65324688/api/v3/index.json" />
7-
<add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />
6+
<add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />
7+
<add key="Local Packages" value="./LocalPackages" />
88
</packageSources>
99
</configuration>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
2+
<PropertyGroup>
3+
<TargetFramework>netcoreapp3.0</TargetFramework>
4+
<NoWarn>$(NoWarn);CS0618</NoWarn>
5+
<LangVersion>latest</LangVersion>
6+
<AssemblyName>Tests.System.Reactive</AssemblyName>
7+
<RootNamespace>Tests.System.Reactive</RootNamespace>
8+
<SignAssembly>true</SignAssembly>
9+
<AssemblyOriginatorKeyFile>..\..\Source\ReactiveX.snk</AssemblyOriginatorKeyFile>
10+
<UseWPF>true</UseWPF>
11+
<UseWindowsForms>true</UseWindowsForms>
12+
</PropertyGroup>
13+
14+
15+
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
16+
<DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;HAS_WINFORMS;HAS_DISPATCHER;DESKTOPCLR</DefineConstants>
17+
</PropertyGroup>
18+
19+
<ItemGroup>
20+
<Content Include="..\..\Source\tests\Tests.System.Reactive\xunit.runner.json">
21+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
22+
</Content>
23+
<Compile Include="..\..\Source\tests\Tests.System.Reactive\**\*.cs" Exclude="..\..\Source\tests\Tests.System.Reactive\obj\**" />
24+
</ItemGroup>
25+
26+
<ItemGroup>
27+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.0-preview-20190203-03" />
28+
<PackageReference Include="xunit" Version="2.4.1" />
29+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
30+
<PackageReference Include="System.Reactive" Version="4.2.0-preview.63" />
31+
<PackageReference Include="Microsoft.Reactive.Testing" Version="4.2.0-preview.63" />
32+
<PackageReference Include="System.Reactive.Observable.Aliases" Version="4.2.0-preview.63" />
33+
</ItemGroup>
34+
</Project>

Rx.NET/Integration/global.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"sdk": {
3+
"version": "3.0.100-preview"
4+
},
5+
"msbuild-sdks": {
6+
"MSBuild.Sdk.Extras": "2.0.0-preview.14"
7+
}
8+
}

Rx.NET/Source/Directory.build.props

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<Project>
22
<PropertyGroup>
3-
<Product>$(AssemblyName) ($(TargetFramework))</Product>
43
<Copyright>Copyright (c) .NET Foundation and Contributors.</Copyright>
54
<MinClientVersion>2.12</MinClientVersion>
65
<GenerateDocumentationFile>true</GenerateDocumentationFile>
@@ -12,7 +11,7 @@
1211
<DebugType>embedded</DebugType>
1312
<SignAssembly>true</SignAssembly>
1413
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)ReactiveX.snk</AssemblyOriginatorKeyFile>
15-
<NoWarn>$(NoWarn);1701;1702;CS1591</NoWarn>
14+
<NoWarn>$(NoWarn);1701;1702;CS1591;NU5105</NoWarn>
1615
<DefaultLanguage>en-US</DefaultLanguage>
1716
<IncludeSymbols>false</IncludeSymbols>
1817
<IsTestProject>$(MSBuildProjectName.Contains('Tests'))</IsTestProject>

Rx.NET/Source/Directory.build.targets

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,42 @@
11
<Project>
22
<!-- This props all need to be set in targets as they depend on the values set earlier -->
3+
4+
<PropertyGroup>
5+
<Product>$(AssemblyName) ($(TargetFramework))</Product>
6+
</PropertyGroup>
7+
38
<PropertyGroup Condition="'$(TargetFramework)' == 'net46'">
49
<DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;HAS_WINFORMS;HAS_DISPATCHER;PREFER_ASYNC;HAS_TPL46;DESKTOPCLR</DefineConstants>
510
</PropertyGroup>
611
<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0'">
7-
<TargetPlatformVersion>10.0.16299.0</TargetPlatformVersion>
12+
<TargetPlatformVersion>10.0.17763.0</TargetPlatformVersion>
813
<TargetPlatformMinVersion>10.0.15063.0</TargetPlatformMinVersion>
914
<DefineConstants>$(DefineConstants);NO_CODE_COVERAGE_ATTRIBUTE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;NO_SERIALIZABLE;CRIPPLED_REFLECTION;NO_THREAD;WINDOWS</DefineConstants>
1015
</PropertyGroup>
1116
<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0.16299'">
1217
<DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;WINDOWS</DefineConstants>
18+
<TargetPlatformVersion>10.0.17763.0</TargetPlatformVersion>
1319
</PropertyGroup>
1420
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp2.1'">
1521
<DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING</DefineConstants>
1622
</PropertyGroup>
1723
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
18-
<DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;HAS_WINFORMS;HAS_DISPATCHER;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;DESKTOPCLR</DefineConstants>
24+
<DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;HAS_WINFORMS;HAS_DISPATCHER;DESKTOPCLR</DefineConstants>
1925
</PropertyGroup>
2026

27+
<ItemGroup>
28+
<!-- Workaround https://github.com/dotnet/sdk/issues/2976 -->
29+
<PackageReference Update="Microsoft.NETCore.Platforms" PrivateAssets="All" />
30+
</ItemGroup>
31+
2132

2233
<ItemGroup Condition="'$(IsTestProject)' != 'true' and '$(SourceLinkEnabled)' != 'false' and '$(TargetFramework)' != 'netcoreapp3.0'">
23-
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.1" />
24-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-62925-02" PrivateAssets="All"/>
34+
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.2" />
35+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05" PrivateAssets="All"/>
2536
</ItemGroup>
2637

2738
<ItemGroup>
28-
<PackageReference Include="Nerdbank.GitVersioning" Version="2.2.33" PrivateAssets="all" />
39+
<PackageReference Include="Nerdbank.GitVersioning" Version="2.3.105" PrivateAssets="all" />
2940
</ItemGroup>
3041

3142
<Target Name="AddCommitHashToAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">

Rx.NET/Source/global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"sdk": {
3-
"version": "3.0.100-preview"
3+
"version": "3.0.100-preview4"
44
},
55
"msbuild-sdks": {
6-
"MSBuild.Sdk.Extras": "2.0.0-preview.14"
6+
"MSBuild.Sdk.Extras": "2.0.0-preview.21"
77
}
88
}

Rx.NET/Source/src/System.Reactive/System.Reactive.csproj

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
<TargetFrameworks>netcoreapp3.0;netstandard2.0;net46;uap10.0;uap10.0.16299</TargetFrameworks>
44
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
55
<PackageTags>Rx;Reactive;Extensions;Observable;LINQ;Events</PackageTags>
6-
<Description>Reactive Extensions (Rx) for .NET</Description>
6+
<Description>Reactive Extensions (Rx) for .NET</Description>
77
</PropertyGroup>
88

99
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
1010
<UseWPF>true</UseWPF>
1111
<UseWindowsForms>true</UseWindowsForms>
12+
<IncludeBuildOutput>false</IncludeBuildOutput>
1213
</PropertyGroup>
1314

1415

@@ -29,7 +30,7 @@
2930

3031
<!-- UWP -->
3132
<ItemGroup Condition=" '$(TargetFramework)' == 'uap10.0' ">
32-
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
33+
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
3334
<PackageReference Include="System.ComponentModel" Version="4.0.1" />
3435
<PackageReference Include="System.Dynamic.Runtime" Version="4.0.11" />
3536
<PackageReference Include="System.Linq.Queryable" Version="4.0.1" />
@@ -46,7 +47,7 @@
4647

4748
<!-- Desktop -->
4849
<ItemGroup Condition=" '$(TargetFramework)' == 'net46'">
49-
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
50+
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
5051
<Reference Include="System.Windows" />
5152
<Reference Include="System.Windows.Forms" />
5253
<Reference Include="WindowsBase" />
@@ -63,5 +64,34 @@
6364
<None Update="Linq\Observable\Zip.Generated.tt" Generator="TextTemplatingFileGenerator" LastGenOutput="Zip.Generated.cs" />
6465
<Compile Update="Linq\Observable\Zip.Generated.cs" DesignTime="True" AutoGen="True" DependentUpon="Zip.Generated.tt" />
6566
</ItemGroup>
67+
68+
<PropertyGroup>
69+
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);RemoveNetCoreApp3FromNuGet</TargetsForTfmSpecificBuildOutput>
70+
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);AddNetCore3ToNuGet</TargetsForTfmSpecificContentInPackage>
71+
</PropertyGroup>
72+
73+
<!-- We remove the output from the nuget so it doesn't wind up in the \lib folder -->
74+
<Target Name="RemoveNetCoreApp3FromNuGet" DependsOnTargets="BuiltProjectOutputGroup;DocumentationProjectOutputGroup" Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
75+
<ItemGroup>
76+
<!-- Before clearing the output groups, add them to None for packing -->
77+
<ItemsToAddToNuGet Include="@(BuiltProjectOutputGroupOutput);@(DocumentationProjectOutputGroupOutput)" PackagePath="build\netcoreapp3.0" />
78+
79+
<BuiltProjectOutputGroupOutput Remove="@(BuiltProjectOutputGroupOutput)" />
80+
<DocumentationProjectOutputGroupOutput Remove="@(DocumentationProjectOutputGroupOutput)" />
81+
</ItemGroup>
82+
</Target>
83+
84+
<Target Name="AddNetCore3ToNuGet" Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
85+
<ItemGroup>
86+
<!-- Add the removed build output to the build\netcoreapp3.0 folder -->
87+
<TfmSpecificPackageFileWithRecursiveDir Include="@(ItemsToAddToNuGet)" PackagePath="build\netcoreapp3.0" />
88+
</ItemGroup>
89+
</Target>
90+
91+
<ItemGroup>
92+
<None Include="build\_._" PackagePath="lib\netcoreapp3.0" Pack="true" />
93+
<None Include="build\System.Reactive.targets" PackagePath="buildTransitive\netcoreapp3.0" Pack="true" />
94+
<None Include="build\System.Reactive.targets" PackagePath="build\netcoreapp3.0" Pack="true" />
95+
</ItemGroup>
6696

6797
</Project>

0 commit comments

Comments
 (0)