Updated build system with template

This commit is contained in:
Florian Rappl
2023-04-04 16:40:45 +02:00
parent 555f0378b4
commit 03c08503cc
8 changed files with 20 additions and 100 deletions

View File

@@ -30,7 +30,7 @@ namespace ElectronNET.CLI.Commands.Actions
EmbeddedFileHelper.DeployEmbeddedFile(hostDistFolder, "build-helper.js", "dist.");
EmbeddedFileHelper.DeployEmbeddedFile(vscodeFolder, "launch.json", ".vscode.");
EmbeddedFileHelper.DeployEmbeddedFile(vscodeFolder, "tasks.json", ".vscode.");
EmbeddedFileHelper.DeployEmbeddedFile(splashscreenFolder, "index.html", "splashscreen.");
EmbeddedFileHelper.DeployEmbeddedFile(splashscreenFolder, "index.html", "splashscreen.");
}
}
}

View File

@@ -39,8 +39,8 @@
<None Include="PackageIcon.png" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="..\ElectronNET.Host\electron.manifest.json" Link="ElectronHost\electron.manifest.json" />
<EmbeddedResource Include="..\ElectronNET.Host\package.json" Link="ElectronHost\package.json" />
<EmbeddedResource Include="..\ElectronNET.Host\template\electron.manifest.json" Link="ElectronHost\electron.manifest.json" />
<EmbeddedResource Include="..\ElectronNET.Host\template\package.json" Link="ElectronHost\package.json" />
<EmbeddedResource Include="..\ElectronNET.Host\dist\main.js" Link="ElectronHost\dist\main.js" />
<EmbeddedResource Include="..\ElectronNET.Host\dist\build-helper.js" Link="ElectronHost\dist\build-helper.js" />
<EmbeddedResource Include="..\ElectronNET.Host\splashscreen\index.html" Link="ElectronHost\splashscreen\index.html" />

View File

@@ -30,7 +30,7 @@ namespace ElectronNET.CLI
var hookSource = Path.Combine(electronhosthookDir, "index.ts");
var hookTarget = Path.Combine(root, "dist", "host-hook.js");
Console.WriteLine("Bundle ElectronHostHook ...");
CmdExecute($"npm start --outfile={hookTarget}", electronhosthookDir);
CmdExecute($"npm start -- --outfile={hookTarget}", electronhosthookDir);
}
}
@@ -38,7 +38,7 @@ namespace ElectronNET.CLI
{
using (Process cmd = new Process())
{
bool isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
var isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
if (isWindows)
{

View File

@@ -13,8 +13,7 @@
"build:main": "esbuild src/main.ts --external:electron --platform=node --target=es2020 --bundle --outdir=dist",
"build:build-helper": "esbuild src/build-helper.ts --external:electron --platform=node --target=es2020 --bundle --outdir=dist"
},
"dependencies": {},
"devDependencies": {
"dependencies": {
"@types/dasherize": "^2.0.0",
"@types/node": "^18.15.5",
"@types/portscanner": "^2.1.1",

View File

@@ -47,7 +47,7 @@ const watchable = app.commandLine.hasSwitch("watch");
// if watch is enabled lets change the path
const currentBinPath = watchable
? resolve(__dirname, "../../")
: resolve(__dirname.replace("app.asar", ""), "bin");
: resolve(__dirname, "../../", "bin");
const hostHookScriptFilePath = resolve(__dirname, "host-hook.js");
const manifestJsonFilePath = resolve(currentBinPath, manifestJsonFileName);

View File

@@ -10,7 +10,7 @@
"build": {
"appId": "com.{{executable}}.app",
"productName": "{{executable}}",
"copyright": "Copyright © 2020",
"copyright": "Copyright © 2023",
"buildVersion": "1.0.0",
"compression": "maximum",
"directories": {

View File

@@ -0,0 +1,11 @@
{
"name": "electron-net",
"version": "1.0.0",
"description": "Host for Electron.NET.",
"main": "dist/main.js",
"author": "Gregor Biswanger, Florian Rappl",
"license": "MIT",
"devDependencies": {
"electron": "^23.2.0"
}
}

View File

@@ -1,91 +1 @@
# Created by https://www.gitignore.io/api/node
# Edit at https://www.gitignore.io/?templates=node
### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# End of https://www.gitignore.io/api/node
node_modules