Browse Source

Add reference based on UseWpf or UseWindowsForms

Oren Novotny 6 years ago
parent
commit
d40974bfa0

+ 1 - 1
Rx.NET/Source/Directory.build.props

@@ -12,7 +12,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>

+ 23 - 0
Rx.NET/Source/src/System.Reactive/System.Reactive.csproj

@@ -9,6 +9,7 @@
   <PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
     <UseWPF>true</UseWPF>
     <UseWindowsForms>true</UseWindowsForms>
+    <IncludeBuildOutput>false</IncludeBuildOutput>
   </PropertyGroup>
 
 
@@ -63,5 +64,27 @@
     <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>
+  </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>
+      <BuiltProjectOutputGroupOutput Remove="@(BuiltProjectOutputGroupOutput)" />
+      <DocumentationProjectOutputGroupOutput Remove="@(DocumentationProjectOutputGroupOutput)" />
+    </ItemGroup>
+
+  </Target>
+
+
+  <ItemGroup>
+    <None Include="bin\$(Configuration)\netcoreapp3.0\*.xml" PackagePath="buildTransitive\netcoreapp3.0" Pack="true" />
+    <None Include="bin\$(Configuration)\netcoreapp3.0\*.dll" PackagePath="buildTransitive\netcoreapp3.0" Pack="true" />
+    <None Include="build\_._" PackagePath="lib\netcoreapp3.0" Pack="true" />
+    <None Include="build\System.Reactive.targets" PackagePath="buildTransitive\netcoreapp3.0" Pack="true" />
+  </ItemGroup>
   
 </Project>

+ 10 - 0
Rx.NET/Source/src/System.Reactive/build/System.Reactive.targets

@@ -0,0 +1,10 @@
+<Project>
+  <PropertyGroup>
+    <UseWindowsRxVersion Condition="'$(UseWpf)' == 'true' OR '$(UseWindowsForms)' == 'true'" >true</UseWindowsRxVersion>
+    <UseWindowsRxVersion Condition="'$(UseWindowsVersion)' == '' " >false</UseWindowsRxVersion>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Condition="'$(UseWindowsRxVersion)' == 'true' "  Include="$(MSBuildThisFileDirectory)System.Reactive.dll" />
+    <Reference Condition="'$(UseWindowsRxVersion)' != 'true' "  Include="$(MSBuildThisFileDirectory)..\..\lib\netstandard2.0\System.Reactive.dll" />
+  </ItemGroup>
+</Project>

+ 0 - 0
Rx.NET/Source/src/System.Reactive/build/_._