Skip to content

Commit

Permalink
Reformat Microsoft.WinGet.Client module output (#3088)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryfu-msft authored Mar 23, 2023
1 parent 67fb9ed commit ea86a01
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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 -->
Expand All @@ -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>
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit ea86a01

Please sign in to comment.