Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
42 changes: 35 additions & 7 deletions src/Microsoft.OpenApi.Workbench/Microsoft.OpenApi.Workbench.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>

<!-- Windows-specific configuration -->
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
<TargetFramework>net8.0-windows</TargetFramework>
<OutputType>WinExe</OutputType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
Expand All @@ -8,29 +10,55 @@
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<NoWarn>NU1903</NoWarn>
</PropertyGroup>
<ItemGroup>

<!-- Non-Windows configuration - create an empty library -->
<PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
<TargetFramework>net8.0</TargetFramework>
<OutputType>Library</OutputType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<NoWarn>NU1903</NoWarn>
</PropertyGroup>

<!-- Windows-specific dependencies -->
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.14.15">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Windows.Compatibility" Version="9.0.9" />
</ItemGroup>
<ItemGroup>

<!-- Windows-specific resources -->
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<Resource Include="Themes\Metro\HowToApplyTheme.txt" />
</ItemGroup>

<!-- Project references (available on all platforms) -->
<ItemGroup>
<ProjectReference Include="..\Microsoft.OpenApi.YamlReader\Microsoft.OpenApi.YamlReader.csproj" />
<ProjectReference Include="..\Microsoft.OpenApi\Microsoft.OpenApi.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />

<!-- Exclude WPF-specific files on non-Windows platforms -->
<ItemGroup Condition="'$(OS)' != 'Windows_NT'">
<Compile Remove="**/*.xaml.cs" />
<Compile Remove="App.xaml.cs" />
<Compile Remove="MainWindow.xaml.cs" />
<Compile Remove="EnumBindingSourceExtension.cs" />
<Compile Remove="MainModel.cs" />
<Compile Remove="StatsVisitor.cs" />
<Compile Remove="Properties/**" />
<None Remove="**/*.xaml" />
<Page Remove="**/*.xaml" />
</ItemGroup>
<ItemGroup>

<!-- Windows-specific XAML excludes -->
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<Page Remove="Themes\Metro\Metro.MSControls.Core.Implicit.xaml" />
<Page Remove="Themes\Metro\Metro.MSControls.Toolkit.Implicit.xaml" />
<Page Remove="Themes\Metro\Styles.Shared.xaml" />
<Page Remove="Themes\Metro\Styles.WPF.xaml" />
<Page Remove="Themes\Metro\Theme.Colors.xaml" />
<Compile Remove="NonWindowsPlatformPlaceholder.cs" />
</ItemGroup>
</Project>
10 changes: 10 additions & 0 deletions src/Microsoft.OpenApi.Workbench/NonWindowsPlatformPlaceholder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// This file exists to allow the Workbench project to build on non-Windows platforms
// The actual WPF application is only available on Windows

namespace Microsoft.OpenApi.Workbench
{
// Empty placeholder class for non-Windows builds
internal class NonWindowsPlatformPlaceholder
{
}
}