Files
Electron.NET/README.md

73 lines
2.7 KiB
Markdown
Raw Normal View History

2017-10-17 15:34:53 +02:00
[![Electron.NET Logo](https://github.com/GregorBiswanger/Electron.NET/blob/master/assets/images/electron.net-logo.png)](https://github.com/GregorBiswanger/Electron.NET)
2017-10-17 15:32:09 +02:00
2017-10-17 22:30:41 +02:00
Master: [![Build status](https://ci.appveyor.com/api/projects/status/u710d6hman5a4beb/branch/master?svg=true)](https://ci.appveyor.com/project/robertmuehsig/electron-net/branch/master)
2017-10-16 23:16:50 +02:00
2017-10-03 14:35:40 +02:00
Build cross platform desktop apps with .NET Core and ASP.NET NET Core.
2017-10-03 23:37:46 +02:00
2017-10-17 23:48:02 +02:00
# Usage:
* To communicate with the "native" (sort of native...) Electron API include the [ElectronNET.API NuGet package](https://www.nuget.org/packages/ElectronNET.API/) in your ASP.NET Core app.
* For the tooling you will need your dotnet-electronize package [ElectronNET.CLI NuGet package](https://www.nuget.org/packages/ElectronNET.CLI/). This package __must__ be referenced in the .csproj like this:
2017-10-17 23:49:24 +02:00
```
2017-10-17 23:48:02 +02:00
<ItemGroup>
<DotNetCliToolReference Include="ElectronNET.CLI" Version="*" />
</ItemGroup>
2017-10-17 23:49:24 +02:00
```
2017-10-17 23:48:02 +02:00
* Make sure you have node.js and on OSX/Ubuntu the electron-packager installed (via "sudo npm install electron-packager --global")
* In your ASP.NET Core folder run:
2017-10-17 23:49:24 +02:00
```
2017-10-17 23:48:02 +02:00
dotnet electronize init
2017-10-17 23:49:24 +02:00
```
2017-10-17 23:48:02 +02:00
* Now a electronnet.manifest.json should appear in your ASP.NET Core project
* Now run the following:
2017-10-17 23:49:44 +02:00
```
2017-10-17 23:48:02 +02:00
dotnet electronize build
2017-10-17 23:49:44 +02:00
```
2017-10-17 23:48:02 +02:00
* In your default setting we just build the application for the OS you are running (Windows builds Windows, OSX builds OSX etc.), but this can be changed with:
2017-10-17 23:49:24 +02:00
```
2017-10-17 23:48:02 +02:00
dotnet electronize build win
dotnet electronize build osx
dotnet electronize build linux
2017-10-17 23:49:24 +02:00
```
2017-10-17 23:48:02 +02:00
* The end result should be a electron app under your /bin/desktop folder
2017-10-03 23:37:46 +02:00
## Dev Notes:
Currently there are two main projects and a "WebApp" that serves as a demo playground.
* ElectronNET.API: Defines the Electron / .NET API bridge
* ElectronNET.CLI: Responsible for the dotnet "electronize" tooling.
Both projects create their own nuget package. The resulting nuget packages are saved under "/artifacts".
2017-10-17 23:48:02 +02:00
__Currently__ the packages are just build with version 1.0.0 on your machine. NuGet might pick the wrong version from its own cache, so please read the dev notes if you want to develop!
2017-10-03 23:37:46 +02:00
__ElectronNET.WebApp:__
The WebApp now has referenced the API NuGet package and via the .csproj reference the CLI:
<ItemGroup>
<DotNetCliToolReference Include="ElectronNET.CLI" Version="*" />
</ItemGroup>
2017-10-03 23:46:00 +02:00
2017-10-17 22:30:41 +02:00
# Dev Notes: Dev Workflow
(at least for the CLI extension)
2017-10-03 23:46:00 +02:00
* Change something in the CLI project
* rebuild the project (a nuget package should now appear in the /artifacts directory)
* make sure there is no ElectronNET.CLI package in your %userprofile%\.nuget\packages cache with the same version
2017-10-17 23:55:53 +02:00
* execute dotnet restore in the WebApp
2017-10-03 23:46:00 +02:00
* execute dotnet electronize