Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reformat Microsoft.WinGet.Client module output #3088

Merged
merged 6 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,14 @@ jobs:
Contents: '**\*'
TargetFolder: '$(Build.ArtifactStagingDirectory)'

- task: NuGetCommand@2
ryfu-msft marked this conversation as resolved.
Show resolved Hide resolved
displayName: Create PowerShell module NuGetPackage
inputs:
command: pack
packagesToPack: '$(Build.ArtifactStagingDirectory)\Microsoft.WinGet.Client\Microsoft.WinGet.Client.nuspec'
packDestination: '$(Build.ArtifactStagingDirectory)'

- task: PublishPipelineArtifact@1
displayName: Publish PowerShell Module Artifacts
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
targetPath: '$(Build.ArtifactStagingDirectory)'
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 @@ -102,8 +104,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 @@ -121,17 +123,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
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<package >
<metadata>
<id>Microsoft.WinGet.Client</id>
ryfu-msft marked this conversation as resolved.
Show resolved Hide resolved
<version>0.1.0</version>
ryfu-msft marked this conversation as resolved.
Show resolved Hide resolved
<authors>Microsoft</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
ryfu-msft marked this conversation as resolved.
Show resolved Hide resolved
<licenseUrl>https://github.com/microsoft/winget-cli/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/microsoft/winget-cli</projectUrl>
<description>The Windows Package Manager PowerShell Module</description>
<copyright>$copyright$</copyright>
ryfu-msft marked this conversation as resolved.
Show resolved Hide resolved
<tags>winget</tags>
<dependencies>
<group targetFramework=".NETFramework4.8">
ryfu-msft marked this conversation as resolved.
Show resolved Hide resolved
</group>
<group targetFramework="net6.0-windows10.0.22000.0">
</group>
</dependencies>
</metadata>
</package>
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