FritzAndFriends / StreamDeckToolkit

A .NET Standard library, template, and tools for building extensions to the Elgato Stream Deck
MIT License
164 stars 45 forks source link

[WIP] Proposal: Refactor Registration Scripts #110

Closed NotMyself closed 5 years ago

NotMyself commented 5 years ago

Fixes #109

Over the last couple of weeks, we have seen the RegisterPluginAndStartStreamDeck.ps1 and RegisterPluginAndStartStreamDeck.sh files get out of sync or have changes get reverted. This is caused by the scripts being duplicated in both the SamplePlugin and Templates/StreamDeck.PluginsTemplate.Csharp directories.

This proposal centralizes the placement of all scripts into a scripts directory located at the root of the project. For this to work, the following requirements must be met:

To meet these requirements, the following changes are proposed:

  1. All scripts are relocated to a single scripts directory.
  2. SamplePlugin has been modified to include the scripts from the new location.
  3. StreamDeckPluginTemplate.nuspec has been updated to include the scripts on a build.
  4. Both an install.sh|ps1 and uninstall.sh|ps1 scripts are added to the scripts directory to facilitate local development.

I have tested all of these requirements on OSX in both bash and powershell core. But it would be a good idea to have a windows user perform the same tests.

Tests:

  1. Run a dotnet build from the SamplePlugin directory.
    • Expected Result: build should complete, plugin should be copied to plugin directory and Stream Deck app should be restarted.
  2. Run nuget pack Templates/StreamDeck.PluginTemplate.Csharp/StreamDeckPluginTemplate.nuspec from the root of the repository.
    • Expected Result: the registration scripts should be included in the build nuget package.
  3. Install the template locally by running ./scripts/install.sh|ps1 from the root of the repository.
    • Expected Result: The template should install correctly and new projects created with it should execute the scripts as expected.
  4. Uninstall the template locally by running ./scripts/uninstall.sh|ps1.
    • Expected Result: The template should be cleanly removed.

Note: For test 2, you may need to temporarily edit the nuspec file to have a valid version number.

csharpfritz commented 5 years ago

Can we just reference *.csproj since there is only one csproj file in the folder?

NotMyself commented 5 years ago

I just added a .gitattributes file because I noticed some whitespace munging. It should help.