Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
13 changes: 11 additions & 2 deletions tools/packaging/packaging.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Import-Module "$PSScriptRoot\..\Xml" -ErrorAction Stop -Force
$DebianDistributions = @("ubuntu.16.04", "ubuntu.18.04", "debian.9", "debian.10", "debian.11")
$RedhatDistributions = @("rhel.7","centos.8")
$script:netCoreRuntime = 'net5.0'
$script:iconFileName = "Powershell_black_64.png"
$script:iconPath = Join-Path -path $PSScriptRoot -ChildPath "../../assets/$iconFileName" -Resolve

function Start-PSPackage {
[CmdletBinding(DefaultParameterSetName='Version',SupportsShouldProcess=$true)]
Expand Down Expand Up @@ -2001,6 +2003,10 @@ function New-ILNugetPackage
}

New-NuSpec -PackageId $fileBaseName -PackageVersion $PackageVersion -Dependency $deps -FilePath (Join-Path $filePackageFolder.FullName "$fileBaseName.nuspec")

# Copy icon file to package
Copy-Item -Path $iconPath -Destination "$($filePackageFolder.Fullname)/$iconFileName" -Verbose

New-NugetPackage -NuSpecPath $filePackageFolder.FullName -PackageDestinationPath $PackagePath
}

Expand Down Expand Up @@ -2134,7 +2140,7 @@ function New-NuSpec {
throw "New-NuSpec can be only executed on Windows platform."
}

$nuspecTemplate = $packagingStrings.NuspecTemplate -f $PackageId,$PackageVersion
$nuspecTemplate = $packagingStrings.NuspecTemplate -f $PackageId,$PackageVersion,$iconFileName
$nuspecObj = [xml] $nuspecTemplate

if ( ($null -ne $Dependency) -and $Dependency.Count -gt 0 ) {
Expand Down Expand Up @@ -3689,6 +3695,9 @@ function New-GlobalToolNupkg
$packageInfo | ForEach-Object {
$ridFolder = New-Item -Path (Join-Path $_.RootFolder "tools/$script:netCoreRuntime/any") -ItemType Directory

# Add the icon file to the package
Copy-Item -Path $iconPath -Destination "$($_.RootFolder)/$iconFileName" -Verbose

$packageType = $_.Type

switch ($packageType)
Expand Down Expand Up @@ -3775,7 +3784,7 @@ function New-GlobalToolNupkg
}

$packageName = $_.PackageName
$nuSpec = $packagingStrings.GlobalToolNuSpec -f $packageName, $PackageVersion
$nuSpec = $packagingStrings.GlobalToolNuSpec -f $packageName, $PackageVersion, $iconFileName
$nuSpec | Out-File -FilePath (Join-Path $_.RootFolder "$packageName.nuspec") -Encoding ascii
$toolSettings | Out-File -FilePath (Join-Path $ridFolder "DotnetToolSettings.xml") -Encoding ascii

Expand Down
12 changes: 6 additions & 6 deletions tools/packaging/packaging.strings.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,14 @@ open {0}
<version>{1}</version>
<authors>Microsoft</authors>
<owners>Microsoft,PowerShell</owners>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Runtime for hosting PowerShell</description>
<projectUrl>https://github.com/PowerShell/PowerShell</projectUrl>
<iconUrl>https://github.com/PowerShell/PowerShell/blob/master/assets/Powershell_black_64.png?raw=true</iconUrl>
<licenseUrl>https://github.com/PowerShell/PowerShell/blob/master/LICENSE.txt</licenseUrl>
<icon>{2}</icon>
<license type="expression">MIT</license>
<tags>PowerShell</tags>
<language>en-US</language>
<copyright>&#169; Microsoft Corporation.</copyright>
<copyright>&#169; Microsoft Corporation. All rights reserved.</copyright>
Comment thread
adityapatwardhan marked this conversation as resolved.
<contentFiles>
<files include="**/*" buildAction="None" copyToOutput="true" flatten="false" />
</contentFiles>
Expand Down Expand Up @@ -167,13 +167,13 @@ open {0}
<authors>Microsoft</authors>
<owners>Microsoft,PowerShell</owners>
<projectUrl>https://github.com/PowerShell/PowerShell</projectUrl>
<iconUrl>https://github.com/PowerShell/PowerShell/blob/master/assets/Powershell_black_64.png?raw=true</iconUrl>
<icon>{2}</icon>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>PowerShell global tool</description>
<license type="expression">MIT</license>
<tags>PowerShell</tags>
<language>en-US</language>
<copyright>&#169; Microsoft Corporation.</copyright>
<copyright>&#169; Microsoft Corporation. All rights reserved.</copyright>
<packageTypes>
<packageType name="DotnetTool" />
</packageTypes>
Expand Down
6 changes: 2 additions & 4 deletions tools/releaseBuild/azureDevOps/templates/nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ jobs:
parameters:
ReleaseTagVar: $(ReleaseTagVar)

- task: NuGetToolInstaller@0
displayName: 'Install NuGet 4.9.3'
inputs:
versionSpec: 4.9.3
- task: NuGetToolInstaller@1
displayName: 'Install NuGet.exe'

- powershell: |
Import-Module $env:BUILD_SOURCESDIRECTORY\build.psm1
Expand Down