Skip to content

Commit 61b4a94

Browse files
committed
Merge remote-tracking branch 'origin/electronized'
2 parents 500fe3d + d3cf2cb commit 61b4a94

File tree

8 files changed

+69
-7
lines changed

8 files changed

+69
-7
lines changed

CryptoStatsSource/CryptoStatsSource.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<TargetFramework>net5.0</TargetFramework>
55
<AssemblyName>CryptoStatsSource</AssemblyName>
66
<RootNamespace>CryptoStatsSource</RootNamespace>
7+
<SelfContained>false</SelfContained>
78
</PropertyGroup>
89

910
<ItemGroup>

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ A tracker of your crypto portfolio, written in C# using .NET core. Made as KIV/N
99
- integration tests ready
1010
- Blazor app startup with DI
1111
- fetching basic cryptocurrency stats via CG datasource and showing it on the "Fetch Data" page
12+
## Electron
13+
```electronize start /PublishSingleFile false /PublishReadyToRun false --no-self-contained```
1214

Repository/Repository.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<TargetFramework>net5.0</TargetFramework>
55
<AssemblyName>Repository</AssemblyName>
66
<RootNamespace>Repository</RootNamespace>
7+
<SelfContained>false</SelfContained>
78
</PropertyGroup>
89

910
<ItemGroup>

WebFrontend/Program.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Collections.Generic;
77
using System.Linq;
88
using System.Threading.Tasks;
9+
using ElectronNET.API;
910

1011
namespace WebFrontend
1112
{
@@ -18,6 +19,10 @@ public static void Main(string[] args)
1819

1920
public static IHostBuilder CreateHostBuilder(string[] args) =>
2021
Host.CreateDefaultBuilder(args)
21-
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); });
22+
.ConfigureWebHostDefaults(webBuilder =>
23+
{
24+
webBuilder.UseElectron(args);
25+
webBuilder.UseStartup<Startup>();
26+
});
2227
}
2328
}

WebFrontend/Properties/launchSettings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
}
99
},
1010
"profiles": {
11+
"Electron.NET App": {
12+
"commandName": "Executable",
13+
"executablePath": "electronize",
14+
"commandLineArgs": "start",
15+
"workingDirectory": "."
16+
},
17+
1118
"IIS Express": {
1219
"commandName": "IISExpress",
1320
"launchBrowser": true,

WebFrontend/Startup.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using System;
22
using System.Net.Http;
3+
using System.Threading.Tasks;
34
using CryptoStatsSource;
45
using Database;
6+
using ElectronNET.API;
57
using MatBlazor;
68
using Microsoft.AspNetCore.Builder;
79
using Microsoft.AspNetCore.Hosting;
@@ -87,6 +89,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
8789
endpoints.MapBlazorHub();
8890
endpoints.MapFallbackToPage("/_Host");
8991
});
92+
Task.Run(async () => await Electron.WindowManager.CreateWindowAsync());
9093
}
9194
}
9295
}

WebFrontend/WebFrontend.csproj

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
2-
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
32
<PropertyGroup>
43
<TargetFramework>net5.0</TargetFramework>
54
<AssemblyName>WebFrontend</AssemblyName>
65
<RootNamespace>WebFrontend</RootNamespace>
76
</PropertyGroup>
8-
97
<ItemGroup>
8+
<PackageReference Include="ElectronNET.API" Version="11.5.1" />
109
<PackageReference Include="MatBlazor" Version="2.8.0" />
1110
<PackageReference Include="Microsoft.Data.Sqlite" Version="5.0.4" />
1211
<PackageReference Include="SqlKata" Version="2.3.2" />
1312
<PackageReference Include="SqlKata.Execution" Version="2.3.2" />
1413
</ItemGroup>
15-
1614
<ItemGroup>
1715
<ProjectReference Include="..\CryptoStatsSource\CryptoStatsSource.csproj" />
1816
<ProjectReference Include="..\Repository\Repository.csproj" />
1917
<ProjectReference Include="..\Services\Services\Services.csproj" />
2018
</ItemGroup>
21-
22-
</Project>
19+
<ItemGroup>
20+
<Content Remove="electron.manifest.json" />
21+
</ItemGroup>
22+
<ItemGroup>
23+
<Compile Remove="ProgramWithoutElectron.cs" />
24+
</ItemGroup>
25+
<ItemGroup>
26+
<Content Update="electron.manifest.json">
27+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
28+
</Content>
29+
</ItemGroup>
30+
</Project>

WebFrontend/electron.manifest.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"executable": "WebFrontend",
3+
"splashscreen": {
4+
"imageFile": ""
5+
},
6+
"name": "WebFrontend",
7+
"author": "",
8+
"singleInstance": false,
9+
"environment": "Production",
10+
"build": {
11+
"appId": "com.WebFrontend.app",
12+
"productName": "WebFrontend",
13+
"copyright": "Copyright © 2020",
14+
"buildVersion": "1.0.0",
15+
"compression": "maximum",
16+
"directories": {
17+
"output": "../../../bin/Desktop"
18+
},
19+
"extraResources": [
20+
{
21+
"from": "./bin",
22+
"to": "bin",
23+
"filter": [ "**/*" ]
24+
}
25+
],
26+
"files": [
27+
{
28+
"from": "./ElectronHostHook/node_modules",
29+
"to": "ElectronHostHook/node_modules",
30+
"filter": [ "**/*" ]
31+
},
32+
"**/*"
33+
]
34+
}
35+
}

0 commit comments

Comments
 (0)