Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:client_coding:building_the_desktop_app [2023/05/22 05:32] dstillmandev:client_coding:building_the_desktop_app [2024/01/24 01:45] (current) – [Build Steps] dstillman
Line 7: Line 7:
 //**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>
Line 18: Line 18:
 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 ====
  
-After you've built the client, you can continue to run it from ''app/staging/'' or move the app directory to a location of your choosing.+After you've built the client, you can continue to run it from ''app/staging/'' or move the app directory to a location of your choosing and start it normally.
  
 For development, you'll generally want to leave the app in the staging directory and use the ''build_and_run'' [[#helper_script|helper script]], but you can also call the launcher directly: For development, you'll generally want to leave the app in the staging directory and use the ''build_and_run'' [[#helper_script|helper script]], but you can also call the launcher directly:
Line 38: Line 39:
 ==== Command-line Flags ==== ==== Command-line Flags ====
  
-In most cases, you'll want to use the [[#helper_script|helper script]] below instead of passing these flags directly to the launcher, but it's helpful to know the available options:+In most cases, you'll want to use the [[#helper_script|helper script]] below instead of passing these flags directly to the launcher, but it's helpful to know the available options, which also work with release and beta builds:
  
   * ''-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)
   * ''-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 +  * ''-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>
Line 59: Line 59:
 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) 
- +  * ''-b''  Skip bundled styles and translators 
--b Skip bundled styles and translators +  * ''-d''  Start the devtools server for [[developer_tools|remote debugging]]
- +
--d Start the devtools server for [[developer_tools|remote debugging]]+
  
 ===== Running Zotero Plugins ===== ===== Running Zotero Plugins =====
dev/client_coding/building_the_desktop_app.1684747963.txt.gz · Last modified: 2023/05/22 05:32 by dstillman