From 65a58ce2be0bf575b0aa30ca373ff68b9ca419ed Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Wed, 16 Oct 2019 13:56:40 +0200 Subject: [PATCH 1/2] Switched to `typefox-service-account1`. Signed-off-by: Akos Kitta --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 26eac589..6326f312 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -69,7 +69,7 @@ jobs: downloadPath: 'gh-release' - task: GithubRelease@0 inputs: - gitHubConnection: personal-access-token-service-connection + gitHubConnection: typefox-service-account1 repositoryName: bcmi-labs/arduino-editor assets: | gh-release/Arduino-PoC - Applications/*.zip From cc6a0ae2125305e5d066dc8f4f4b78340d4dc6ab Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Thu, 17 Oct 2019 08:45:26 +0200 Subject: [PATCH 2/2] Fixed various electron packager issues - We have to reuse the `yarn.lock` file for the final app, not just for the extensions. - Simplified the clean-up phase. Signed-off-by: Akos Kitta --- .vscode/launch.json | 5 +++-- electron/packager/index.js | 23 ++++++++++++++++------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index c2791d75..522b90c3 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -7,8 +7,9 @@ { "type": "node", "request": "launch", - "name": "Launch Node.js Program", - "program": "${file}" + "name": "Launch Electron Packager", + "program": "${workspaceRoot}/electron/packager/index.js", + "cwd": "${workspaceFolder}/electron/packager" }, { "type": "node", diff --git a/electron/packager/index.js b/electron/packager/index.js index 330a4720..a7cb4af5 100644 --- a/electron/packager/index.js +++ b/electron/packager/index.js @@ -33,10 +33,8 @@ //---------------------------+ // rm -rf ../working-copy rm('-rf', path('..', workingCopy)); - // rm -rf ../build/dist - rm('-rf', path('..', 'build', 'dist')); - // rm -rf ../build/package.json - rm('-rf', path('..', 'build', 'package.json')); + // Clean up the `./electron/build` folder. + shell.exec(`git -C ${path('..', 'build')} clean -ffxdq`, { async: false }); //----------------------------------------------------------------------------------------------+ // Copy the following items into the `working-copy` folder. Make sure to reuse the `yarn.lock`. | @@ -79,7 +77,7 @@ pkg = require('../working-copy/electron-app/package.json'); // @ts-ignore const template = require('../build/template-package.json'); - template.build.files = [ ...template.build.files, ...unusedDependencies.map(name => `!node_modules/${name}`) ]; + template.build.files = [...template.build.files, ...unusedDependencies.map(name => `!node_modules/${name}`)]; pkg.dependencies = { ...pkg.dependencies, ...template.dependencies }; pkg.devDependencies = { ...pkg.devDependencies, ...template.devDependencies }; fs.writeFileSync(path('..', 'build', 'package.json'), JSON.stringify({ @@ -95,6 +93,17 @@ ${fs.readFileSync(path('..', 'build', 'package.json')).toString()} ----------------------- `); + // Make sure the original `yarn.lock` file is used from the electron application. + if (fs.existsSync(path('..', 'build', 'yarn.lock'))) { + echo(`${path('..', 'build', 'yarn.lock')} must not exist.`); + shell.exit(1); + } + cp('-rf', path(rootPath, 'yarn.lock'), path('..', 'build')); + if (!fs.existsSync(path('..', 'build', 'yarn.lock'))) { + echo(`${path('..', 'build', 'yarn.lock')} does not exist.`); + shell.exit(1); + } + //-------------------------------------------------------------------------------------------+ // Install all private and public dependencies for the electron application and build Theia. | //-------------------------------------------------------------------------------------------+ @@ -109,7 +118,7 @@ ${fs.readFileSync(path('..', 'build', 'package.json')).toString()} rm('-rf', path('..', 'build', dotenv)); } // For the releases we use the desired tag as is defined by `$(Release.Tag)` from Azure. - // For the preview builds we use the version from the `electron/build/package.json` with the short commit hash. + // For the preview builds we use the version from the `electron/build/package.json` with the short commit hash. fs.writeFileSync(path('..', 'build', dotenv), `ARDUINO_VERSION=${version}`); //-----------------------------------+ @@ -186,4 +195,4 @@ ${fs.readFileSync(path('..', 'build', 'package.json')).toString()} return join(__dirname, ...paths); } -})(); \ No newline at end of file +})();