Simplify build for platform

This commit is contained in:
Frans van Dorsselaer committed 2025-10-26 15:02:23 +01:00
1 parent 46d815e3f3
commit 826f38e93f
9 files changed
+51 -34

No files matched your search

+4 -4
View File
@@ -52,7 +52,7 @@ jobs:
- name: Build
run: |
dotnet build --configuration Release --no-restore --property:Platform=x64
dotnet build --configuration Release --no-restore --property:Platform=arm64 Usbipd
dotnet build --configuration Release --no-restore --property:Platform=ARM64 Usbipd
- name: Test
run: |
@@ -61,11 +61,11 @@ jobs:
- name: Build (Installers)
run: |
dotnet publish --configuration Release --no-build --runtime win-x64 Usbipd
dotnet publish --configuration Release --no-build --runtime win-arm64 Usbipd
dotnet publish --configuration Release --no-build --runtime win-x64 --property:PublishProfile=x64 Usbipd
dotnet publish --configuration Release --no-build --runtime win-arm64 --property:PublishProfile=arm64 Usbipd
dotnet publish --configuration Release --no-build Usbipd.PowerShell
dotnet build --configuration Release --no-restore --property:Platform=x64 Installer
dotnet build --configuration Release --no-restore --property:Platform=arm64 Installer
dotnet build --configuration Release --no-restore --property:Platform=ARM64 Installer
- name: Upload Artifacts
uses: actions/upload-artifact@v4
+3 -8
View File
@@ -12,19 +12,14 @@ SPDX-License-Identifier: GPL-3.0-only
<!-- Use the latest .NET SDK -->
<MainTargetFramework>net9.0</MainTargetFramework>
<!-- This product requires a supported version of Windows 10 or Windows Server 2019 -->
<MinimumWindowsVersion>10.0.17763</MinimumWindowsVersion>
<!-- This product only supports x64 and arm64 (the only architectures supported by VBoxUsb) -->
<Platforms>x64;ARM64</Platforms>
<EnableDynamicPlatformResolution>true</EnableDynamicPlatformResolution>
<!-- This allows building on Linux; however, building the installer requires Windows -->
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<!-- Use the latest C# language standard -->
<LangVersion>13.0</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<!-- This allows building on Linux; however, building the installer requires Windows -->
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<!-- Be very strict -->
<WarningLevel>9999</WarningLevel>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
-3
View File
@@ -15,9 +15,6 @@ SPDX-License-Identifier: GPL-3.0-only
<!-- See: https://learn.microsoft.com/en-us/dotnet/standard/library-guidance/strong-naming#create-strong-named-net-libraries -->
<SignAssembly Condition="$(TargetFramework.Contains('netstandard'))">true</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)\strongname.snk</AssemblyOriginatorKeyFile>
<RuntimeIdentifiers Condition="'$(Platforms)' != 'AnyCPU'">win-x64;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifier Condition="'$(Platforms)' != 'AnyCPU' and '$(Platform)' == 'x64'">win-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(Platforms)' != 'AnyCPU' and '$(Platform)' == 'ARM64'">win-arm64</RuntimeIdentifier>
</PropertyGroup>
<Target Name="RemoveDebug" AfterTargets="Publish">
+34
View File
@@ -0,0 +1,34 @@
<!--
SPDX-FileCopyrightText: 2025 Frans van Dorsselaer
SPDX-License-Identifier: GPL-3.0-only
-->
<Project>
<PropertyGroup>
<!-- This product requires a supported version of Windows 10 or Windows Server 2019 -->
<!-- Currently, oldest version not EOL is Windows Server 2019 (version 1809) -->
<MinimumWindowsVersion>10.0.17763</MinimumWindowsVersion>
<TargetPlatformIdentifier>Windows</TargetPlatformIdentifier>
<TargetPlatformVersion>$(MinimumWindowsVersion)</TargetPlatformVersion>
<TargetPlatformMinVersion>$(MinimumWindowsVersion)</TargetPlatformMinVersion>
<!-- The drivers are available on these platforms only -->
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
<!-- Since we use PInvoke, we cannot use AnyCPU -->
<Platforms>x64;ARM64</Platforms>
<!-- Since the output directory already starts with the platform XXX, and we only support win-XXX, there is no need for this -->
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<!-- Use 'dotnet build' or 'dotnet test' with '-p:Platform=XXX', which implies the runtime -->
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == '' and '$(Platform)' == 'x64'">win-x64</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == '' and '$(Platform)' == 'ARM64'">win-arm64</RuntimeIdentifier>
<!-- Use 'dotnet publish' with '-r win-XXX', which implies the platform -->
<Platform Condition="'$(Platform)' == '' and '$(RuntimeIdentifier)' == 'win-x64'">x64</Platform>
<Platform Condition="'$(Platform)' == '' and '$(RuntimeIdentifier)' == 'win-arm64'">ARM64</Platform>
</PropertyGroup>
</Project>
+2 -3
View File
@@ -6,11 +6,10 @@ SPDX-License-Identifier: GPL-3.0-only
-->
<Project Sdk="MSTest.Sdk">
<Import Project="../Platform.Build.props" />
<PropertyGroup>
<TargetFramework>$(MainTargetFramework)</TargetFramework>
<TargetPlatformIdentifier>windows</TargetPlatformIdentifier>
<TargetPlatformVersion>$(MinimumWindowsVersion)</TargetPlatformVersion>
<TargetPlatformMinVersion>$(MinimumWindowsVersion)</TargetPlatformMinVersion>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<IsAotCompatible>false</IsAotCompatible>
</PropertyGroup>
@@ -7,12 +7,10 @@ SPDX-License-Identifier: GPL-3.0-only
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>arm64</Platform>
<PublishDir>bin\publish\arm64</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<Platform>ARM64</Platform>
<RuntimeIdentifier>win-arm64</RuntimeIdentifier>
<PublishProtocol>FileSystem</PublishProtocol>
<PublishDir>bin\publish\arm64</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>false</PublishSingleFile>
<PublishReadyToRun>false</PublishReadyToRun>
</PropertyGroup>
</Project>
@@ -8,11 +8,9 @@ SPDX-License-Identifier: GPL-3.0-only
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>x64</Platform>
<PublishDir>bin\publish\x64</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PublishProtocol>FileSystem</PublishProtocol>
<PublishDir>bin\publish\x64</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>false</PublishSingleFile>
<PublishReadyToRun>false</PublishReadyToRun>
</PropertyGroup>
</Project>
+2 -5
View File
@@ -6,19 +6,16 @@ SPDX-License-Identifier: GPL-3.0-only
-->
<Project Sdk="Microsoft.NET.Sdk.Worker">
<Import Project="../Platform.Build.props" />
<PropertyGroup>
<TargetFramework>$(MainTargetFramework)</TargetFramework>
<TargetPlatformIdentifier>windows</TargetPlatformIdentifier>
<TargetPlatformVersion>$(MinimumWindowsVersion)</TargetPlatformVersion>
<TargetPlatformMinVersion>$(MinimumWindowsVersion)</TargetPlatformMinVersion>
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
<OutputType>Exe</OutputType>
<ApplicationManifest>app.manifest</ApplicationManifest>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsPublishable>true</IsPublishable>
<PublishProfile Condition=" 'BuildingInsideVisualStudio' != 'true' ">Properties\PublishProfiles\InputForInstaller_$(RuntimeIdentifier).pubxml</PublishProfile>
<PublishAot>true</PublishAot>
<CopyOutputSymbolsToPublishDirectory>false</CopyOutputSymbolsToPublishDirectory>
<OptimizationPreference>Speed</OptimizationPreference>
+1 -2
View File
@@ -13,14 +13,13 @@ SPDX-License-Identifier: GPL-3.0-only
<File Path=".editorconfig" />
<File Path=".gitattributes" />
<File Path=".gitignore" />
<File Path="codecov.yml" />
<File Path="COPYING.md" />
<File Path="Directory.Build.props" />
<File Path="Directory.Build.targets" />
<File Path="Directory.Packages.props" />
<File Path="GitVersion.yml" />
<File Path="global.json" />
<File Path="nuget.config" />
<File Path="Platform.Build.props" />
<File Path="README.md" />
</Folder>
<Project Path="Installer/Installer.wixproj" Type="b7dd6f7e-def8-4e67-b5b7-07ef123db6f0">