Skip to content

Commit

Permalink
Use WindowsDesktop SDK to bring Windows Forms and WPF into project.
Browse files Browse the repository at this point in the history
This allow play with .NET Core support for tutorials.

These tutorials still can be built only on Windows. See dotnet/sdk#3592
So if any configuration changes should be present, they now can be split not on Core/Full ,but on Windows/NonWindows basis. I know that there some difference in codebase, but I do not play with that yet.
  • Loading branch information
kant2002 committed Apr 7, 2020
1 parent 27200bd commit 0a9e144
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 108 deletions.
7 changes: 2 additions & 5 deletions src/Examples/ClickThroughModel/ClickThroughModel.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Import Project="$(MSBuildThisFileDirectory)..\..\..\build\common.props" />

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net461</TargetFramework>
<Configurations>Debug;DebugFull;DebugCore;Release;ReleaseFull;ReleaseCore</Configurations>
<ErrorReport>prompt</ErrorReport>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down Expand Up @@ -51,10 +52,6 @@
<ProjectReference Include="..\..\Runtime\Runtime.csproj" />
</ItemGroup>

<ItemGroup>
<Reference Include="System.Windows.Forms" />
</ItemGroup>

<ItemGroup>
<Service Include="{B4F97281-0DBD-4835-9ED8-7DFB966E87FF}" />
</ItemGroup>
Expand Down
36 changes: 3 additions & 33 deletions src/Examples/ClinicalTrial/ClinicalTrial.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Import Project="$(MSBuildThisFileDirectory)..\..\..\build\common.props" />

<PropertyGroup>
Expand All @@ -7,6 +7,7 @@
<Prefer32Bit>false</Prefer32Bit>
<ErrorReport>prompt</ErrorReport>
<OutputType>WinExe</OutputType>
<UseWpf>true</UseWpf>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down Expand Up @@ -42,48 +43,17 @@
<Optimize>true</Optimize>
</PropertyGroup>

<ItemGroup>
<None Remove="App.xaml" />
<None Remove="ClinicalTrial.xaml" />
<None Remove="Images\Infer.ico" />
<None Remove="Images\patient.png" />
<None Remove="Images\pill-yellow.png" />
<None Remove="Images\placebo-blue.png" />
</ItemGroup>

<ItemGroup>
<ApplicationDefinition Include="App.xaml" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Compiler\Compiler.csproj" />
<ProjectReference Include="..\..\Runtime\Runtime.csproj" />
</ItemGroup>

<ItemGroup>
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\..\Shared\SharedAssemblyFileVersion.cs" />
<Compile Include="..\..\Shared\SharedAssemblyInfo.cs" />
</ItemGroup>

<ItemGroup>
<Page Include="ClinicalTrial.xaml" />
</ItemGroup>

<ItemGroup>
<Resource Include="Images\Infer.ico" />
<Resource Include="Images\patient.png" />
<Resource Include="Images\pill-yellow.png" />
<Resource Include="Images\placebo-blue.png" />
<Resource Include="Images\*" />
</ItemGroup>
</Project>
25 changes: 3 additions & 22 deletions src/Examples/ImageClassifier/Image_Classifier.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Import Project="$(MSBuildThisFileDirectory)..\..\..\build\common.props" />

<PropertyGroup>
Expand All @@ -7,6 +7,8 @@
<Configurations>Debug;DebugFull;DebugCore;Release;ReleaseFull;ReleaseCore</Configurations>
<Prefer32Bit>false</Prefer32Bit>
<ErrorReport>prompt</ErrorReport>
<UseWpf>true</UseWpf>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down Expand Up @@ -42,32 +44,11 @@
<Optimize>true</Optimize>
</PropertyGroup>

<ItemGroup>
<None Remove="ClassifierView.xaml" />
</ItemGroup>

<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml" />
<Reference Include="UIAutomationProvider" />
<Reference Include="WindowsBase" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\..\Shared\SharedAssemblyFileVersion.cs" />
<Compile Include="..\..\Shared\SharedAssemblyInfo.cs" />
</ItemGroup>

<ItemGroup>
<Page Include="ClassifierView.xaml" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Compiler\Compiler.csproj" />
<ProjectReference Include="..\..\Runtime\Runtime.csproj" />
Expand Down
22 changes: 2 additions & 20 deletions src/Examples/MontyHall/MontyHall.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Import Project="$(MSBuildThisFileDirectory)..\..\..\build\common.props" />

<PropertyGroup>
Expand All @@ -7,6 +7,7 @@
<Prefer32Bit>false</Prefer32Bit>
<ErrorReport>prompt</ErrorReport>
<OutputType>WinExe</OutputType>
<UseWpf>true</UseWpf>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down Expand Up @@ -46,30 +47,11 @@
<ProjectReference Include="..\..\Compiler\Compiler.csproj" />
<ProjectReference Include="..\..\Runtime\Runtime.csproj" />
</ItemGroup>

<ItemGroup>
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>

<ItemGroup>
<ApplicationDefinition Include="App.xaml" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\..\Shared\SharedAssemblyFileVersion.cs" />
<Compile Include="..\..\Shared\SharedAssemblyInfo.cs" />
</ItemGroup>

<ItemGroup>
<Page Include="Window1.xaml" />
</ItemGroup>

<ItemGroup>
<Resource Include="Images\*" />
Expand Down
11 changes: 5 additions & 6 deletions src/Tutorials/Tutorials.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Import Project="$(MSBuildThisFileDirectory)..\..\build\common.props" />

<PropertyGroup>
Expand Down Expand Up @@ -56,13 +56,12 @@
<ProjectReference Include="..\Compiler\Compiler.csproj" />
<ProjectReference Include="..\Runtime\Runtime.csproj" />
</ItemGroup>

<PropertyGroup Condition="$(DefineConstants.Contains('NETFULL'))">
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
<ItemGroup Condition="$(DefineConstants.Contains('NETFULL'))">
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<ProjectReference Include="..\Visualizers\Windows\Visualizers.Windows.csproj" />
<Compile Update="ExamplesViewer.cs">
<SubType>UserControl</SubType>
</Compile>
</ItemGroup>
<ItemGroup Condition="$(DefineConstants.Contains('NETCORE'))">
<Compile Remove="ExamplesViewer.cs">
Expand Down
25 changes: 3 additions & 22 deletions src/Visualizers/Windows/Visualizers.Windows.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Import Project="$(MSBuildThisFileDirectory)..\..\..\build\nuget-properties.props" />

<PropertyGroup>
Expand All @@ -11,6 +11,7 @@
<RootNamespace>Microsoft.ML.Probabilistic.Compiler.Visualizers</RootNamespace>
<Configurations>Debug;Release</Configurations>
<MonoSupport>false</MonoSupport>
<UseWindowsForms>true</UseWindowsForms>
<DefineConstants Condition=" '$(MonoSupport)' == 'false' ">$(DefineConstants);INCLUDE_TRANSFORM_BROWSER</DefineConstants>
</PropertyGroup>

Expand All @@ -29,32 +30,12 @@
<PackageReference Include="Microsoft.Msagl" Version="1.1.1" />
<PackageReference Include="Microsoft.Msagl.Drawing" Version="1.1.1" />
<PackageReference Include="Microsoft.Msagl.GraphViewerGdi" Version="1.1.1" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />

<Compile Update="FactorManagerView.cs" SubType="UserControl" />
<EmbeddedResource Update="*.resx">
<DependentUpon>%(FileName).cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>

<PropertyGroup Condition=" $(DefineConstants.Contains('INCLUDE_TRANSFORM_BROWSER'))">
<UseWpf>true</UseWpf>
<LanguageTargets Condition="Exists('$(MSBuildExtensionsPath)\$(VisualStudioVersion)\Bin\Microsoft.CSharp.targets')">$(MSBuildExtensionsPath)\$(VisualStudioVersion)\Bin\Microsoft.CSharp.targets</LanguageTargets>
</PropertyGroup>
<ItemGroup Condition="$(DefineConstants.Contains('INCLUDE_TRANSFORM_BROWSER'))">
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System.Xaml" />
<Reference Include="WindowsBase" />
<!-- XAML elements -->
<!-- Workaround to make xamls appear in the VS solution explorer -->
<None Include="**\*.xaml" />
<Page Include="**\*.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Compile Update="**\*.xaml.cs" SubType="Code" DependentUpon="%(Filename)" />
</ItemGroup>
<ItemGroup Condition=" !($(DefineConstants.Contains('INCLUDE_TRANSFORM_BROWSER')))">
<!-- XAML elements -->
<None Include="**\*.xaml" />
Expand Down

0 comments on commit 0a9e144

Please sign in to comment.