Both sides previous revisionPrevious revisionNext revision | Previous revision |
dev:client_coding:building_the_desktop_app [2023/05/22 05:42] – [Command-line Flags] dstillman | dev:client_coding:building_the_desktop_app [2024/07/20 03:00] (current) – [Helper Script] dstillman |
---|
//**Windows users:** The following commands assume a POSIX-compliant system. To build Zotero on Windows, please follow the [[building_the_desktop_app_windows_notes|Windows-specific steps]] first.// | //**Windows users:** The following commands assume a POSIX-compliant system. To build Zotero on Windows, please follow the [[building_the_desktop_app_windows_notes|Windows-specific steps]] first.// |
| |
- Make sure you have Git and Git LFS installed. | - Make sure you have Git and Git LFS installed. ''git lfs'' shouldn't show an error. |
- Clone the Zotero source code: <code sh>git clone --recursive https://github.com/zotero/zotero zotero-client</code> | - Clone the Zotero source code: <code sh>git clone --recursive https://github.com/zotero/zotero zotero-client</code> |
- Change to the source code repo: <code sh>cd zotero-client</code> | - Change to the source code repo: <code sh>cd zotero-client</code> |
To build Zotero for another platform, first prepare Zotero's JavaScript source by running ''npm run build'' (or keep it prepared automatically as you make changes with ''npm start'') and then run ''app/scripts/dir_build'' with the ''-p'' flag for the desired platform (e.g., ''app/scripts/dir_build -p w'' for Windows). | To build Zotero for another platform, first prepare Zotero's JavaScript source by running ''npm run build'' (or keep it prepared automatically as you make changes with ''npm start'') and then run ''app/scripts/dir_build'' with the ''-p'' flag for the desired platform (e.g., ''app/scripts/dir_build -p w'' for Windows). |
| |
| If running ''npm run build'' manually, you may need to set the environment variable ''%%NODE_OPTIONS=--openssl-legacy-provider%%'' to avoid an ''ERR_OSSL_EVP_UNSUPPORTED'' error. |
===== Running Your Custom Build ==== | ===== Running Your Custom Build ==== |
| |
* ''-ZoteroDebugText'' or ''-ZoteroDebug'' enable [[:debug_output#logging_to_a_terminal_window|real-time debug output]] from ''Zotero.debug()'' | * ''-ZoteroDebugText'' or ''-ZoteroDebug'' enable [[:debug_output#logging_to_a_terminal_window|real-time debug output]] from ''Zotero.debug()'' |
* ''-jsconsole'' will open the Error Console (Tools → Developer → Error Console) | * ''-jsconsole'' will open the Error Console (Tools → Developer → Error Console) |
| * ''-jsdebugger'' starts the Firefox Browser Toolbox for [[developer_tools|debugging]], if Zotero was built with devtools enabled; not available in release builds |
* ''-ZoteroSkipBundledFiles'' skips style and translator initialization, which speeds up startup time after rebuilding if you're working on something that doesn't require styles or translators | * ''-ZoteroSkipBundledFiles'' skips style and translator initialization, which speeds up startup time after rebuilding if you're working on something that doesn't require styles or translators |
* ''-debugger'' starts the Mozilla DevTools server for [[developer_tools|remote debugging]], if Zotero was built with devtools enabled; not available in release builds | |
==== Helper Script ==== | ==== Helper Script ==== |
| |
For local development, you'll want to use the [[https://raw.githubusercontent.com/zotero/zotero/master/app/scripts/build_and_run|build_and_run]] helper script, which automates rebuilding Zotero and starting it with debug output enabled and the error console open. Create an alias for ''app/scripts/build_and_run'' with an appropriate name (e.g., ''zotero-source''), or create a shell script in your path that selects a preexisting development [[:kb/multiple_profiles|profile]] and passes on command-line parameters: | For local development, you'll want to use the [[https://raw.githubusercontent.com/zotero/zotero/master/app/scripts/build_and_run|build_and_run]] helper script, which automates rebuilding Zotero and starting it with debug output enabled and the error console open. Create an alias for ''app/scripts/build_and_run'' with an appropriate name (e.g., ''zotero-source''), or create a shell script in your path that selects a preexisting development [[:kb/multiple_profiles|profile]] and forwards command-line parameters: |
| |
<code sh> | <code sh> |
Options: | Options: |
| |
-r Rebuild (calling `npm run build` automatically if `npm start` isn't running) | * ''-r'' Rebuild (calling `npm run build` automatically if `npm start` isn't running) |
| * ''-d'' Include Firefox Developer Tools in a rebuild and open the Browser Toolbox |
-b Skip bundled styles and translators | * ''-b'' Skip bundled styles and translators — avoids extra work at startup if not needed |
| |
-d Start the devtools server for [[developer_tools|remote debugging]] | |
===== Running Zotero Plugins ===== | ===== Running Zotero Plugins ===== |
| |