更新包,增加默认依赖库

This commit is contained in:
zqm
2026-02-05 14:02:58 +08:00
parent 5bf30d8e58
commit 01d737263b
2 changed files with 83 additions and 5 deletions

View File

@@ -209,16 +209,19 @@ $nuspecContent = @"
<!-- </group> -->
<!-- </dependencies> -->
</metadata>
<!-- WebSocketSharp -->
<dependencies>
<group targetFramework=".NETFramework4.0">
<dependency id="Newtonsoft.Json" version="8.0.3" />
<dependency id="WebSocketSharp" version="1.0.3-rc11" />
</group>
</dependencies>
<files>
<file src="$targetDllName" target="lib\net40\" />
<file src="$([System.IO.Path]::ChangeExtension($targetDllName, ".pdb"))" target="lib\net40\" />
<file src="$([System.IO.Path]::ChangeExtension($targetDllName, ".xml"))" target="lib\net40\" />
<file src="websocket-sharp.dll" target="lib\net40\" />
<file src="websocket-sharp.pdb" target="lib\net40\" />
<file src="websocket-sharp.xml" target="lib\net40\" />
<file src="$iconFileName" target="\" />
</files>
</package>
@@ -257,13 +260,88 @@ if (Test-Path $sourcePdbPath) {
Write-Host "已复制$sourcePdbPath$destPdbPath"
}
# 复制xml文件到包结构中
# 生成XML文档文件
$targetXmlName = [System.IO.Path]::ChangeExtension($targetDllName, ".xml")
$sourceXmlPath = Join-Path $output $targetXmlName
# 初始化binDir变量
$binDir = Join-Path $scriptDir "CubeLib\bin\$configuration"
# 尝试从bin目录复制XML文件
$binXmlPath = Join-Path $binDir $targetXmlName
if (Test-Path $binXmlPath) {
Copy-Item -Path $binXmlPath -Destination $sourceXmlPath -Force
Write-Host "Copied $binXmlPath to $sourceXmlPath"
}
else {
# 如果bin目录中没有xml文件尝试生成一个包含文档注释的xml文件
$xmlContent = @'
<?xml version="1.0" encoding="utf-8"?>
<doc>
<assembly>
<name>JoyD.Windows.CS.CubeLib</name>
</assembly>
<members>
<member name="T:JoyD.Windows.CS.CubeLib.WebSocket.IWebSocketClient">
<summary>
WebSocket客户端接口
</summary>
</member>
<member name="T:JoyD.Windows.CS.CubeLib.WebSocket.WebSocketClient">
<summary>
WebSocket客户端实现
</summary>
</member>
<member name="T:JoyD.Windows.CS.CubeLib.WebSocket.IWebSocketServer">
<summary>
WebSocket服务器接口
</summary>
</member>
<member name="T:JoyD.Windows.CS.CubeLib.WebSocket.WebSocketServer">
<summary>
WebSocket服务器实现
</summary>
</member>
</members>
</doc>
'@
Set-Content -Path $sourceXmlPath -Value $xmlContent -Encoding UTF8
Write-Host "Created XML documentation file with basic comments at $sourceXmlPath"
}
# 移除重复的复制逻辑
$destXmlPath = Join-Path $libDir $targetXmlName
if (Test-Path $sourceXmlPath) {
Copy-Item -Path $sourceXmlPath -Destination $destXmlPath -Force
Write-Host "已复制$sourceXmlPath$destXmlPath"
Write-Host "已复制 $sourceXmlPath $destXmlPath"
}
# 复制websocket-sharp.dll到包结构中
$webSocketSharpDll = "websocket-sharp.dll"
$sourceWebSocketSharpPath = Join-Path $output $webSocketSharpDll
$destWebSocketSharpPath = Join-Path $libDir $webSocketSharpDll
if (Test-Path $sourceWebSocketSharpPath) {
Copy-Item -Path $sourceWebSocketSharpPath -Destination $destWebSocketSharpPath -Force
Write-Host "已复制$sourceWebSocketSharpPath$destWebSocketSharpPath"
}
# 复制websocket-sharp.pdb到包结构中
$webSocketSharpPdb = "websocket-sharp.pdb"
$sourceWebSocketSharpPdbPath = Join-Path $output $webSocketSharpPdb
$destWebSocketSharpPdbPath = Join-Path $libDir $webSocketSharpPdb
if (Test-Path $sourceWebSocketSharpPdbPath) {
Copy-Item -Path $sourceWebSocketSharpPdbPath -Destination $destWebSocketSharpPdbPath -Force
Write-Host "已复制$sourceWebSocketSharpPdbPath$destWebSocketSharpPdbPath"
}
# 复制websocket-sharp.xml到包结构中
$webSocketSharpXml = "websocket-sharp.xml"
$sourceWebSocketSharpXmlPath = Join-Path $output $webSocketSharpXml
$destWebSocketSharpXmlPath = Join-Path $libDir $webSocketSharpXml
if (Test-Path $sourceWebSocketSharpXmlPath) {
Copy-Item -Path $sourceWebSocketSharpXmlPath -Destination $destWebSocketSharpXmlPath -Force
Write-Host "已复制$sourceWebSocketSharpXmlPath$destWebSocketSharpXmlPath"
}
# 复制图标文件到包结构根目录