Skip to content

Commit 01544f9

Browse files
authored
Merge pull request #45 from BinkyLabs/chore/non-windows
chore: disables WPF solution on non windows platforms
2 parents 396779e + 1dbd8bc commit 01544f9

File tree

2 files changed

+45
-7
lines changed

2 files changed

+45
-7
lines changed
Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
2+
3+
<!-- Windows-specific configuration -->
4+
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
35
<TargetFramework>net8.0-windows</TargetFramework>
46
<OutputType>WinExe</OutputType>
57
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
@@ -8,29 +10,55 @@
810
<EnableWindowsTargeting>true</EnableWindowsTargeting>
911
<NoWarn>NU1903</NoWarn>
1012
</PropertyGroup>
11-
<ItemGroup>
13+
14+
<!-- Non-Windows configuration - create an empty library -->
15+
<PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
16+
<TargetFramework>net8.0</TargetFramework>
17+
<OutputType>Library</OutputType>
18+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
19+
<NoWarn>NU1903</NoWarn>
20+
</PropertyGroup>
21+
22+
<!-- Windows-specific dependencies -->
23+
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
1224
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.14.15">
1325
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1426
<PrivateAssets>all</PrivateAssets>
1527
</PackageReference>
1628
<PackageReference Include="Microsoft.Windows.Compatibility" Version="9.0.9" />
1729
</ItemGroup>
18-
<ItemGroup>
30+
31+
<!-- Windows-specific resources -->
32+
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
1933
<Resource Include="Themes\Metro\HowToApplyTheme.txt" />
2034
</ItemGroup>
35+
36+
<!-- Project references (available on all platforms) -->
2137
<ItemGroup>
2238
<ProjectReference Include="..\Microsoft.OpenApi.YamlReader\Microsoft.OpenApi.YamlReader.csproj" />
2339
<ProjectReference Include="..\Microsoft.OpenApi\Microsoft.OpenApi.csproj" />
2440
</ItemGroup>
25-
<ItemGroup>
26-
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
27-
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
41+
42+
<!-- Exclude WPF-specific files on non-Windows platforms -->
43+
<ItemGroup Condition="'$(OS)' != 'Windows_NT'">
44+
<Compile Remove="**/*.xaml.cs" />
45+
<Compile Remove="App.xaml.cs" />
46+
<Compile Remove="MainWindow.xaml.cs" />
47+
<Compile Remove="EnumBindingSourceExtension.cs" />
48+
<Compile Remove="MainModel.cs" />
49+
<Compile Remove="StatsVisitor.cs" />
50+
<Compile Remove="Properties/**" />
51+
<None Remove="**/*.xaml" />
52+
<Page Remove="**/*.xaml" />
2853
</ItemGroup>
29-
<ItemGroup>
54+
55+
<!-- Windows-specific XAML excludes -->
56+
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
3057
<Page Remove="Themes\Metro\Metro.MSControls.Core.Implicit.xaml" />
3158
<Page Remove="Themes\Metro\Metro.MSControls.Toolkit.Implicit.xaml" />
3259
<Page Remove="Themes\Metro\Styles.Shared.xaml" />
3360
<Page Remove="Themes\Metro\Styles.WPF.xaml" />
3461
<Page Remove="Themes\Metro\Theme.Colors.xaml" />
62+
<Compile Remove="NonWindowsPlatformPlaceholder.cs" />
3563
</ItemGroup>
3664
</Project>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// This file exists to allow the Workbench project to build on non-Windows platforms
2+
// The actual WPF application is only available on Windows
3+
4+
namespace Microsoft.OpenApi.Workbench
5+
{
6+
// Empty placeholder class for non-Windows builds
7+
internal class NonWindowsPlatformPlaceholder
8+
{
9+
}
10+
}

0 commit comments

Comments
 (0)