Confirmed users
138
edits
(Created page with "Since we found build scripts still isn’t easy to modify on bug 964216 and had bug 897352 for copying all apps into build_stage/ directory, we should consider refactoring bui...") |
No edit summary |
||
Line 6: | Line 6: | ||
applications-data.js: | applications-data.js: | ||
[[File:Applications-data-js.png]] | |||
webapp-optmize.js: | |||
[[File:Webapp-optimize-js.png]] | |||
webapp-zip: | |||
[[File:Webapp-zip-js.png]] | |||
and webapp-zip.js handle zip process, l18n files and picking files in shared directory which should use several modules to do it. | |||
== Plan == | |||
Here is a simple version of diagram for our refactoring plan: | |||
[[File:Simple-version.png]] | |||
basically I would like to follow the idea on bug 897352 to copy all files in app into build_stage/ directory, and refactoring all build scripts to process files in build_stage/ instead of in app source directory and extract webapp-shared.js from webapp-zip.js to handle which files need to be picking from shared directory, webapp-zip.js is only used to zip files into profile. | |||
Let’s show all details in below diagram and explain what should them do for each module: | |||
[[File:full-version.png]] | |||
; Copy rule : each app has a copy.mk, if this file doesn’t exist we will use default way to copy files. | |||
; webapp-shared.js : webapp-shared.js is used to pick files which is used in app from shared/ directory, this module will be extracted from webapp-zip.js | |||
; multilocale.js : we load and use this module in webapp-zip.js for now, but it will be extracted to a xpcshell command and will be executed standalone. | |||
; preload-apps.js : fetch preload apps from internet if VARIANT_PATH exists and create directory for each app in build_stage. | |||
; app-makefile : each app should has their own makefile to generate and customize data, details are listed in next section. | |||
; webapp-optimize.js : optimize javascript, l10n files, html here, this module will be modified to optimize in build_stage directory instead of app source directory. | |||
; webapp-zip.js : | |||
we have a lot of features in this modules for now, so we plan to move picking files in shared directory feature to webapp-shared.js and picking l10n files feature to multilocale.js, webapp-zip.js will be only used to compress file into profile directory. | |||
; additional-extension.js, preferences.js & settings.js : nothing change. | |||
; webapps-json.js : extracted from webapp-manifest.js to generate webapps.json into profile directory. | |||
=== app-makefile === | |||
; create run-app-js-command : create & export this macro to execute build script in app | |||
;bluetooth, clock, costcontrol, email, fl, fm, keyboard, music, ringtones, search, setringtone, video : no change for stage 1. | |||
; browser : need migrate some code from applications-data.js & webapp-manifests.js & webapp-optimize.js and it’s modified manifest so we need to build this app in build_stage. | |||
; calendar: migrate some code from applications-data.js | |||
; camera: migrate some code form applications-data.js | |||
; communications : migrate some code from applications-data.js, webapp-manifests.js & webapp-zip.js, we need to build it in build_stage. | |||
; gallery : migrate some code from applications-data.js | |||
; homescreen : migrate a lot of code from applications-data.js, webapp-zip | |||
; settings : migrate some code from applications-data.js | |||
; sms : migrate some code from applications-data.js | |||
; system : migrate some code from applications-data.js, webapp-manifests.js & webapp-zip.js, we need to build it in build_stage | |||
; wallpaper :migrate some code from webapp-zip.js and we need to build it in build_stage | |||
; wappush : migrate some code from applications-data.js | |||
== Stage == | |||
; Stage 1-1: Add |make watch| to watch files change and execute |APP=<app> make|, because we should always get files from build_stage/ for DEBUG=1 httpd.js. | |||
; Stage 1-2: Migrate build script for specific app from applications-data.js to app makefile. | |||
; Stage 1-3: Extract new module webapp-shared.js from webapp-zip.js to copy files which are used in app to a specific directory, this module doesn’t be used in this stage but we need to have integration and unit test for it. | |||
we can do stage 1-1, 2 & 3 in parallel. | |||
Stage 2: | |||
#Added copy rule to copy app into build_stage/ & each app can customize their copy rule (remind email, clock and camera) | |||
#refactoring webapp-optmize.js, webapp-manifest.js to modify source in build_stage/ instead of in app directory. | |||
#use webapp-shared.js to copy files from shared directory | |||
each step of stage 2 has dependency for previous one. |