From 1870abdd55a31b5a35cc5b1deb105ada97cffe6d Mon Sep 17 00:00:00 2001 From: Peter Gill Date: Sat, 28 Dec 2024 18:28:37 -0330 Subject: [PATCH] Update build scripts and projects to target .NET 8.0 Updated dotnet.yml to use latest GitHub Actions for .NET setup and removed MSBuild.exe setup. Updated build and test steps accordingly. Updated multiple .csproj files to target .NET 8.0 frameworks. Modified Directory.Build.props to remove net48 target framework and target only net8.0-windows. Updated build-release.ps1 script to: - Set configuration to "Release" and target framework to "net8.0-windows". - Use dotnet build instead of MSBuild paths. - Update output paths for new target framework. - Use 7za.exe with -tzip option for compression. - Remove net48 references in build and copy steps. - Ensure correct paths and configurations for copying and compressing build outputs for different platforms (PHP, Python, Ruby). GetVersions function in build-release.ps1 now reads version from Directory.Build.props instead of RdlEngine.csproj. --- .github/workflows/dotnet.yml | 2 - DataProviders/DataProviders.csproj | 1 + Directory.Build.props | 2 +- EncryptionProvider/EncryptionProvider.csproj | 1 + LibRdlWpfViewer/LibRdlWpfViewer.csproj | 1 + .../Majorsilence.Drawing.Common.csproj | 2 +- RdlAsp.Mvc/RdlAsp.Mvc.csproj | 2 +- RdlCmd/RdlCmd.csproj | 1 + RdlCreator.Tests/RdlCreator.Tests.csproj | 1 + RdlCreator/RdlCreator.csproj | 1 + RdlCri/RdlCri.csproj | 1 + RdlDesign/ReportDesigner.csproj | 1 + RdlDesktop/RdlDesktop.csproj | 1 + RdlEngine/RdlEngine.csproj | 1 + RdlGtk3/RdlGtk3.csproj | 1 + RdlGtk3Viewer/RdlGtk3Viewer.csproj | 1 + RdlMapFile/RdlMapFile.csproj | 1 + RdlReader/RdlReader.csproj | 1 + RdlViewer.Tests/RdlViewer.Tests.csproj | 1 + RdlViewer/RdlViewer.csproj | 3 +- ReportTests/ReportTests.csproj | 1 + build-release.ps1 | 88 +++++++------------ 22 files changed, 52 insertions(+), 63 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 00702df4..3f0a6ead 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -15,8 +15,6 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: 8.0.x - - name: Setup MSBuild.exe - uses: microsoft/setup-msbuild@v1.1 - name: Build Release run: ./build-release.ps1 - name: Test diff --git a/DataProviders/DataProviders.csproj b/DataProviders/DataProviders.csproj index ab451ea8..e212e7bf 100644 --- a/DataProviders/DataProviders.csproj +++ b/DataProviders/DataProviders.csproj @@ -11,6 +11,7 @@ false Majorsilence.Reporting.DataProviders Debug;Release;Debug-DrawingCompat;Release-DrawingCompat + net8.0 diff --git a/Directory.Build.props b/Directory.Build.props index 8813765e..2ace407c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -5,7 +5,7 @@ - net48;net8.0-windows + net8.0-windows diff --git a/EncryptionProvider/EncryptionProvider.csproj b/EncryptionProvider/EncryptionProvider.csproj index f574a47d..4eb78206 100644 --- a/EncryptionProvider/EncryptionProvider.csproj +++ b/EncryptionProvider/EncryptionProvider.csproj @@ -8,6 +8,7 @@ Majorsilence.Reporting.EncryptionProvider Debug;Release;Debug-DrawingCompat + net8.0-windows diff --git a/LibRdlWpfViewer/LibRdlWpfViewer.csproj b/LibRdlWpfViewer/LibRdlWpfViewer.csproj index ab01cd88..cefee54c 100644 --- a/LibRdlWpfViewer/LibRdlWpfViewer.csproj +++ b/LibRdlWpfViewer/LibRdlWpfViewer.csproj @@ -10,6 +10,7 @@ false Majorsilence.Reporting.LibRdlWpfViewer Debug;Release;Debug-DrawingCompat;Release-DrawingCompat + net8.0-windows diff --git a/Majorsilence.Drawing.Common/Majorsilence.Drawing.Common.csproj b/Majorsilence.Drawing.Common/Majorsilence.Drawing.Common.csproj index a5466060..a227e193 100644 --- a/Majorsilence.Drawing.Common/Majorsilence.Drawing.Common.csproj +++ b/Majorsilence.Drawing.Common/Majorsilence.Drawing.Common.csproj @@ -1,7 +1,7 @@  - net8.0;net48 + net8.0 enable enable Debug;Release;Debug-DrawingCompat diff --git a/RdlAsp.Mvc/RdlAsp.Mvc.csproj b/RdlAsp.Mvc/RdlAsp.Mvc.csproj index eaf46c8f..43a0ee69 100644 --- a/RdlAsp.Mvc/RdlAsp.Mvc.csproj +++ b/RdlAsp.Mvc/RdlAsp.Mvc.csproj @@ -13,8 +13,8 @@ false Majorsilence.Reporting.RdlAsp.Mvc - net8.0 Debug;Release;Debug-DrawingCompat + net8.0 diff --git a/RdlCmd/RdlCmd.csproj b/RdlCmd/RdlCmd.csproj index e3c0b443..579bd530 100644 --- a/RdlCmd/RdlCmd.csproj +++ b/RdlCmd/RdlCmd.csproj @@ -8,6 +8,7 @@ OnBuildSuccess true Debug;Release;Debug-DrawingCompat;Release-DrawingCompat + net8.0 diff --git a/RdlCreator.Tests/RdlCreator.Tests.csproj b/RdlCreator.Tests/RdlCreator.Tests.csproj index 38045132..6e157eca 100644 --- a/RdlCreator.Tests/RdlCreator.Tests.csproj +++ b/RdlCreator.Tests/RdlCreator.Tests.csproj @@ -4,6 +4,7 @@ fyiReporting.RdlCreator.Tests RdlCreator.Tests Debug;Release;Debug-DrawingCompat + net8.0 diff --git a/RdlCreator/RdlCreator.csproj b/RdlCreator/RdlCreator.csproj index 68f94e67..f9ed71a2 100644 --- a/RdlCreator/RdlCreator.csproj +++ b/RdlCreator/RdlCreator.csproj @@ -6,6 +6,7 @@ True Majorsilence.Reporting.RdlCreator Debug;Release;Debug-DrawingCompat + net8.0 diff --git a/RdlCri/RdlCri.csproj b/RdlCri/RdlCri.csproj index 153c33d2..2bdedb02 100644 --- a/RdlCri/RdlCri.csproj +++ b/RdlCri/RdlCri.csproj @@ -8,6 +8,7 @@ false Majorsilence.Reporting.RdlCri Debug;Release;Debug-DrawingCompat;Release-DrawingCompat + net8.0 diff --git a/RdlDesign/ReportDesigner.csproj b/RdlDesign/ReportDesigner.csproj index 2995f2d8..dc1306ff 100644 --- a/RdlDesign/ReportDesigner.csproj +++ b/RdlDesign/ReportDesigner.csproj @@ -16,6 +16,7 @@ false Majorsilence.Reporting.ReportDesigner Debug;Release;Debug-DrawingCompat;Release-DrawingCompat + net8.0-windows diff --git a/RdlDesktop/RdlDesktop.csproj b/RdlDesktop/RdlDesktop.csproj index 7ef06fd8..03662061 100644 --- a/RdlDesktop/RdlDesktop.csproj +++ b/RdlDesktop/RdlDesktop.csproj @@ -9,6 +9,7 @@ OnBuildSuccess fyiReporting.RdlDesktop.RdlDesktop Debug;Release;Debug-DrawingCompat;Release-DrawingCompat + net8.0 diff --git a/RdlEngine/RdlEngine.csproj b/RdlEngine/RdlEngine.csproj index 18d6b69c..4585183f 100644 --- a/RdlEngine/RdlEngine.csproj +++ b/RdlEngine/RdlEngine.csproj @@ -11,6 +11,7 @@ false Majorsilence.Reporting.RdlEngine Debug;Release;Debug-DrawingCompat + net8.0 diff --git a/RdlGtk3/RdlGtk3.csproj b/RdlGtk3/RdlGtk3.csproj index 391b2e31..e6af36e8 100644 --- a/RdlGtk3/RdlGtk3.csproj +++ b/RdlGtk3/RdlGtk3.csproj @@ -6,6 +6,7 @@ True Majorsilence.Reporting.RdlGtk3 Debug;Release;Debug-DrawingCompat + net8.0 diff --git a/RdlGtk3Viewer/RdlGtk3Viewer.csproj b/RdlGtk3Viewer/RdlGtk3Viewer.csproj index 0509470e..8e399090 100644 --- a/RdlGtk3Viewer/RdlGtk3Viewer.csproj +++ b/RdlGtk3Viewer/RdlGtk3Viewer.csproj @@ -4,6 +4,7 @@ fyiReporting.RdlGtk3Viewer RdlGtk3Viewer Debug;Release;Debug-DrawingCompat + net8.0 diff --git a/RdlMapFile/RdlMapFile.csproj b/RdlMapFile/RdlMapFile.csproj index 950a2620..36872614 100644 --- a/RdlMapFile/RdlMapFile.csproj +++ b/RdlMapFile/RdlMapFile.csproj @@ -6,6 +6,7 @@ true false Debug;Release;Debug-DrawingCompat + net8.0-windows diff --git a/RdlReader/RdlReader.csproj b/RdlReader/RdlReader.csproj index 2be0bf8b..16e16f60 100644 --- a/RdlReader/RdlReader.csproj +++ b/RdlReader/RdlReader.csproj @@ -10,6 +10,7 @@ true false Debug;Release;Debug-DrawingCompat + net8.0-windows diff --git a/RdlViewer.Tests/RdlViewer.Tests.csproj b/RdlViewer.Tests/RdlViewer.Tests.csproj index 950be511..96be0db6 100644 --- a/RdlViewer.Tests/RdlViewer.Tests.csproj +++ b/RdlViewer.Tests/RdlViewer.Tests.csproj @@ -4,6 +4,7 @@ true true Debug;Release;Debug-DrawingCompat + net8.0-windows diff --git a/RdlViewer/RdlViewer.csproj b/RdlViewer/RdlViewer.csproj index 85fce0a4..8ded8a47 100644 --- a/RdlViewer/RdlViewer.csproj +++ b/RdlViewer/RdlViewer.csproj @@ -1,4 +1,4 @@ - + Local @@ -15,6 +15,7 @@ false Majorsilence.Reporting.RdlViewer Debug;Release;Debug-DrawingCompat + net8.0-windows diff --git a/ReportTests/ReportTests.csproj b/ReportTests/ReportTests.csproj index b35ca014..8ebbd3d1 100644 --- a/ReportTests/ReportTests.csproj +++ b/ReportTests/ReportTests.csproj @@ -4,6 +4,7 @@ true true Debug;Release;Debug-DrawingCompat + net8.0-windows diff --git a/build-release.ps1 b/build-release.ps1 index fb921a54..b0af2f9e 100644 --- a/build-release.ps1 +++ b/build-release.ps1 @@ -2,23 +2,10 @@ $ErrorActionPreference = "Stop" $CURRENTPATH=$pwd.Path -# Platform options: "x86", "x64", "x64" -# /p:Configuration="Debug" or "Release" +# /p:Configuration="Debug", "Debug-DrawingCompat", "Release", "Release-DrawingCompat" +$pConfiguration="Release" +$pTargetFramework="net8.0-windows" -# set msbuildpath="%ProgramFiles(x86)%\MSBuild\14.0\bin\MSBuild.exe" -$msbuildpath="C:\BuildTools\MSBuild\Current\Bin\MSBuild.exe" -If (Test-Path "C:\BuildTools\MSBuild\Current\Bin\MSBuild.exe"){ - $msbuildpath="C:\BuildTools\MSBuild\Current\Bin\MSBuild.exe" -} -ElseIf (Test-Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Current\Bin\MSBuild.exe"){ - $msbuildpath="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Current\Bin\MSBuild.exe" -} -ElseIf (Test-Path "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe"){ - $msbuildpath="C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe" -} -Else { - $msbuildpath="msbuild" -} function delete_files([string]$path) { @@ -30,7 +17,7 @@ function delete_files([string]$path) function GetVersions([ref]$theVersion) { - $csprojPath = Join-Path $CURRENTPATH ".\RdlEngine\RdlEngine.csproj" + $csprojPath = Join-Path $CURRENTPATH ".\Directory.Build.props" $xml = [xml](Get-Content $csprojPath) $theVersion.Value = $xml.Project.PropertyGroup.Version } @@ -41,18 +28,16 @@ $Version="" GetVersions([ref]$Version) Write-Host $Version dotnet restore "./MajorsilenceReporting.sln" -dotnet restore "./MajorsilenceReporting-ReportServer.sln" -# ************* Begin net48 anycpu ********************************************* +# ************* Begin anycpu ********************************************* -& "$msbuildpath" "$CURRENTPATH\MajorsilenceReporting.sln" /verbosity:minimal /p:Configuration="Release" /property:Platform="Any CPU" /target:clean /target:rebuild +dotnet build "$CURRENTPATH\MajorsilenceReporting.sln" --configuration $pConfiguration --verbosity minimal -$buildoutputpath_designer="$CURRENTPATH\Release-Builds\build-output\majorsilence-reporting-designer-net48-anycpu" -$buildoutputpath_desktop="$CURRENTPATH\Release-Builds\build-output\majorsilence-reporting-desktop-net48-anycpu" -$buildoutputpath_rdlcmd="$CURRENTPATH\Release-Builds\build-output\majorsilence-reporting-rdlcmd-net48-anycpu" -$buildoutputpath_viewer="$CURRENTPATH\Release-Builds\build-output\majorsilence-reporting-viewer-net48-anycpu" -$buildoutputpath_mapfile="$CURRENTPATH\Release-Builds\build-output\majorsilence-reporting-mapfile-net48-anycpu" -$buildoutputpath_reportserver="$CURRENTPATH\Release-Builds\build-output\majorsilence-reporting-reportserver-net48-anycpu" +$buildoutputpath_designer="$CURRENTPATH\Release-Builds\build-output\majorsilence-reporting-designer-$pTargetFramework-anycpu" +$buildoutputpath_desktop="$CURRENTPATH\Release-Builds\build-output\majorsilence-reporting-desktop-$pTargetFramework-anycpu" +$buildoutputpath_rdlcmd="$CURRENTPATH\Release-Builds\build-output\majorsilence-reporting-rdlcmd-$pTargetFramework-anycpu" +$buildoutputpath_viewer="$CURRENTPATH\Release-Builds\build-output\majorsilence-reporting-viewer-$pTargetFramework-anycpu" +$buildoutputpath_mapfile="$CURRENTPATH\Release-Builds\build-output\majorsilence-reporting-mapfile-$pTargetFramework-anycpu" Remove-Item "$buildoutputpath_designer" -Recurse -ErrorAction Ignore mkdir "$buildoutputpath_designer" @@ -64,35 +49,24 @@ Remove-Item "$buildoutputpath_viewer" -Recurse -ErrorAction Ignore mkdir "$buildoutputpath_viewer" Remove-Item "$buildoutputpath_mapfile" -Recurse -ErrorAction Ignore mkdir "$buildoutputpath_mapfile" -Remove-Item "$buildoutputpath_reportserver" -Recurse -ErrorAction Ignore -mkdir "$buildoutputpath_reportserver" -Copy-Item .\RdlDesign\bin\Release\net48\ -Destination "$buildoutputpath_designer\" -Recurse -Copy-Item .\RdlDesktop\bin\Release\net48\ -Destination "$buildoutputpath_desktop\" -Recurse -Copy-Item .\RdlCmd\bin\Release\net48\ -Destination "$buildoutputpath_rdlcmd\" -Recurse -Copy-Item .\RdlViewer\bin\Release\net48\ -Destination "$buildoutputpath_viewer\" -Recurse -Copy-Item .\RdlMapFile\bin\Release\net48\ -Destination "$buildoutputpath_mapfile\" -Recurse +Copy-Item .\RdlDesign\bin\$pConfiguration\$pTargetFramework\ -Destination "$buildoutputpath_designer\" -Recurse +Copy-Item .\RdlDesktop\bin\$pConfiguration\$pTargetFramework\ -Destination "$buildoutputpath_desktop\" -Recurse +Copy-Item .\RdlCmd\bin\$pConfiguration\$pTargetFramework\ -Destination "$buildoutputpath_rdlcmd\" -Recurse +Copy-Item .\RdlViewer\bin\$pConfiguration\$pTargetFramework\ -Destination "$buildoutputpath_viewer\" -Recurse +Copy-Item .\RdlMapFile\bin\$pConfiguration\$pTargetFramework\ -Destination "$buildoutputpath_mapfile\" -Recurse cd Release-Builds cd build-output -..\7za.exe a $Version-majorsilence-reporting-designer-net48-anycpu.zip majorsilence-reporting-designer-net48-anycpu\ -..\7za.exe a $Version-majorsilence-reporting-desktop-net48-anycpu.zip majorsilence-reporting-desktop-net48-anycpu\ -..\7za.exe a $Version-majorsilence-reporting-rdlcmd-net48-anycpu.zip majorsilence-reporting-rdlcmd-net48-anycpu\ -..\7za.exe a $Version-majorsilence-reporting-viewer-net48-anycpu.zip majorsilence-reporting-viewer-net48-anycpu\ -..\7za.exe a $Version-majorsilence-reporting-mapfile-net48-anycpu.zip majorsilence-reporting-mapfile-net48-anycpu\ +..\7za.exe a -tzip $Version-majorsilence-reporting-designer-$pTargetFramework-anycpu.zip majorsilence-reporting-designer-$pTargetFramework-anycpu\ +..\7za.exe a -tzip $Version-majorsilence-reporting-desktop-$pTargetFramework-anycpu.zip majorsilence-reporting-desktop-$pTargetFramework-anycpu\ +..\7za.exe a -tzip $Version-majorsilence-reporting-rdlcmd-$pTargetFramework-anycpu.zip majorsilence-reporting-rdlcmd-$pTargetFramework-anycpu\ +..\7za.exe a -tzip $Version-majorsilence-reporting-viewer-$pTargetFramework-anycpu.zip majorsilence-reporting-viewer-$pTargetFramework-anycpu\ +..\7za.exe a -tzip $Version-majorsilence-reporting-mapfile-$pTargetFramework-anycpu.zip majorsilence-reporting-mapfile-$pTargetFramework-anycpu\ cd "$CURRENTPATH" -& "$msbuildpath" "$CURRENTPATH\MajorsilenceReporting-ReportServer.sln" /verbosity:minimal /p:Configuration="Release" /property:Platform="Any CPU" -& "$msbuildpath" "$CURRENTPATH\MajorsilenceReporting-ReportServer.sln" /verbosity:minimal /p:Configuration="Release" /property:Platform="Any CPU" /property:DeployOnBuild=true /property:PublishProfile='FolderProfile' - -Copy-Item .\ReportServer\bin\app.publish\ -Destination "$buildoutputpath_reportserver\" -Recurse -cd Release-Builds -cd build-output -..\7za.exe a $Version-majorsilence-reporting-reportserver-net48-anycpu.zip majorsilence-reporting-reportserver-net48-anycpu\ -cd "$CURRENTPATH" - -# ************* End net48 ********************************************* +# ************* End anycpu ********************************************* # ************* Begin PHP ********************************************* @@ -100,15 +74,15 @@ $buildoutputpath_php="$CURRENTPATH\Release-Builds\build-output\majorsilence-repo delete_files "$buildoutputpath_php" mkdir "$buildoutputpath_php" -Copy-Item .\RdlDesktop\bin\Release\net48\config.xml "$buildoutputpath_php\config.xml" -Copy-Item .\RdlCmd\bin\Release\net48\ -Destination "$buildoutputpath_php\" -Recurse +Copy-Item .\RdlDesktop\bin\$pConfiguration\$pTargetFramework\config.xml "$buildoutputpath_php\config.xml" +Copy-Item .\RdlCmd\bin\$pConfiguration\$pTargetFramework\ -Destination "$buildoutputpath_php\" -Recurse Copy-Item ".\LanguageWrappers\php\config.php" "$buildoutputpath_php\config.php" Copy-Item ".\LanguageWrappers\php\report.php" "$buildoutputpath_php\report.php" cd Release-Builds cd build-output -..\7za.exe a $Version-majorsilence-reporting-build-php.zip majorsilence-reporting-php\ +..\7za.exe a -tzip $Version-majorsilence-reporting-build-php.zip majorsilence-reporting-php\ cd "$CURRENTPATH" # ************* End PHP ********************************************* @@ -120,14 +94,14 @@ $buildoutputpath_python="$CURRENTPATH\Release-Builds\build-output\majorsilence-r delete_files "$buildoutputpath_python" mkdir "$buildoutputpath_python" -Copy-Item .\RdlDesktop\bin\Release\net48\config.xml "$buildoutputpath_python\config.xml" -Copy-Item .\RdlCmd\bin\Release\net48\ -Destination "$buildoutputpath_python\" -Recurse +Copy-Item .\RdlDesktop\bin\$pConfiguration\$pTargetFramework\config.xml "$buildoutputpath_python\config.xml" +Copy-Item .\RdlCmd\bin\$pConfiguration\$pTargetFramework\ -Destination "$buildoutputpath_python\" -Recurse Copy-Item ".\LanguageWrappers\python\config.py" "$buildoutputpath_python\config.py" Copy-Item ".\LanguageWrappers\python\report.py" "$buildoutputpath_python\report.py" cd Release-Builds cd build-output -..\7za.exe a $Version-majorsilence-reporting-python.zip majorsilence-reporting-python\ +..\7za.exe a -tzip $Version-majorsilence-reporting-python.zip majorsilence-reporting-python\ cd "$CURRENTPATH" # ************* End Python ********************************************* @@ -137,15 +111,15 @@ $buildoutputpath_ruby="$CURRENTPATH\Release-Builds\build-output\majorsilence-rep delete_files "$buildoutputpath_ruby" mkdir "$buildoutputpath_ruby" -Copy-Item .\RdlDesktop\bin\Release\net48\config.xml "$buildoutputpath_ruby\config.xml" -Copy-Item .\RdlCmd\bin\Release\net48\ -Destination "$buildoutputpath_ruby\" -Recurse +Copy-Item .\RdlDesktop\bin\$pConfiguration\$pTargetFramework\config.xml "$buildoutputpath_ruby\config.xml" +Copy-Item .\RdlCmd\bin\$pConfiguration\$pTargetFramework\ -Destination "$buildoutputpath_ruby\" -Recurse Copy-Item ".\LanguageWrappers\ruby\config.rb" "$buildoutputpath_ruby\config.rb" Copy-Item ".\LanguageWrappers\ruby\report.rb" "$buildoutputpath_ruby\report.rb" cd Release-Builds cd build-output -..\7za.exe a $Version-majorsilence-reporting-ruby.zip majorsilence-reporting-ruby\ +..\7za.exe a -tzip $Version-majorsilence-reporting-ruby.zip majorsilence-reporting-ruby\ cd "$CURRENTPATH" # ************* End Ruby *********************************************