diff --git a/.gitignore b/.gitignore index dfcfd56..c35dc6b 100644 --- a/.gitignore +++ b/.gitignore @@ -348,3 +348,8 @@ MigrationBackup/ # Ionide (cross platform F# VS Code tools) working folder .ionide/ + +#------------------------------------------------------------------------------ +# Repo specific settings: + +/Build/** diff --git a/Doc/DEVELOPER.md b/Doc/DEVELOPER.md index a26e4d1..b492d3a 100644 --- a/Doc/DEVELOPER.md +++ b/Doc/DEVELOPER.md @@ -1,3 +1,20 @@ ### Developer Setup Notes -1. *Optional:* Install the [Extensibility Essentials 2019](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.ExtensibilityEssentials2019) Visual Studio extension. This includes very useful tools for obtaining command IDs and other things. +1. Install **Visual Studio 2019 Community 16.3+** from [here](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=16) + + * Select **all workloads** on the first panel + * Click **Individual components**, type *Git* in the search box and select **Git for Windows** and **GitHub extension for Visual Studio** + * Click **Install** (and take a coffee break) + * Install **.NET Core SDK 3.1.301 (Windows .NET Core Installer x64)** from [here](https://dotnet.microsoft.com/download/visual-studio-sdks) + * Apply any pending **Visual Studio updates** + * **Close** Visual Studio and install any updates + +2. *Optional:* Install the [Extensibility Essentials 2019](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.ExtensibilityEssentials2019) Visual Studio extension. This includes very useful tools for obtaining command IDs and other things. + +3. *Optional:* Configure the build **environment variables** required only for releasing the extension: + + * Open **File Explorer** + * Navigate to the directory holding the cloned repository + * **Right-click** on **buildenv.cmd** and then **Run as adminstrator** + * Press ENTER to close the CMD window when the script is finished + * Restart any Visual Studio instances or command windows to pick up the changes. diff --git a/Doc/RELEASE-TEMPLATE.md b/Doc/RELEASE-TEMPLATE.md new file mode 100644 index 0000000..fe417fc --- /dev/null +++ b/Doc/RELEASE-TEMPLATE.md @@ -0,0 +1,12 @@ +Raspberry Debugger is a Visual Studio extension intended for debugging .NET Core applications remotely on a Raspberry Pi. + +## Changes: + +**TODO:** Write something here! + +### Build Artifacts and SHA512 signatures: + +This is is the Raspberry Debugger VSIX package: + +> **RaspberryDebugger.vsix:** +> `FILL THIS IN` diff --git a/Doc/RELEASE.md b/Doc/RELEASE.md index b18083d..122b969 100644 --- a/Doc/RELEASE.md +++ b/Doc/RELEASE.md @@ -7,8 +7,31 @@ 2. Update the release notes in: `ReleaseNotes.rtf` and `source.extension.vsixmanifest` -3. Build and sign the extension?? +3. Open the solution, set the build configuration to **RELEASE** and then manually clean and build the solution. -4. Release to GitHub?? +4. Run this command to complete the release process, copying the build artifcats to the [$/Build] folder: -5. Release to Visual Studio Marketplace?? + `%RDBG_TOOLBIN%\builder.cmd` + +5. Create a release branch from **main** named for the release like **release-v1.0** and push it to GitHub. + +6. Create a new GitHub release named the same as the new version and set the releast branch to the newly created branch. + +7. Copy `RELEASE-TEMPLATE.md` into the release notes and describe the update including any related issues. + +8. Attach `$/Build/RaspberryDebugger.vsix** to the the release. + +9. Copy/paste the SHA512 from `$/Build/RaspberryDebugger.vsix.sha512.txt** into the release notes. + +10. Publish the GitHub release. + +11. Commit any changes and push them to GitHub. + +12. Switch back to the **main** branch, merge the changes from the release branch and push **main** to GitHub. + +------------------------------------------------ +$todo(jefflill): Flesh these out: + +13. Build and sign the extension?? + +14. Release to Visual Studio Marketplace?? diff --git a/RaspberryDebugger.sln b/RaspberryDebugger.sln index be6cef2..378d1b2 100644 --- a/RaspberryDebugger.sln +++ b/RaspberryDebugger.sln @@ -6,6 +6,7 @@ MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub", "GitHub", "{177F60A0-B1B9-45D1-9CB1-8F06A6ED2AB5}" ProjectSection(SolutionItems) = preProject .gitignore = .gitignore + buildenv.cmd = buildenv.cmd LICENSE = LICENSE README.md = README.md EndProjectSection @@ -17,6 +18,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Doc", "Doc", "{5A14B2C0-0606-433A-AE9C-9E33C7B2BA27}" ProjectSection(SolutionItems) = preProject Doc\DEVELOPER.md = Doc\DEVELOPER.md + Doc\RELEASE-TEMPLATE.md = Doc\RELEASE-TEMPLATE.md Doc\RELEASE.md = Doc\RELEASE.md EndProjectSection EndProject @@ -25,6 +27,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Images", "Images", "{642CFD Doc\Images\RaspberryDebugSettings.png = Doc\Images\RaspberryDebugSettings.png EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ToolBin", "ToolBin", "{15A5F928-90D4-421A-850D-8A09842DA012}" + ProjectSection(SolutionItems) = preProject + ToolBin\builder.cmd = ToolBin\builder.cmd + ToolBin\builder.ps1 = ToolBin\builder.ps1 + ToolBin\openssl.exe = ToolBin\openssl.exe + ToolBin\PathTool.exe = ToolBin\PathTool.exe + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/ToolBin/PathTool.exe b/ToolBin/PathTool.exe new file mode 100644 index 0000000..660bc64 Binary files /dev/null and b/ToolBin/PathTool.exe differ diff --git a/ToolBin/builder.cmd b/ToolBin/builder.cmd new file mode 100644 index 0000000..71fe2d1 --- /dev/null +++ b/ToolBin/builder.cmd @@ -0,0 +1,2 @@ +@echo off +powershell -file "%RDBG_TOOLBIN%\builder.ps1" %* diff --git a/ToolBin/builder.ps1 b/ToolBin/builder.ps1 new file mode 100644 index 0000000..697b73c --- /dev/null +++ b/ToolBin/builder.ps1 @@ -0,0 +1,58 @@ +#------------------------------------------------------------------------------ +# FILE: builder.ps1 +# CONTRIBUTOR: Jeff Lill +# COPYRIGHT: Copyright (c) 2005-2020 by neonFORGE, LLC. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Performs a clean build of the RaspberryDebugger and publishes the binary +# to the [$/build] folder. +# +# USAGE: powershell -file ./builder.ps1 + +$rdbgRoot = "$env:RDBG_ROOT" +$rdbgBuild = "$env:RDBG_BUILD" +$rdbgTools = "$rdbgRoot\Tools" + +# NOTE: +# +# MSBUILD.EXE and DEVENV.EXE don't appear to be capable of actually building thr VSIX. +# MSBUILD fails because an EXE appears to be referenced by the project and DEVENV +# builds the [SdkCatalogChecker] but not the VSIX. +# +# So the VSIX will need to be built manually first. + +$originalDir = $pwd +cd $rdbgRoot + +# Copy the VSIX package to the build folder. + +copy $rdbgRoot\RaspberryDebugger\bin\Release\RaspberryDebugger.vsix $rdbgBuild + +# Generate the SHA512 hash. + +"" +"SHA512: RaspberryDebugger.vsix..." +"" + +& cat "$rdbgBuild\RaspberryDebugger.vsix" | openssl dgst -sha512 -hex > "$rdbgBuild\RaspberryDebugger.vsix.sha512.txt" + +if (-not $?) +{ + "" + "*** SHA512 generation failed ***" + "" + exit 1 +} + +cd $originalDir diff --git a/ToolBin/openssl.exe b/ToolBin/openssl.exe new file mode 100644 index 0000000..d39afc0 Binary files /dev/null and b/ToolBin/openssl.exe differ diff --git a/buildenv.cmd b/buildenv.cmd new file mode 100644 index 0000000..48d33e5 --- /dev/null +++ b/buildenv.cmd @@ -0,0 +1,47 @@ +@echo on +REM Configures the environment variables required to build RaspberryDebugger projects. +REM +REM buildenv [ ] +REM +REM Note that defaults to the folder holding this +REM batch file. +REM +REM This must be [RUN AS ADMINISTRATOR]. + +REM Default RDBG_ROOT to the folder holding this batch file after stripping +REM off the trailing backslash. + +set RDBG_ROOT=%~dp0 +set RDBG_ROOT=%RDBG_ROOT:~0,-2% + +if not [%1]==[] set RDBG_ROOT=%1 + +if exist %RDBG_ROOT%\RaspberryDebugger.sln goto goodPath +echo The [%RDBG_ROOT%\RaspberryDebugger.sln] file does not exist. Please pass the path +echo to the RaspberryDebugger solution folder. +goto done + +:goodPath + +REM Configure the environment variables. + +set RDBG_TOOLBIN=%RDBG_ROOT%\ToolBin +set RDBG_BUILD=%RDBG_ROOT%\Build +set RDBG_TEMP=C:\Temp + +REM Persist the environment variables. + +setx RDBG_ROOT "%RDBG_ROOT%" /M +setx RDBG_TOOLBIN "%RDBG_TOOLBIN%" /M +setx RDBG_BUILD "%RDBG_BUILD%" /M +setx RDBG_TEMP "%RDBG_TEMP%" /M +setx DOTNET_CLI_TELEMETRY_OPTOUT 1 /M + +REM Make sure required folders exist. + +if not exist "%RDBG_TEMP%" mkdir "%RDBG_TEMP%" +if not exist "%RDBG_TOOLBIN%" mkdir "%RDBG_TOOLBIN%" +if not exist "%RDBG_BUILD%" mkdir "%RDBG_BUILD%" + +:done +pause