Skip to content

Commit 03c0850

Browse files
committed
Updated build system with template
1 parent 555f037 commit 03c0850

File tree

8 files changed

+20
-100
lines changed

8 files changed

+20
-100
lines changed

src/ElectronNET.CLI/Commands/Actions/DeployEmbeddedElectronFiles.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static void Do(string tempPath)
3030
EmbeddedFileHelper.DeployEmbeddedFile(hostDistFolder, "build-helper.js", "dist.");
3131
EmbeddedFileHelper.DeployEmbeddedFile(vscodeFolder, "launch.json", ".vscode.");
3232
EmbeddedFileHelper.DeployEmbeddedFile(vscodeFolder, "tasks.json", ".vscode.");
33-
EmbeddedFileHelper.DeployEmbeddedFile(splashscreenFolder, "index.html", "splashscreen.");
33+
EmbeddedFileHelper.DeployEmbeddedFile(splashscreenFolder, "index.html", "splashscreen.");
3434
}
3535
}
3636
}

src/ElectronNET.CLI/ElectronNET.CLI.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
<None Include="PackageIcon.png" Pack="true" PackagePath="\" />
4040
</ItemGroup>
4141
<ItemGroup>
42-
<EmbeddedResource Include="..\ElectronNET.Host\electron.manifest.json" Link="ElectronHost\electron.manifest.json" />
43-
<EmbeddedResource Include="..\ElectronNET.Host\package.json" Link="ElectronHost\package.json" />
42+
<EmbeddedResource Include="..\ElectronNET.Host\template\electron.manifest.json" Link="ElectronHost\electron.manifest.json" />
43+
<EmbeddedResource Include="..\ElectronNET.Host\template\package.json" Link="ElectronHost\package.json" />
4444
<EmbeddedResource Include="..\ElectronNET.Host\dist\main.js" Link="ElectronHost\dist\main.js" />
4545
<EmbeddedResource Include="..\ElectronNET.Host\dist\build-helper.js" Link="ElectronHost\dist\build-helper.js" />
4646
<EmbeddedResource Include="..\ElectronNET.Host\splashscreen\index.html" Link="ElectronHost\splashscreen\index.html" />

src/ElectronNET.CLI/ProcessHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ public static void BundleHostHook(string root)
3030
var hookSource = Path.Combine(electronhosthookDir, "index.ts");
3131
var hookTarget = Path.Combine(root, "dist", "host-hook.js");
3232
Console.WriteLine("Bundle ElectronHostHook ...");
33-
CmdExecute($"npm start --outfile={hookTarget}", electronhosthookDir);
33+
CmdExecute($"npm start -- --outfile={hookTarget}", electronhosthookDir);
3434
}
3535
}
3636

3737
public static int CmdExecute(string command, string workingDirectoryPath, bool output = true, bool waitForExit = true)
3838
{
3939
using (Process cmd = new Process())
4040
{
41-
bool isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
41+
var isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
4242

4343
if (isWindows)
4444
{

src/ElectronNET.Host/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
"build:main": "esbuild src/main.ts --external:electron --platform=node --target=es2020 --bundle --outdir=dist",
1414
"build:build-helper": "esbuild src/build-helper.ts --external:electron --platform=node --target=es2020 --bundle --outdir=dist"
1515
},
16-
"dependencies": {},
17-
"devDependencies": {
16+
"dependencies": {
1817
"@types/dasherize": "^2.0.0",
1918
"@types/node": "^18.15.5",
2019
"@types/portscanner": "^2.1.1",

src/ElectronNET.Host/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const watchable = app.commandLine.hasSwitch("watch");
4747
// if watch is enabled lets change the path
4848
const currentBinPath = watchable
4949
? resolve(__dirname, "../../")
50-
: resolve(__dirname.replace("app.asar", ""), "bin");
50+
: resolve(__dirname, "../../", "bin");
5151

5252
const hostHookScriptFilePath = resolve(__dirname, "host-hook.js");
5353
const manifestJsonFilePath = resolve(currentBinPath, manifestJsonFileName);

src/ElectronNET.Host/electron.manifest.json renamed to src/ElectronNET.Host/template/electron.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"build": {
1111
"appId": "com.{{executable}}.app",
1212
"productName": "{{executable}}",
13-
"copyright": "Copyright © 2020",
13+
"copyright": "Copyright © 2023",
1414
"buildVersion": "1.0.0",
1515
"compression": "maximum",
1616
"directories": {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "electron-net",
3+
"version": "1.0.0",
4+
"description": "Host for Electron.NET.",
5+
"main": "dist/main.js",
6+
"author": "Gregor Biswanger, Florian Rappl",
7+
"license": "MIT",
8+
"devDependencies": {
9+
"electron": "^23.2.0"
10+
}
11+
}
Lines changed: 1 addition & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1 @@
1-
2-
# Created by https://www.gitignore.io/api/node
3-
# Edit at https://www.gitignore.io/?templates=node
4-
5-
### Node ###
6-
# Logs
7-
logs
8-
*.log
9-
npm-debug.log*
10-
yarn-debug.log*
11-
yarn-error.log*
12-
lerna-debug.log*
13-
14-
# Diagnostic reports (https://nodejs.org/api/report.html)
15-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
16-
17-
# Runtime data
18-
pids
19-
*.pid
20-
*.seed
21-
*.pid.lock
22-
23-
# Directory for instrumented libs generated by jscoverage/JSCover
24-
lib-cov
25-
26-
# Coverage directory used by tools like istanbul
27-
coverage
28-
29-
# nyc test coverage
30-
.nyc_output
31-
32-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
33-
.grunt
34-
35-
# Bower dependency directory (https://bower.io/)
36-
bower_components
37-
38-
# node-waf configuration
39-
.lock-wscript
40-
41-
# Compiled binary addons (https://nodejs.org/api/addons.html)
42-
build/Release
43-
44-
# Dependency directories
45-
node_modules/
46-
jspm_packages/
47-
48-
# TypeScript v1 declaration files
49-
typings/
50-
51-
# Optional npm cache directory
52-
.npm
53-
54-
# Optional eslint cache
55-
.eslintcache
56-
57-
# Optional REPL history
58-
.node_repl_history
59-
60-
# Output of 'npm pack'
61-
*.tgz
62-
63-
# Yarn Integrity file
64-
.yarn-integrity
65-
66-
# dotenv environment variables file
67-
.env
68-
.env.test
69-
70-
# parcel-bundler cache (https://parceljs.org/)
71-
.cache
72-
73-
# next.js build output
74-
.next
75-
76-
# nuxt.js build output
77-
.nuxt
78-
79-
# vuepress build output
80-
.vuepress/dist
81-
82-
# Serverless directories
83-
.serverless/
84-
85-
# FuseBox cache
86-
.fusebox/
87-
88-
# DynamoDB Local files
89-
.dynamodb/
90-
91-
# End of https://www.gitignore.io/api/node
1+
node_modules

0 commit comments

Comments
 (0)