Add targets to nuget package (#13718)

This commit is contained in:
Flor Chacón 2025-11-14 13:12:02 -08:00 committed by GitHub
parent 8eee7439b2
commit de494011ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 58 additions and 7 deletions

2
.gitignore vendored
View File

@ -9,7 +9,6 @@ tmp
*.user
*.csproj
*.vcxproj
*.targets
*.filters
*.pdb
*.lib
@ -41,7 +40,6 @@ linux/init
initrd/init
bin/
*.nupkg
build/
generated/
*.nuspec
test/linux/unit_tests/wsl_unit_tests

View File

@ -10,12 +10,14 @@
<tags>WSL</tags>
<language>en-us</language>
<license type="expression">MIT</license>
<readme>docs\README.MD</readme>
</metadata>
<files>
<file src="${CMAKE_SOURCE_DIR_NATIVE}\src\windows\wslaclient\WSLAApi.h" target="include"/>
<file src="${CMAKE_SOURCE_DIR_NATIVE}\bin\x64\Release\wslaclient.lib" target="lib\x64"/>
<file src="${CMAKE_SOURCE_DIR_NATIVE}\bin\x64\Release\wslaclient.dll" target="lib\x64"/>
<file src="${CMAKE_SOURCE_DIR_NATIVE}\bin\arm64\Release\wslaclient.lib" target="lib\arm64"/>
<file src="${CMAKE_SOURCE_DIR_NATIVE}\bin\arm64\Release\wslaclient.dll" target="lib\arm64"/>
<file src="${CMAKE_SOURCE_DIR_NATIVE}\bin\x64\Release\wslaclient.lib" target="runtimes\win-x64\native"/>
<file src="${CMAKE_SOURCE_DIR_NATIVE}\bin\x64\Release\wslaclient.dll" target="runtimes\win-x64\native"/>
<file src="${CMAKE_SOURCE_DIR_NATIVE}\bin\arm64\Release\wslaclient.lib" target="runtimes\win-arm64\native"/>
<file src="${CMAKE_SOURCE_DIR_NATIVE}\bin\arm64\Release\wslaclient.dll" target="runtimes\win-arm64\native"/>
<file src="${CMAKE_SOURCE_DIR_NATIVE}\nuget\Microsoft.WSL.Api\**"/>
</files>
</package>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="WSLForApps_ErrorNoPlatform" BeforeTargets="BeforeBuild" Condition="'$(WSLForApps-Platform)' == ''">
<Error Text="wslaclient.dll could not be copied because the AnyCPU platform is being used. Please specify a platform to copy this file, using either RuntimeIdentifier, an architecture specific Platform, or explicitly with WSLForApps-Platform." />
</Target>
<ItemGroup>
<ReferenceCopyLocalPaths Include="$(MSBuildThisFileDirectory)..\runtimes\win-$(WSLForApps-Platform)\wslaclient.dll" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemDefinitionGroup>
<PropertyGroup Condition="'$(WSLForApps-Platform)' == ''">
<WSLForApps-Platform>$(Platform)</WSLForApps-Platform>
</PropertyGroup>
<ClCompile>
<AdditionalIncludeDirectories>
$(MSBuildThisFileDirectory)..\..\include;
%(AdditionalIncludeDirectories)
</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalDependencies>
wslaclient.lib;
%(AdditionalDependencies)
</AdditionalDependencies>
<AdditionalLibraryDirectories>
$(MSBuildThisFileDirectory)..\..\runtimes\win-$(Platform);
%(AdditionalLibraryDirectories)
</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
</Project>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(WSLForApps-Platform)' == ''">
<WSLForApps-Platform Condition="$(RuntimeIdentifier.EndsWith('-x64'))">x64</WSLForApps-Platform>
<WSLForApps-Platform Condition="$(RuntimeIdentifier.EndsWith('-arm64'))">arm64</WSLForApps-Platform>
</PropertyGroup>
<PropertyGroup Condition="'$(WSLForApps-Platform)' == ''">
<WSLForApps-Platform Condition="'$(Platform)' != 'AnyCPU'">$(Platform)</WSLForApps-Platform>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)..\Microsoft.WSL.API.common.targets" />
</Project>

View File

@ -0,0 +1,3 @@
# WSL for Apps
This package contains the `WSLAApi.h` header which defines the WSL for Apps interface.

View File

@ -16,6 +16,6 @@
<files>
<file src="${CMAKE_SOURCE_DIR_NATIVE}\src\windows\inc\WslPluginApi.h" target="build\native\include"/>
<file src="${CMAKE_SOURCE_DIR_NATIVE}\Images\Square44x44Logo.altform-lightunplated_targetsize-256.png" target="images\icon.png"/>
<file src="${CMAKE_SOURCE_DIR_NATIVE}\nuget\README.WslPluginApi.MD" target="docs\README.MD"/>
<file src="${CMAKE_SOURCE_DIR_NATIVE}\nuget\Microsoft.WSL.PluginApi\**"/>
</files>
</package>