diff --git a/.github/scripts/ZipBuildOutput.ps1 b/.github/scripts/ZipBuildOutput.ps1 index 5ca867ef..bf3c9d94 100644 --- a/.github/scripts/ZipBuildOutput.ps1 +++ b/.github/scripts/ZipBuildOutput.ps1 @@ -10,7 +10,7 @@ Get-ChildItem ($destination) $exclusions = @(git submodule foreach --quiet 'echo $name') # Trying to get any .json schema files (not currently working) # Gets any files with the listed extensions. -Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include "*.clz", "*.cpz", "*.cplz", "*.dll" | ForEach-Object { +Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include "*.clz", "*.cpz", "*.cplz", "*.dll", "*.nuspec" | ForEach-Object { $allowed = $true; # Exclude any files in submodules foreach ($exclude in $exclusions) { diff --git a/.github/workflows/.vscode/settings.json b/.github/workflows/.vscode/settings.json new file mode 100644 index 00000000..2c6fe730 --- /dev/null +++ b/.github/workflows/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "workbench.colorCustomizations": { + "activityBar.background": "#332848", + "titleBar.activeBackground": "#483764", + "titleBar.activeForeground": "#FBFBFD" + } +} \ No newline at end of file diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 315fbd67..a1aae899 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -32,7 +32,20 @@ jobs: uses: actions/checkout@v2 with: fetch-depth: 0 - submodules: true + # And any submodules + #- name: Checkout submodules + # shell: bash + # run: | + # git config --global url."https://github.com/".insteadOf "git@github.com:" + # auth_header="$(git config --local --get http.https://github.com/.extraheader)" + # git submodule sync --recursive + # git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 + - name: Add nuget.exe + uses: nuget/setup-nuget@v1 + - name: Add Github Packages source + run: nuget sources add -name github -source https://nuget.pkg.github.com/pepperdash/index.json -username Pepperdash -password ${{ secrets.GITHUB_TOKEN }} + - name: restore Nuget Packages + run: nuget install .\packages.config -OutputDirectory .\packages -ExcludeVersion # Fetch all tags - name: Fetch tags run: git fetch --tags @@ -107,6 +120,45 @@ jobs: asset_content_type: application/zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + Push_Nuget_Package: + needs: Build_Project + runs-on: windows-latest + steps: + - name: Download Build Version Info + uses: actions/download-artifact@v1 + with: + name: Version + - name: Set Version Number + shell: powershell + run: | + Get-ChildItem "./Version" + $version = Get-Content -Path ./Version/version.txt + Write-Host "Version: $version" + Write-Output "::set-env name=VERSION::$version" + Remove-Item -Path ./Version/version.txt + Remove-Item -Path ./Version + - name: Download Build output + uses: actions/download-artifact@v1 + with: + name: Build + path: ./ + - name: Unzip Build file + run: | + Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\ + Remove-Item -Path .\*.zip + - name: Copy Files to root & delete output directory + run: | + Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz") + Get-ChildItem -Path .\output\* | Copy-Item -Destination .\ + Remove-Item -Path .\output -Recurse + - name: Add nuget.exe + uses: nuget/setup-nuget@v1 + - name: Add Github Packages source + run: nuget sources add -name github -source https://nuget.pkg.github.com/pepperdash/index.json -username Pepperdash -password ${{ secrets.GITHUB_TOKEN }} + - name: Create nuget package + run: nuget pack "./PepperDash_Essentials_Core.nuspec" -version ${{ env.VERSION }} + - name: Publish nuget package to Github registry + run: nuget push **/*.nupkg -source github # This step always runs and pushes the build to the internal build rep Internal_Push_Output: needs: Build_Project diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7bbbd646..0b8a49b9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,13 +25,19 @@ jobs: - name: Checkout repo uses: actions/checkout@v2 # And any submodules - - name: Checkout submodules - shell: bash - run: | - git config --global url."https://github.com/".insteadOf "git@github.com:" - auth_header="$(git config --local --get http.https://github.com/.extraheader)" - git submodule sync --recursive - git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 + #- name: Checkout submodules + # shell: bash + # run: | + # git config --global url."https://github.com/".insteadOf "git@github.com:" + # auth_header="$(git config --local --get http.https://github.com/.extraheader)" + # git submodule sync --recursive + # git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 + - name: Add nuget.exe + uses: nuget/setup-nuget@v1 + - name: Add Github Packages source + run: nuget sources add -name github -source https://nuget.pkg.github.com/pepperdash/index.json -username Pepperdash -password ${{ secrets.GITHUB_TOKEN }} + - name: restore Nuget Packages + run: nuget install .\packages.config -OutputDirectory .\packages -ExcludeVersion # Generate the appropriate version number - name: Set Version Number shell: powershell @@ -85,6 +91,45 @@ jobs: asset_content_type: application/zip env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + Push_Nuget_Package: + needs: Build_Project + runs-on: windows-latest + steps: + - name: Download Build Version Info + uses: actions/download-artifact@v1 + with: + name: Version + - name: Set Version Number + shell: powershell + run: | + Get-ChildItem "./Version" + $version = Get-Content -Path ./Version/version.txt + Write-Host "Version: $version" + Write-Output "::set-env name=VERSION::$version" + Remove-Item -Path ./Version/version.txt + Remove-Item -Path ./Version + - name: Download Build output + uses: actions/download-artifact@v1 + with: + name: Build + path: ./ + - name: Unzip Build file + run: | + Get-ChildItem .\*.zip | Expand-Archive -DestinationPath .\ + Remove-Item -Path .\*.zip + - name: Copy Files to root & delete output directory + run: | + Remove-Item -Path .\* -Include @("*.cpz","*.md","*.cplz","*.json","*.dll","*.clz") + Get-ChildItem -Path .\output\* | Copy-Item -Destination .\ + Remove-Item -Path .\output -Recurse + - name: Add nuget.exe + uses: nuget/setup-nuget@v1 + - name: Add Github Packages source + run: nuget sources add -name github -source https://nuget.pkg.github.com/pepperdash/index.json -username Pepperdash -password ${{ secrets.GITHUB_TOKEN }} + - name: Create nuget package + run: nuget pack "./PepperDash_Essentials_Core.nuspec" -version ${{ env.VERSION }} + - name: Publish nuget package to Github registry + run: nuget push **/*.nupkg -source github Internal_Push_Output: needs: Build_Project runs-on: windows-latest diff --git a/.gitignore b/.gitignore index 5ba628b2..47084fd0 100644 --- a/.gitignore +++ b/.gitignore @@ -23,5 +23,7 @@ SIMPLSharpLogs/ *.projectinfo essentials-framework/EssentialDMTestConfig/ output/ +packages/ + PepperDashEssentials-0.0.0-buildType-test.zip diff --git a/PepperDashEssentials/ControlSystem.cs b/PepperDashEssentials/ControlSystem.cs index 57cd454e..cd9a99cb 100644 --- a/PepperDashEssentials/ControlSystem.cs +++ b/PepperDashEssentials/ControlSystem.cs @@ -53,7 +53,7 @@ namespace PepperDash.Essentials if (Debug.DoNotLoadOnNextBoot) { - CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Loads configuration file", + CrestronConsole.AddNewConsoleCommand(s => GoWithLoadDeferred(), "go", "Loads configuration file", ConsoleAccessLevelEnum.AccessOperator); } @@ -93,13 +93,18 @@ namespace PepperDash.Essentials if (!Debug.DoNotLoadOnNextBoot) { - GoWithLoad(); + GoWithLoad(null); return; } SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true; } + private void GoWithLoadDeferred() + { + CrestronInvoke.BeginInvoke(GoWithLoad); + } + /// /// Determines if the program is running on a processor (appliance) or server (VC-4). /// @@ -172,7 +177,7 @@ namespace PepperDash.Essentials /// /// Begins the process of loading resources including plugins and configuration data /// - public void GoWithLoad() + public void GoWithLoad(object notUsed) { try { diff --git a/PepperDashEssentials/PepperDashEssentials.csproj b/PepperDashEssentials/PepperDashEssentials.csproj index c522b52e..ff65954b 100644 --- a/PepperDashEssentials/PepperDashEssentials.csproj +++ b/PepperDashEssentials/PepperDashEssentials.csproj @@ -71,9 +71,9 @@ ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll - + False - ..\essentials-framework\pepperdashcore-builds\PepperDash_Core.dll + ..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll False diff --git a/README.md b/README.md index e411cabf..1286ae6e 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,37 @@ - # PepperDash Essentials Framework (c) 2020 ## [Latest Release](https://github.com/PepperDash/Essentials/releases/latest) ## License + Provided under MIT license ## Overview + PepperDash Essentials is an open source Crestron framework that can be configured as a standalone program capable of running a wide variety of system designs and can also be utilized as a plug-in architecture to augment other Simpl# Pro and Simpl Windows programs. Essentials Framework is a collection of C# / Simpl# Pro libraries that can be utilized in several different manners. It is currently operating as a 100% configuration-driven system, and can be extended to add different workflows and behaviors, either through the addition of further device "types" or via the plug-in mechanism. The framework is a collection of "things" that are all related and interconnected, but in general do not have dependencies on each other. ## Minimum Requirements + - Essentials Framework runs on any Crestron 3-series processor, **4-series** processor or Crestron's VC-4 platform. - To edit and compile the source, Microsoft Visual Studio 2008 Professional with SP1 is required. - Crestron's Simpl# Plugin is also required (must be obtained from Crestron). ## Dependencies -The [PepperDash.Core](https://github.com/PepperDash/PepperDashCore) SIMPL# library is required. It is referenced as a submodule and will be automatically checked out when cloning this repo if set to recurse submodules. This allows different builds of the PepperDash.Core library to be referenced by checking out the desired submodule commit. +The [PepperDash.Core](https://github.com/PepperDash/PepperDashCore) SIMPL# library is required. It is referenced via nuget. You must have nuget.exe installed and in the `PATH` environment variable to use the following command. Nuget.exe is available at [nuget.org](https://dist.nuget.org/win-x86-commandline/latest/nuget.exe). + +### Installing Dependencies + +To install dependencies once nuget.exe is installed, run the following command: `nuget install .\packages.config -OutputDirectory .\packages -excludeVersion`. To verify that the packages installed correctly, open Essentials and make sure that all references are found, then try and build it. + +### Installing Different versions of PepperDash Core + +If you need a different version of PepperDash Core, use the command `nuget install .\packages.config -OutputDirectory .\packages -excludeVersion -Version {versionToGet}`. Omitting the `-Version` option will pull the latest release version of PepperDash Core. ## Utilization + Essentials was originally conceptualized as a standalone application for running control system logic entirely in Simpl# Pro. It is primarily designed around accomplishing this goal, but during development, it became obvious that it could easily be leveraged to also serve as a partner application to one or more SIMPL Windows programs. Utilization of Essentials Framework falls into the following categories: @@ -34,13 +45,13 @@ Utilization of Essentials Framework falls into the following categories: - Advanced logic. Some logic operations that cannot be affectively accomplished in SIMPL Windows (ex. JSON/XML serialization/deserialization, database operations, etc.) can be done in the Simpl# Pro environment and the necessary input and output bridged to a SIMPL Windows program via EISC. 3. Hybrid Application that may contain elements of both standalone control and SIMPL partner application integration. -- There may be a use case where a device can only be defined in a single application, but that device may need to be interacted with from multiple applications. The device can be defined in an Essentials application, interacted with in that application and also bridged to one or more SIMPL Windows applications. - ## Documentation - For detailed documentation, see the [Wiki](https://github.com/PepperDash/EssentialsFramework/wiki). +- There may be a use case where a device can only be defined in a single application, but that device may need to be interacted with from multiple applications. The device can be defined in an Essentials application, interacted with in that application and also bridged to one or more SIMPL Windows applications. + +## Documentation + +For detailed documentation, see the [Wiki](https://github.com/PepperDash/EssentialsFramework/wiki). ## How-To (Getting Started) See [Getting Started](https://github.com/PepperDash/Essentials/wiki/Get-started#how-to-get-started) - - diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj index e57b6a62..a5e764c2 100644 --- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj @@ -83,9 +83,9 @@ ..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll - + False - ..\..\pepperdashcore-builds\PepperDash_Core.dll + ..\..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll False diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.nuspec b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.nuspec new file mode 100644 index 00000000..d5bb4a57 --- /dev/null +++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.nuspec @@ -0,0 +1,24 @@ + + + + PepperDashEssentials + 1.5.6 + PepperDash Essentials + PepperDash Technologies + pepperdash + false + MIT + https://github.com/PepperDash/PepperDashCore + Copyright 2020 + PepperDash Essentials is an open source Crestron framework that can be configured as a standalone program capable of running a wide variety of system designs and can also be utilized as a plug-in architecture to augment other Simpl# Pro and Simpl Windows programs. Essentials Framework is a collection of C# / Simpl# Pro libraries that can be utilized in several different manners. It is currently operating as a 100% configuration-driven system, and can be extended to add different workflows and behaviors, either through the addition of further device "types" or via the plug-in mechanism. The framework is a collection of "things" that are all related and interconnected, but in general do not have dependencies on each other. + crestron 3series 4series + + + + + + + + + + \ No newline at end of file diff --git a/essentials-framework/Essentials DM/Essentials_DM/PepperDash_Essentials_DM.csproj b/essentials-framework/Essentials DM/Essentials_DM/PepperDash_Essentials_DM.csproj index 76aae649..81426594 100644 --- a/essentials-framework/Essentials DM/Essentials_DM/PepperDash_Essentials_DM.csproj +++ b/essentials-framework/Essentials DM/Essentials_DM/PepperDash_Essentials_DM.csproj @@ -59,9 +59,9 @@ ..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll - + False - ..\..\pepperdashcore-builds\PepperDash_Core.dll + ..\..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll False diff --git a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj index e33e54fd..c4e29032 100644 --- a/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj +++ b/essentials-framework/Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj @@ -63,9 +63,9 @@ ..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Lighting.dll - + False - ..\..\pepperdashcore-builds\PepperDash_Core.dll + ..\..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll False diff --git a/essentials-framework/Essentials/PepperDashEssentials/packages.config b/essentials-framework/Essentials/PepperDashEssentials/packages.config new file mode 100644 index 00000000..f1f7bd89 --- /dev/null +++ b/essentials-framework/Essentials/PepperDashEssentials/packages.config @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/packages.config b/packages.config new file mode 100644 index 00000000..42d552c6 --- /dev/null +++ b/packages.config @@ -0,0 +1,3 @@ + + + \ No newline at end of file