Fix NuGet package compliance issues (#13045)

This commit is contained in:
Aditya Patwardhan
2020-06-29 10:57:17 -07:00
committed by GitHub
parent 766e166f99
commit a3101fa35c
3 changed files with 19 additions and 12 deletions
+11 -2
View File
@@ -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)]
@@ -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
}
@@ -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 ) {
@@ -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)
@@ -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
+6 -6
View File
@@ -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>
<contentFiles>
<files include="**/*" buildAction="None" copyToOutput="true" flatten="false" />
</contentFiles>
@@ -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>
@@ -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