增加nuget图标
This commit is contained in:
@@ -21,7 +21,7 @@ $projectUrl = "https://github.com/joyd/toprie-library"
|
||||
$licenseUrl = "https://opensource.org/licenses/MIT"
|
||||
$iconFileName = "Toprie.png"
|
||||
$iconSourcePath = Join-Path $scriptDir $iconFileName
|
||||
$iconUrl = $iconFileName
|
||||
$iconUrl = "http://47.111.181.23:8081/repository/gradle/main/Toprie.png"
|
||||
$releaseNotes = "初始版本发布"
|
||||
|
||||
# 其他设置
|
||||
@@ -122,7 +122,8 @@ $tempProjContent = @"
|
||||
<PackageTags>$tagsString</PackageTags>
|
||||
<PackageProjectUrl>$projectUrl</PackageProjectUrl>
|
||||
<PackageLicenseUrl>$licenseUrl</PackageLicenseUrl>
|
||||
<PackageIcon>$iconUrl</PackageIcon>
|
||||
<PackageIcon>$iconFileName</PackageIcon>
|
||||
<PackageIconUrl></PackageIconUrl>
|
||||
<PackageReleaseNotes>$releaseNotes</PackageReleaseNotes>
|
||||
<PackageOutputPath>.</PackageOutputPath>
|
||||
<RestorePackagesConfig>true</RestorePackagesConfig>
|
||||
@@ -132,6 +133,7 @@ $tempProjContent = @"
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="$targetDllName" Pack="true" PackagePath="lib\net40\$targetDllName" />
|
||||
<Content Include="$iconFileName" Pack="true" PackagePath="$iconFileName" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
"@
|
||||
@@ -164,7 +166,8 @@ $nuspecContent = @"
|
||||
<tags>$tagsString</tags>
|
||||
<projectUrl>$projectUrl</projectUrl>
|
||||
<licenseUrl>$licenseUrl</licenseUrl>
|
||||
<icon>$iconUrl</icon>
|
||||
<icon>$iconFileName</icon>
|
||||
<iconUrl>$iconUrl</iconUrl>
|
||||
<!-- 可以根据需要添加更多元数据,如依赖项、框架引用等 -->
|
||||
<!-- <dependencies> -->
|
||||
<!-- <group targetFramework=".NETFramework4.0"> -->
|
||||
@@ -174,7 +177,7 @@ $nuspecContent = @"
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="$targetDllName" target="lib\net40\" />
|
||||
<file src="$iconFileName" target="" />
|
||||
<file src="$iconFileName" target="\" />
|
||||
</files>
|
||||
</package>
|
||||
"@
|
||||
@@ -216,7 +219,7 @@ if (Test-Path $sourceIconPath) {
|
||||
# 创建[Content_Types].xml文件(有效nupkg必需)
|
||||
$contentTypesPath = Join-Path $tempDir "[Content_Types].xml"
|
||||
# 使用-LiteralPath参数避免方括号被解释为通配符
|
||||
Set-Content -LiteralPath $contentTypesPath -Value "<?xml version='1.0' encoding='utf-8'?><Types xmlns='http://schemas.openxmlformats.org/package/2006/content-types'><Default Extension='dll' ContentType='application/octet-stream'/><Default Extension='xml' ContentType='application/xml'/></Types>"
|
||||
Set-Content -LiteralPath $contentTypesPath -Value "<?xml version='1.0' encoding='utf-8'?><Types xmlns='http://schemas.openxmlformats.org/package/2006/content-types'><Default Extension='dll' ContentType='application/octet-stream'/><Default Extension='xml' ContentType='application/xml'/><Default Extension='png' ContentType='image/png'/></Types>"
|
||||
Write-Host "已在 $contentTypesPath 创建[Content_Types].xml"
|
||||
|
||||
# 复制nuspec文件到包结构根目录
|
||||
|
||||
Reference in New Issue
Block a user