Using Source Control
Copy the page below into Confluence. Selecting the rendered text keeps the headings and lists.
Use source control with Custom Code
HL7Spy stores each Custom Code plugin as a folder of files. Point the Custom Code source folder at a working copy from Git, Azure DevOps, Subversion, or another source-control system. HL7Spy reads and writes those files. Commit, update, and share them with that system. HL7Spy does not commit, push, or pull.
Put the plugins in the repository
Each plugin is one folder directly inside the source folder. The folder name is the plugin id.
HL7SpyPlugins
.git
Generate.Messages
Generate.Messages.nuspec
Dependencies.json
changelog.json
code
DynamicClass.cs
resources
Viewer.Samples
Viewer.Samples.nuspec
code
DynamicClass.csHL7Spy loads every folder at that root that contains a Custom Code .nuspec file. Folders whose names start with a period are left alone, including .git and .svn. A README or other files in the root stay in the repository and are not loaded as plugins.
Plugins already in use on this PC are stored here:
C:\\Users\\<your name>\\AppData\\Roaming\\HL7Spy\\Settings\\SourceCode
AppData is hidden. Copy those plugin folders into the repository. HL7Spy does not move them. The older package files in Settings\\Packages are not copied into a folder you choose.
You can also turn that default folder into the repository. Initialize Git there and commit the plugin folders. HL7Spy keeps using that folder, and the .git directory is not treated as a plugin.
Point HL7Spy at the folder
Open Custom Code.
On the Custom Code toolbar, open Options and choose Source Code Folder...
Select the repository folder. Select the folder that contains
.git, not a plugin folder inside it.Confirm the message. HL7Spy uses the folder the next time it starts.
Close HL7Spy and start it again.
Custom Code then lists the plugins it finds in that folder.
To use the default folder again, choose Source Code Folder... and select C:\\Users\\<your name>\\AppData\\Roaming\\HL7Spy\\Settings\\SourceCode. Restart HL7Spy. The repository stays where it is.
Save, then commit
Edit the plugin in Custom Code.
Save the plugin. Save writes the plugin files into its folder. Unsaved edits stay in HL7Spy until you save.
Commit and push with Git, or with the source-control tool for that folder.
Renaming a plugin in HL7Spy renames its folder. Commit that rename with the other changes.
Take changes from someone else
Save the plugin, or revert it. Revert discards changes since the last save and reloads the plugin from its folder.
Update the working copy, for example with
git pull.Click the Refresh button in the Options menu.
If a plugin still shows the old text, it still has unsaved edits. Revert that plugin to load the files that are now in the source folder.
Share one repository
Each person points their own HL7Spy at a working copy of the same repository: Options → Source Code Folder..., then restart HL7Spy. Save in HL7Spy before you commit. Update the working copy before you edit a plugin someone else has changed.
Backup
An HL7Spy backup that includes Custom Code also includes the source folder you configured. Restore writes those plugin files into the source folder HL7Spy is using now, and leaves your folder setting as it is. Use the repository when you want history and when you want to share plugins with other people.