Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle Windows Desktop for .NET Core 3 in a way that works for Linux/non-Windows Desktop #859

Merged
merged 34 commits into from
Feb 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
b2d0210
Add folder for local packages
Dec 13, 2018
43a6a80
add linux test project
Dec 13, 2018
f13de50
add linux test project
Dec 13, 2018
8b68357
add linux job
Dec 14, 2018
a645fb4
fix invocation
Dec 14, 2018
759660a
Update azure-pipelines.rx.yml
Dec 14, 2018
16d75e4
Update azure-pipelines.rx.yml
Dec 14, 2018
deba91f
Also install 2.2
Dec 14, 2018
bf6c150
try moving the 3.0 install to after the tool
Dec 14, 2018
62b9eca
use forward slash
Dec 14, 2018
d61a55b
move downloaded artifacts to package directory
Dec 14, 2018
87447c3
Reduce surface area to match netstandard
Dec 14, 2018
dc9f681
update gb.nv
Dec 14, 2018
d11d09c
fix versions
Jan 18, 2019
d7a3a38
Update dependencies
Feb 14, 2019
d40974b
Add reference based on UseWpf or UseWindowsForms
Feb 14, 2019
728cf9b
Use build and buildTransitive
Feb 14, 2019
3d78b42
Update to latest extras
Feb 23, 2019
6e746eb
Update sdk
Feb 23, 2019
9cef070
generate binlog
Feb 23, 2019
fde4bde
add workaround
Feb 23, 2019
db5b0dc
Use latest SDK to build
Feb 23, 2019
65460ef
Remove binlog
Feb 23, 2019
31e7b00
Prevent downgrade
Feb 23, 2019
06126dd
run tests independently due to DotNetCoreInstaller stepping on 2.1/3.…
Feb 23, 2019
875e542
Specify TFs
Feb 23, 2019
8775aa2
Workaround https://github.com/dotnet/sdk/issues/2976
Feb 23, 2019
f3ce0f0
Add WindowsDesktop integration tests
Feb 23, 2019
6de2ebf
Fix invoke of tool
Feb 23, 2019
61c63f8
Update displayname
Feb 23, 2019
98ce4e0
Fix targets bug
Feb 24, 2019
6ee6b11
Ensure dll is in package
Feb 24, 2019
2d5aabd
Fix packaging
Feb 24, 2019
e127ac4
Move Product to targets so AssemblyName is set
Feb 24, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions Rx.NET/Integration/IntegrationTests.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28407.52
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LinuxTests", "LinuxTests\LinuxTests.csproj", "{E5607740-EAAC-4A42-B59C-3B2387582559}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowsDesktopTests", "WindowsDesktopTests\WindowsDesktopTests.csproj", "{EFAFAEC1-AB20-4B16-8D6C-005052866B3F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E5607740-EAAC-4A42-B59C-3B2387582559}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E5607740-EAAC-4A42-B59C-3B2387582559}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E5607740-EAAC-4A42-B59C-3B2387582559}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E5607740-EAAC-4A42-B59C-3B2387582559}.Release|Any CPU.Build.0 = Release|Any CPU
{EFAFAEC1-AB20-4B16-8D6C-005052866B3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EFAFAEC1-AB20-4B16-8D6C-005052866B3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EFAFAEC1-AB20-4B16-8D6C-005052866B3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EFAFAEC1-AB20-4B16-8D6C-005052866B3F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2ABA1A1F-6AEE-4AB5-A710-4D7474576023}
EndGlobalSection
EndGlobal
34 changes: 34 additions & 0 deletions Rx.NET/Integration/LinuxTests/LinuxTests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.0;netcoreapp2.1</TargetFrameworks>
<NoWarn>$(NoWarn);CS0618</NoWarn>
<LangVersion>latest</LangVersion>
<AssemblyName>Tests.System.Reactive</AssemblyName>
<RootNamespace>Tests.System.Reactive</RootNamespace>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\Source\ReactiveX.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp2.1'">
<DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;LINUX</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Content Include="..\..\Source\tests\Tests.System.Reactive\xunit.runner.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Compile Include="..\..\Source\tests\Tests.System.Reactive\**\*.cs" Exclude="..\..\Source\tests\Tests.System.Reactive\obj\**" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.0-preview-20181205-02" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="System.Reactive" Version="4.2.0-preview.63" />
<PackageReference Include="Microsoft.Reactive.Testing" Version="4.2.0-preview.63" />
<PackageReference Include="System.Reactive.Observable.Aliases" Version="4.2.0-preview.63" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions Rx.NET/Integration/LocalPackages/.keepme
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Placeholder to keep this directory
6 changes: 3 additions & 3 deletions Rx.NET/Integration/NuGet.Config
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="AppVeyor (CI) rxnet" value="https://ci.appveyor.com/nuget/rx-net-ljfp6fos5bxs" />
<packageSources>
<add key="myget.org rxnet" value="https://dotnet.myget.org/F/rx/api/v3/index.json" />
<add key="Build Packages" value="https://www.myget.org/F/c037199d-41df-4567-b966-25ff65324688/api/v3/index.json" />
<add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />
<add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />
<add key="Local Packages" value="./LocalPackages" />
</packageSources>
</configuration>
34 changes: 34 additions & 0 deletions Rx.NET/Integration/WindowsDesktopTests/WindowsDesktopTests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<NoWarn>$(NoWarn);CS0618</NoWarn>
<LangVersion>latest</LangVersion>
<AssemblyName>Tests.System.Reactive</AssemblyName>
<RootNamespace>Tests.System.Reactive</RootNamespace>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\Source\ReactiveX.snk</AssemblyOriginatorKeyFile>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>


<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;HAS_WINFORMS;HAS_DISPATCHER;DESKTOPCLR</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Content Include="..\..\Source\tests\Tests.System.Reactive\xunit.runner.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Compile Include="..\..\Source\tests\Tests.System.Reactive\**\*.cs" Exclude="..\..\Source\tests\Tests.System.Reactive\obj\**" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.0.0-preview-20190203-03" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="System.Reactive" Version="4.2.0-preview.63" />
<PackageReference Include="Microsoft.Reactive.Testing" Version="4.2.0-preview.63" />
<PackageReference Include="System.Reactive.Observable.Aliases" Version="4.2.0-preview.63" />
</ItemGroup>
</Project>
8 changes: 8 additions & 0 deletions Rx.NET/Integration/global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"sdk": {
"version": "3.0.100-preview"
},
"msbuild-sdks": {
"MSBuild.Sdk.Extras": "2.0.0-preview.14"
}
}
3 changes: 1 addition & 2 deletions Rx.NET/Source/Directory.build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project>
<PropertyGroup>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
<Copyright>Copyright (c) .NET Foundation and Contributors.</Copyright>
<MinClientVersion>2.12</MinClientVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand All @@ -12,7 +11,7 @@
<DebugType>embedded</DebugType>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)ReactiveX.snk</AssemblyOriginatorKeyFile>
<NoWarn>$(NoWarn);1701;1702;CS1591</NoWarn>
<NoWarn>$(NoWarn);1701;1702;CS1591;NU5105</NoWarn>
<DefaultLanguage>en-US</DefaultLanguage>
<IncludeSymbols>false</IncludeSymbols>
<IsTestProject>$(MSBuildProjectName.Contains('Tests'))</IsTestProject>
Expand Down
21 changes: 16 additions & 5 deletions Rx.NET/Source/Directory.build.targets
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
<Project>
<!-- This props all need to be set in targets as they depend on the values set earlier -->

<PropertyGroup>
<Product>$(AssemblyName) ($(TargetFramework))</Product>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net46'">
<DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;HAS_WINFORMS;HAS_DISPATCHER;PREFER_ASYNC;HAS_TPL46;DESKTOPCLR</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0'">
<TargetPlatformVersion>10.0.16299.0</TargetPlatformVersion>
<TargetPlatformVersion>10.0.17763.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.15063.0</TargetPlatformMinVersion>
<DefineConstants>$(DefineConstants);NO_CODE_COVERAGE_ATTRIBUTE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;NO_SERIALIZABLE;CRIPPLED_REFLECTION;NO_THREAD;WINDOWS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'uap10.0.16299'">
<DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;WINDOWS</DefineConstants>
<TargetPlatformVersion>10.0.17763.0</TargetPlatformVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netcoreapp2.1'">
<DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;HAS_WINFORMS;HAS_DISPATCHER;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;DESKTOPCLR</DefineConstants>
<DefineConstants>$(DefineConstants);HAS_TRACE;HAS_WINRT;PREFER_ASYNC;HAS_TPL46;NO_REMOTING;HAS_WINFORMS;HAS_DISPATCHER;DESKTOPCLR</DefineConstants>
</PropertyGroup>

<ItemGroup>
<!-- Workaround https://github.com/dotnet/sdk/issues/2976 -->
<PackageReference Update="Microsoft.NETCore.Platforms" PrivateAssets="All" />
</ItemGroup>


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

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="2.2.33" PrivateAssets="all" />
<PackageReference Include="Nerdbank.GitVersioning" Version="2.3.105" PrivateAssets="all" />
</ItemGroup>

<Target Name="AddCommitHashToAssemblyAttributes" BeforeTargets="GetAssemblyAttributes">
Expand Down
4 changes: 2 additions & 2 deletions Rx.NET/Source/global.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"sdk": {
"version": "3.0.100-preview"
"version": "3.0.100-preview4"
},
"msbuild-sdks": {
"MSBuild.Sdk.Extras": "2.0.0-preview.14"
"MSBuild.Sdk.Extras": "2.0.0-preview.21"
}
}
36 changes: 33 additions & 3 deletions Rx.NET/Source/src/System.Reactive/System.Reactive.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
<TargetFrameworks>netcoreapp3.0;netstandard2.0;net46;uap10.0;uap10.0.16299</TargetFrameworks>
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
<PackageTags>Rx;Reactive;Extensions;Observable;LINQ;Events</PackageTags>
<Description>Reactive Extensions (Rx) for .NET</Description>
<Description>Reactive Extensions (Rx) for .NET</Description>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<IncludeBuildOutput>false</IncludeBuildOutput>
</PropertyGroup>


Expand All @@ -29,7 +30,7 @@

<!-- UWP -->
<ItemGroup Condition=" '$(TargetFramework)' == 'uap10.0' ">
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="System.ComponentModel" Version="4.0.1" />
<PackageReference Include="System.Dynamic.Runtime" Version="4.0.11" />
<PackageReference Include="System.Linq.Queryable" Version="4.0.1" />
Expand All @@ -46,7 +47,7 @@

<!-- Desktop -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net46'">
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<Reference Include="System.Windows" />
<Reference Include="System.Windows.Forms" />
<Reference Include="WindowsBase" />
Expand All @@ -63,5 +64,34 @@
<None Update="Linq\Observable\Zip.Generated.tt" Generator="TextTemplatingFileGenerator" LastGenOutput="Zip.Generated.cs" />
<Compile Update="Linq\Observable\Zip.Generated.cs" DesignTime="True" AutoGen="True" DependentUpon="Zip.Generated.tt" />
</ItemGroup>

<PropertyGroup>
<TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);RemoveNetCoreApp3FromNuGet</TargetsForTfmSpecificBuildOutput>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);AddNetCore3ToNuGet</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>

<!-- We remove the output from the nuget so it doesn't wind up in the \lib folder -->
<Target Name="RemoveNetCoreApp3FromNuGet" DependsOnTargets="BuiltProjectOutputGroup;DocumentationProjectOutputGroup" Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<ItemGroup>
<!-- Before clearing the output groups, add them to None for packing -->
<ItemsToAddToNuGet Include="@(BuiltProjectOutputGroupOutput);@(DocumentationProjectOutputGroupOutput)" PackagePath="build\netcoreapp3.0" />

<BuiltProjectOutputGroupOutput Remove="@(BuiltProjectOutputGroupOutput)" />
<DocumentationProjectOutputGroupOutput Remove="@(DocumentationProjectOutputGroupOutput)" />
</ItemGroup>
</Target>

<Target Name="AddNetCore3ToNuGet" Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<ItemGroup>
<!-- Add the removed build output to the build\netcoreapp3.0 folder -->
<TfmSpecificPackageFileWithRecursiveDir Include="@(ItemsToAddToNuGet)" PackagePath="build\netcoreapp3.0" />
</ItemGroup>
</Target>

<ItemGroup>
<None Include="build\_._" PackagePath="lib\netcoreapp3.0" Pack="true" />
<None Include="build\System.Reactive.targets" PackagePath="buildTransitive\netcoreapp3.0" Pack="true" />
<None Include="build\System.Reactive.targets" PackagePath="build\netcoreapp3.0" Pack="true" />
</ItemGroup>

</Project>
10 changes: 10 additions & 0 deletions Rx.NET/Source/src/System.Reactive/build/System.Reactive.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project>
<PropertyGroup>
<UseWindowsRxVersion Condition="'$(UseWpf)' == 'true' OR '$(UseWindowsForms)' == 'true'" >true</UseWindowsRxVersion>
<UseWindowsRxVersion Condition="'$(UseWindowsRxVersion)' == '' " >false</UseWindowsRxVersion>
</PropertyGroup>
<ItemGroup>
<Reference Condition="'$(UseWindowsRxVersion)' == 'true' " Include="$(MSBuildThisFileDirectory)..\..\build\netcoreapp3.0\System.Reactive.dll" />
<Reference Condition="'$(UseWindowsRxVersion)' != 'true' " Include="$(MSBuildThisFileDirectory)..\..\lib\netstandard2.0\System.Reactive.dll" />
</ItemGroup>
</Project>
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.1.5" />
<PackageReference Include="xunit" Version="2.4.0-beta.2.build4010" />
<PackageReference Include="xunit.runner.devices" Version="2.4.0-build.27" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.1.9" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.devices" Version="2.5.25" />
</ItemGroup>
<ItemGroup>
<!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
Expand Down
Loading