Skip to content

Commit

Permalink
Add multi-targeting support to Bonsai.csproj
Browse files Browse the repository at this point in the history
  • Loading branch information
PathogenDavid committed Jul 31, 2024
1 parent 7d5391a commit 585d0ea
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Bonsai/Bonsai.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@
<Description>A visual programming language for data stream processing built on top of Rx for .NET.</Description>
<PackageTags>Bonsai Rx Reactive Extensions</PackageTags>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<TargetFrameworks Condition="'$(ContinuousIntegrationBuild)' != 'true'">net48;net6.0-windows</TargetFrameworks>
<TargetFramework Condition="'$(ContinuousIntegrationBuild)' == 'true'">net48</TargetFramework>
<TargetFrameworks>net48;net6.0-windows</TargetFrameworks>
<UseWindowsForms>true</UseWindowsForms>
<OutputType>Exe</OutputType>
<DisableWinExeOutputInference>true</DisableWinExeOutputInference>
<ApplicationIcon>..\Bonsai.Editor\Bonsai.ico</ApplicationIcon>

<!-- The installer and CI scripts rely on the output path, don't include the target framework in the pivot for the primary target -->
<ArtifactsPivots Condition="'$(TargetFramework)' == 'net48'">$(Configuration.ToLowerInvariant())</ArtifactsPivots>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net48'">
<ApplicationManifest>App.manifest</ApplicationManifest>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Reflection.MetadataLoadContext" Version="7.0.0" PrivateAssets="all" />
<PackageReference Include="ILRepack" Version="2.0.34">
Expand Down Expand Up @@ -80,6 +82,7 @@
<Error Condition="!$([System.OperatingSystem]::IsWindows())" Text="Repacking is only supported on Windows." />
<Error Condition="!Exists('$(OutputPath)Bonsai.exe')" Text="Project must be built before repacking. '$(OutputPath)Bonsai.exe' not found." />
<Error Condition="'$(RepackedOutputPath)' == '' or '$(RepackedOutputFilePath)' == ''" Text="Repacked output path not configured." />
<Error Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework'" Text="Repacking is only supported when targeting .NET Framework." />

<MakeDir Directories="$(RepackedOutputPath)" />

Expand Down Expand Up @@ -110,14 +113,14 @@
<Copy SourceFiles="$(TargetDir)NuGet.config" DestinationFolder="$(RepackedOutputPath)" />
</Target>

<Target Name="UseRepackOutputForPackage" Condition="'$(UseRepackForBootstrapperPackage)' == 'true'" AfterTargets="BuiltProjectOutputGroup" DependsOnTargets="ConfigureRepack">
<Target Name="UseRepackOutputForPackage" Condition="'$(UseRepackForBootstrapperPackage)' == 'true' and '$(TargetFrameworkIdentifier)' == '.NETFramework'" AfterTargets="BuiltProjectOutputGroup" DependsOnTargets="ConfigureRepack">
<Error Condition="!Exists('$(RepackedOutputFilePath)')" Text="Project must be repacked before packing. '$(RepackedOutputFilePath)' not found." />
<ItemGroup>
<BuiltProjectOutputGroupOutput Remove="@(BuiltProjectOutputGroupOutput)" />
<BuiltProjectOutputGroupOutput Include="$(RepackedOutputFilePath)" />
</ItemGroup>
</Target>
<Target Name="UseRepackOutputForSymbolPackage" Condition="'$(UseRepackForBootstrapperPackage)' == 'true'" AfterTargets="DebugSymbolsProjectOutputGroup" DependsOnTargets="ConfigureRepack">
<Target Name="UseRepackOutputForSymbolPackage" Condition="'$(UseRepackForBootstrapperPackage)' == 'true' and '$(TargetFrameworkIdentifier)' == '.NETFramework'" AfterTargets="DebugSymbolsProjectOutputGroup" DependsOnTargets="ConfigureRepack">
<Error Condition="!Exists('$(RepackedOutputSymbolFilePath)')" Text="Project must be repacked before packing. '$(RepackedOutputFilePath)' not found." />
<ItemGroup>
<DebugSymbolsProjectOutputGroupOutput Remove="@(DebugSymbolsProjectOutputGroupOutput)" />
Expand Down

0 comments on commit 585d0ea

Please sign in to comment.