winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit ea86a012c48f9e444098263857f809a0d3deb8d9
parent 67fb9ed23e80c93326929e5bfe421a2cc8fab9f7
Author: Ryan Fu <69221034+ryfu-msft@users.noreply.github.com>
Date:   Thu, 23 Mar 2023 08:19:54 -0700

Reformat Microsoft.WinGet.Client module output (#3088)


Diffstat:
Msrc/PowerShell/Microsoft.WinGet.Client/Microsoft.WinGet.Client.csproj | 16+++++++++-------
Msrc/PowerShell/Microsoft.WinGet.Client/Module/Microsoft.WinGet.Client.psd1 | 26+++++++++++++++++++++-----
2 files changed, 30 insertions(+), 12 deletions(-)

diff --git a/src/PowerShell/Microsoft.WinGet.Client/Microsoft.WinGet.Client.csproj b/src/PowerShell/Microsoft.WinGet.Client/Microsoft.WinGet.Client.csproj @@ -1,6 +1,7 @@ <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> + <!-- If these target frameworks are updated, make sure to also update the .psd1 and .nuspec files.--> <TargetWindowsVersion>10.0.22000.0</TargetWindowsVersion> <CoreFramework>net6.0-windows$(TargetWindowsVersion)</CoreFramework> <DesktopFramework>net48</DesktopFramework> @@ -12,6 +13,7 @@ <BuildOutputDirectory>$(SolutionDir)$(Platform)\$(Configuration)\</BuildOutputDirectory> <OutputPath>$(BuildOutputDirectory)$(MSBuildProjectName)</OutputPath> <PowerShellModuleOutputDirectory>$(BuildOutputDirectory)PowerShell\Microsoft.WinGet.Client</PowerShellModuleOutputDirectory> + <PowerShellModuleLibDirectory>$(PowerShellModuleOutputDirectory)\lib</PowerShellModuleLibDirectory> <Platforms>x64;x86;ARM64</Platforms> <TargetFrameworks>$(CoreFramework);$(DesktopFramework)</TargetFrameworks> <DocumentationFile>$(OutputPath)\Microsoft.WinGet.Client.xml</DocumentationFile> @@ -103,8 +105,8 @@ </ItemGroup> <Message Importance="high" Text="Copying '@(WinRTActDll)'" /> <Copy SourceFiles="@(WinRTActDll)" DestinationFolder="$(OutputPath)" /> - <Copy SourceFiles="@(WinRTActDll)" DestinationFolder="$(PowerShellModuleOutputDirectory)\$(Platform)\Core" /> - <Copy SourceFiles="@(WinRTActDll)" DestinationFolder="$(PowerShellModuleOutputDirectory)\$(Platform)\Desktop" /> + <Copy SourceFiles="@(WinRTActDll)" DestinationFolder="$(PowerShellModuleLibDirectory)\$(CoreFramework)\$(Platform)" /> + <Copy SourceFiles="@(WinRTActDll)" DestinationFolder="$(PowerShellModuleLibDirectory)\$(DesktopFramework)\$(Platform)" /> </Target> <!-- Build Microsoft.Winget.Client PowerShell Module --> @@ -122,17 +124,17 @@ <CoreBinaries Include="$(OutputPath)\**\*.*" Exclude="$(OutputPath)\runtimes\**" /> <WindowsRuntime Include="$(OutputPath)\runtimes\win10*\**\*.*" /> </ItemGroup> - <Message Importance="high" Text="Copying @(CoreBinaries) to '$(PowerShellModuleOutputDirectory)\$(Platform)\Core'" /> - <Copy SourceFiles="@(CoreBinaries)" DestinationFolder="$(PowerShellModuleOutputDirectory)\$(Platform)\Core\%(RecursiveDir)" /> - <Copy SourceFiles="@(WindowsRuntime)" DestinationFolder="$(PowerShellModuleOutputDirectory)\$(Platform)\Core\runtimes\%(RecursiveDir)" /> + <Message Importance="high" Text="Copying @(CoreBinaries) to '$(PowerShellModuleLibDirectory)\$(CoreFramework)\$(Platform)'" /> + <Copy SourceFiles="@(CoreBinaries)" DestinationFolder="$(PowerShellModuleLibDirectory)\$(CoreFramework)\$(Platform)\%(RecursiveDir)" /> + <Copy SourceFiles="@(WindowsRuntime)" DestinationFolder="$(PowerShellModuleLibDirectory)\$(CoreFramework)\$(Platform)\runtimes\%(RecursiveDir)" /> </Target> <Target Name="CopyDesktopBinaries" AfterTargets="AfterBuild" Condition="'$(TargetFramework)' == '$(DesktopFramework)'"> <ItemGroup> <DesktopBinaries Include="$(OutputPath)\**\*.*" /> </ItemGroup> - <Message Importance="high" Text="Copying @(DesktopBinaries) to '$(PowerShellModuleOutputDirectory)\$(Platform)\Desktop'" /> - <Copy SourceFiles="@(DesktopBinaries)" DestinationFolder="$(PowerShellModuleOutputDirectory)\$(Platform)\Desktop\%(RecursiveDir)" /> + <Message Importance="high" Text="Copying @(DesktopBinaries) to '$(PowerShellModuleLibDirectory)\$(DesktopFramework)\$(Platform)\Desktop'" /> + <Copy SourceFiles="@(DesktopBinaries)" DestinationFolder="$(PowerShellModuleLibDirectory)\$(DesktopFramework)\$(Platform)\%(RecursiveDir)" /> </Target> </Project> diff --git a/src/PowerShell/Microsoft.WinGet.Client/Module/Microsoft.WinGet.Client.psd1 b/src/PowerShell/Microsoft.WinGet.Client/Module/Microsoft.WinGet.Client.psd1 @@ -12,7 +12,7 @@ RootModule = 'Microsoft.WinGet.Client.psm1' # Version number of this module. -ModuleVersion = '0.0.1' +ModuleVersion = '0.1.0' # Supported PSEditions CompatiblePSEditions = 'Core' @@ -66,11 +66,27 @@ PowerShellVersion = '5.1.0' FormatsToProcess = 'Format.ps1xml' # Modules to import as nested modules of the module specified in RootModule/ModuleToProcess -NestedModules = if ($env:PROCESSOR_ARCHITECTURE -like 'x86') { - "x86\$PSEdition\Microsoft.WinGet.Client.dll" +NestedModules = if ($env:PROCESSOR_ARCHITECTURE -like 'x86') +{ + if ($PSEdition -eq 'Core') + { + "lib\net6.0-windows10.0.22000.0\x86\Microsoft.WinGet.Client.dll" + } + else + { + "lib\net48\x86\Microsoft.WinGet.Client.dll" + } } -else { - "x64\$PSEdition\Microsoft.WinGet.Client.dll" +else +{ + if ($PSEdition -eq 'Core') + { + "lib\net6.0-windows10.0.22000.0\x64\Microsoft.WinGet.Client.dll" + } + else + { + "lib\net48\x64\Microsoft.WinGet.Client.dll" + } } # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.