A Cake AddIn that extends Cake with Electron.NET command tools.
Stable | Nightly |
---|---|
Build server | Platform | Build status |
---|---|---|
Azure Pipelines | Ubuntu | |
Azure Pipelines | macOs | |
Azure Pipelines | Windows |
Cake.Electron.Net
is depends on ElectronNET.CLI
cli tool. Make sure you have installed the ElectronNET.CLI packages as global tool:
dotnet tool install ElectronNET.CLI -g
Including add-in in cake script is easy.
#addin "nuget:?package=Cake.Electron.Net"
Please see Electron.NET for commands usages.
- ElectronNetBuild
- ElectronNetAdd
- ElectronNetInit
- ElectronNetStart
- ElectronNetVersion
using Cake.Electron.Net
using Cake.Electron.Net.Commands.Settings
Task("Build")
.Does(() => {
ElectronNetVersion(workingDirectory);
ElectronNetBuildSettings settings = new ElectronNetBuildSettings();
settings.WorkingDirectory = workingDirectory;
settings.ElectronTarget = ElectronTarget.Win;
settings.DotNetConfig = DotNetConfig.Release;
ElectronNetBuild(settings);
});
Licensed under MIT, see LICENSE for the full text.
Make sure you also have the new Electron.NET CLI 5.22.12 version. This now uses electron-builder and the necessary configuration to build is made in the electron.manifest.json file. In addition, own Electron.NET configurations are stored. Please make sure that your electron.manifest.json file has the following new structure:
{
"executable": "{{executable}}",
"splashscreen": {
"imageFile": ""
},
"singleInstance": false,
"build": {
"appId": "com.{{executable}}.app",
"productName": "{{executable}}",
"copyright": "Copyright © 2019",
"buildVersion": "1.0.0",
"compression": "maximum",
"directories": {
"output": "../../../bin/Desktop"
},
"extraResources": [
{
"from": "./bin",
"to": "bin",
"filter": ["**/*"]
}
],
"files": [
{
"from": "./ElectronHostHook/node_modules",
"to": "ElectronHostHook/node_modules",
"filter": ["**/*"]
},
"**/*"
]
}
}
In the Version 0.0.9 the CLI was not a global tool and needed to be registred like this in the .csproj:
<ItemGroup>
<DotNetCliToolReference Include="ElectronNET.CLI" Version="0.0.9" />
</ItemGroup>
If you still use this version you will need to install Cake.Electron.Net v0.0.9