From a38a6de6c01186c04a85fcc7278889f20b1104c8 Mon Sep 17 00:00:00 2001 From: SlimeNull Date: Wed, 26 Jun 2024 10:42:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=9E=84=E5=BB=BA=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + Sdcb.FFmpeg/Sdcb.FFmpeg.csproj | 2 +- Sn.ScreenBroadcaster/Views/MainWindow.xaml.cs | 1 - build.ps1 | 59 +++++++++++++++++++ 4 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 build.ps1 diff --git a/.gitignore b/.gitignore index 9491a2f..d553981 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ bld/ [Oo]ut/ [Ll]og/ [Ll]ogs/ +[Bb]uilds/ # Visual Studio 2015/2017 cache/options directory .vs/ diff --git a/Sdcb.FFmpeg/Sdcb.FFmpeg.csproj b/Sdcb.FFmpeg/Sdcb.FFmpeg.csproj index 5f7ab87..652ea84 100644 --- a/Sdcb.FFmpeg/Sdcb.FFmpeg.csproj +++ b/Sdcb.FFmpeg/Sdcb.FFmpeg.csproj @@ -14,7 +14,7 @@ FFmpeg auto generated unsafe bindings for C#/.NET and Mono. enable 11 - true + false true snupkg diff --git a/Sn.ScreenBroadcaster/Views/MainWindow.xaml.cs b/Sn.ScreenBroadcaster/Views/MainWindow.xaml.cs index 3307766..d98e43d 100644 --- a/Sn.ScreenBroadcaster/Views/MainWindow.xaml.cs +++ b/Sn.ScreenBroadcaster/Views/MainWindow.xaml.cs @@ -7,7 +7,6 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using System.Text.Json; using System.Windows; using System.Windows.Documents; using System.Windows.Input; diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000..0a3a80a --- /dev/null +++ b/build.ps1 @@ -0,0 +1,59 @@ +Write-Host "Sn.ScreenBroadcaster Build Script" + +New-Item -ItemType Directory -Force "./Builds" > $null +New-Item -ItemType Directory -Force "./Builds/Temp" > $null + +dotnet build -c Release ./Sn.ScreenBroadcaster/Sn.ScreenBroadcaster.csproj + +# Copy .NET8 Builds +Remove-Item -Force -Recurse "./Builds/Temp/*" +Copy-Item -Force -Recurse "./Sn.ScreenBroadcaster/bin/Release/net8.0-windows/*" "./Builds/Temp" +Remove-Item -Force -Recurse "./Builds/Temp/runtimes/osx" +Remove-Item -Force -Recurse "./Builds/Temp/runtimes/win-arm64" + +# Compress .NET8 Full +Compress-Archive -Force "./Builds/Temp/*" "./Builds/Sn.ScreenBroadcaster-net8-full.zip" + +Remove-Item -Force -Recurse "./Builds/Temp/runtimes/win-x86" + +# Compress .NET8 X64 +Compress-Archive -Force "./Builds/Temp/*" "./Builds/Sn.ScreenBroadcaster-net8-x64.zip" + +# Copy .NET8 Builds +Remove-Item -Force -Recurse "./Builds/Temp/*" +Copy-Item -Force -Recurse "./Sn.ScreenBroadcaster/bin/Release/net8.0-windows/*" "./Builds/Temp" +Remove-Item -Force -Recurse "./Builds/Temp/runtimes/osx" +Remove-Item -Force -Recurse "./Builds/Temp/runtimes/win-arm64" +Remove-Item -Force -Recurse "./Builds/Temp/runtimes/win-x64" + +# Compress .NET8 X64 +Compress-Archive -Force "./Builds/Temp/*" "./Builds/Sn.ScreenBroadcaster-net8-x86.zip" + +# Copy .NET481 Builds +Remove-Item -Force -Recurse "./Builds/Temp/*" +Copy-Item -Force -Recurse "./Sn.ScreenBroadcaster/bin/Release/net481/*" "./Builds/Temp" +Remove-Item -Force -Recurse "./Builds/Temp/arm64" +Remove-Item -Force -Recurse "./Builds/Temp/*.dylib" + +# Compress .NET481 Full +Compress-Archive -Force "./Builds/Temp/*" "./Builds/Sn.ScreenBroadcaster-net481-full.zip" + +Remove-Item -Force -Recurse "./Builds/Temp/x86" +Remove-Item -Force -Recurse "./Builds/Temp/dll/x86" + +# Compress .NET481 x64 +Compress-Archive -Force "./Builds/Temp/*" "./Builds/Sn.ScreenBroadcaster-net481-x64.zip" + +# Copy .NET481 Builds +Remove-Item -Force -Recurse "./Builds/Temp/*" +Copy-Item -Force -Recurse "./Sn.ScreenBroadcaster/bin/Release/net481/*" "./Builds/Temp" +Remove-Item -Force -Recurse "./Builds/Temp/arm64" +Remove-Item -Force -Recurse "./Builds/Temp/x64" +Remove-Item -Force -Recurse "./Builds/Temp/dll/x64" +Remove-Item -Force -Recurse "./Builds/Temp/*.dylib" + +# Compress .NET481 x86 +Compress-Archive -Force "./Builds/Temp/*" "./Builds/Sn.ScreenBroadcaster-net481-x86.zip" + +# Cleaning +Remove-Item -Force -Recurse "./Builds/Temp" \ No newline at end of file