From bb03c1f45417ecf28eff2a2301b89ca81892040a Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Thu, 6 Jul 2023 14:04:14 -0400 Subject: [PATCH 1/2] Build the project from PowerShell --- build.ps1 | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 build.ps1 diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000..d2ea1ad --- /dev/null +++ b/build.ps1 @@ -0,0 +1,29 @@ +# Build script for generating release package + +if (Test-Path -Path "bin") +{ + Remove-Item bin\* -Recurse -Force +} + +# Clean both debug and release +##dotnet clean src/LinuxDebugger.sln +##dotnet clean src/LinuxDebugger.sln --configuration Release +dotnet msbuild src/LinuxDebugger.sln -t:Clean +dotnet msbuild src/LinuxDebugger.sln -t:Clean -p:Configuration=Release;TargetFrameworkVersion=v472 + +# build package for release +dotnet msbuild src/LinuxDebugger.sln -t:Rebuild -p:Configuration=Release +## dotnet build src/LinuxDebugger.sln --configuration release + +# TODO: +### https://github.com/madskristensen/VsctIntellisense/blob/master/appveyor.yml +# (new-object Net.WebClient).DownloadString("https://raw.github.com/madskristensen/ExtensionScripts/master/AppVeyor/vsix.ps1") | iex +# Vsix-IncrementVsixVersion .\src\VsctCompletion2019\source.extension.vsixmanifest | Vsix-UpdateBuildVersion +# Vsix-IncrementVsixVersion .\src\VsctCompletion2022\source.extension.vsixmanifest +# Vsix-TokenReplacement src\VsctCompletion2019\source.extension.cs 'Version = "([0-9\\.]+)"' 'Version = "{version}"' +# Vsix-TokenReplacement src\VsctCompletion2022\source.extension.cs 'Version = "([0-9\\.]+)"' 'Version = "{version}"' +# nuget restore -Verbosity quiet +# msbuild /p:configuration=Release /p:DeployExtension=false /p:ZipPackageCompressionLevel=normal /v:m + +## TODO: Build project and set version to 1.2.3.4 +# dotnet build -p:Version=1.2.3.4 From 0ddcabcbc777f4ff785a02f9cf04df4c05b6f0ab Mon Sep 17 00:00:00 2001 From: Damian Suess Date: Fri, 7 Jul 2023 17:18:53 -0400 Subject: [PATCH 2/2] Fixed release build script --- build.ps1 | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/build.ps1 b/build.ps1 index d2ea1ad..db6d311 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,3 +1,4 @@ +# Linux Debugger # Build script for generating release package if (Test-Path -Path "bin") @@ -5,15 +6,19 @@ if (Test-Path -Path "bin") Remove-Item bin\* -Recurse -Force } -# Clean both debug and release -##dotnet clean src/LinuxDebugger.sln -##dotnet clean src/LinuxDebugger.sln --configuration Release -dotnet msbuild src/LinuxDebugger.sln -t:Clean -dotnet msbuild src/LinuxDebugger.sln -t:Clean -p:Configuration=Release;TargetFrameworkVersion=v472 +$VCToolsInstallDir = . "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -Latest -requires Microsoft.Component.MSBuild -property InstallationPath +Write-Host "VCToolsInstallDir: $VCToolsInstallDir" -# build package for release -dotnet msbuild src/LinuxDebugger.sln -t:Rebuild -p:Configuration=Release -## dotnet build src/LinuxDebugger.sln --configuration release +$msBuildPath = "$VCToolsInstallDir\MSBuild\Current\Bin\msbuild.exe" +Write-Host "msBuildPath: $msBuildPath" + +Write-Host "Cleaning..." +& $msBuildPath -t:Clean src/LinuxDebugger.sln + +Write-Host "Building..." +& $msBuildPath /restore ` + src/LinuxDebugger.sln ` + /p:Configuration=Release # TODO: ### https://github.com/madskristensen/VsctIntellisense/blob/master/appveyor.yml