Browse Source

add compile script

arthur.wu 2 years ago
parent
commit
0b8d7fa2ea
1 changed files with 69 additions and 0 deletions
  1. 69 0
      Publish.ps1

+ 69 - 0
Publish.ps1

@@ -0,0 +1,69 @@
+dotnet nuget locals all --clear
+
+Function BuildService($serviceName, $copyDll, $copyXml=0, $servicePath='', $copyDest='')
+{
+    if($servicePath -eq '')
+    {
+        $servicePath = "../$serviceName/src"
+    }
+    if($copyDest -eq '')
+    {
+        $copyDest = "../WingCloudServer/src/bin/Debug/net6.0"
+    }
+    nuget restore "$servicePath/$serviceName.csproj" -source "http://nuget.ius.plus:88/v3/index.json;https://nuget.cdn.azure.cn/v3/index.json"
+    dotnet publish "$servicePath/$serviceName.csproj" -c Debug
+    if($copyDll -eq 1)
+    {
+        Copy-Item -recurse -Force $servicePath/bin/Debug/net6.0/publish/$serviceName.dll -Destination $copyDest/Services/$serviceName.dll
+        Copy-Item -recurse -Force $servicePath/bin/Debug/net6.0/publish/*.dll -Destination $copyDest/Dependencies/ -Exclude $serviceName.dll         
+    }
+    if($copyXml -eq 1)
+    {
+        Copy-Item -recurse -Force $servicePath/bin/Debug/net6.0/publish/$serviceName.xml -Destination $copyDest/Services/$serviceName.xml
+        Copy-Item -recurse -Force $servicePath/bin/Debug/net6.0/publish/*.xml -Destination $copyDest/Dependencies/ -Exclude $serviceName.xml         
+    }
+}
+
+### server
+IF (-not(Test-Path ../WingCloudServer/src/bin/Debug/net6.0/Dependencies/)) { New-Item -Path ../WingCloudServer/src/bin/Debug/net6.0/ -Name Dependencies -Type Directory -force }
+IF (-not(Test-Path ../WingCloudServer/src/bin/Debug/net6.0/Services/)) { New-Item -Path ../WingCloudServer/src/bin/Debug/net6.0/ -Name Services -Type Directory -force }
+BuildService "WingServerCommon" 0 0 "../WingServerCommon"
+BuildService "WingInterfaceLibrary" 0 1
+BuildService "WingNotificationModule" 1 0 "../WingNotificationModule"
+BuildService "WingMongoDBModule" 1
+BuildService "WingStorageModule" 1
+
+BuildService "WingCloudServer" 0
+BuildService "WingSMSModule" 1
+
+BuildService "WingSessionModule" 1
+
+BuildService "WingEmailModule" 1
+
+IF (-not(Test-Path ../wing/server/EmailTemplate/)) { New-Item -Path ../WingCloudServer/src/bin/Debug/net6.0/ -Name EmailTemplate -Type Directory -force }
+Copy-Item ../WingEmailModule/src/bin/Debug/net6.0/EmailTemplate/* -Destination ../WingCloudServer/src/bin/Debug/net6.0/EmailTemplate
+
+BuildService "WingUserModule" 1
+
+IF (-not(Test-Path ../wing/server/RegionData/)) { New-Item -Path ../WingCloudServer/src/bin/Debug/net6.0/ -Name RegionData -Type Directory -force }
+Copy-Item ../WingUserModule/src/bin/Debug/net6.0/Region/* -Destination ../WingCloudServer/src/bin/Debug/net6.0/RegionData
+
+BuildService "WingManagementModule" 1
+
+
+BuildService "WingDeviceService" 1 0 "../WingDeviceService"
+
+BuildService "VidProcessService" 1 0 "../WingVidProcessService/VidProcessService"
+
+BuildService "ReportService" 1 0 "../WingReportService/ReportService"
+
+BuildService "WingRemedicalModule" 1
+
+
+
+
+Copy-Item -recurse -Force ../WingServerCommon/bin/Debug/net6.0/publish/WingServerCommon.dll -Destination ../WingCloudServer/src/bin/Debug/net6.0/WingServerCommon.dll
+Copy-Item -recurse -Force ../WingServerCommon/bin/Debug/net6.0/publish/WingServerCommon.dll -Destination ../WingCloudServer/src/bin/Debug/net6.0/Dependencies/WingServerCommon.dll
+
+Write-Host 'Finished!' -NoNewline
+$null = [Console]::ReadKey('?')