Development
- Get the Source Code from Subversion
- Installation
- Building Releases: Generating XPI from source (Unix only)
- Building Debug Releases: Generating XPI from source (Unix only)
- Set Up your Environment for Code Development
- Debugging the Client-Server Data-Exchange
- System Requirements for Code Development
1. Get the Source Code from Subversion
Anonymous
svn co http://svn.wyona.com/repos/public/yulup
Username: anonymous, Password: anonymous
Developers
svn co --username USERNAME https://svn.wyona.com/repos/public/yulup
2. Installation
If the source has been checked out from SVN, Yulup can be installed as follows:
Create a file yulup@wyona.com within the extension directory
Linux: /home/USER/.mozilla/firefox/PROFILE/extensions/yulup@wyona.com
MacOS X: /Users/USER/Library/Application Support/Firefox/Profiles/PROFILE/extensions/yulup@wyona.com
Windows 2000, XP: Documents and Settings\USER\Application Data\Mozilla\Firefox\Profiles\PROFILE\extensions\yulup@wyona.com or Programs\Mozilla Firefox\extensions\yulup@wyona.com
Windows NT: WINNT\Profiles\USER\Application Data\Mozilla\Firefox\PROFILE\extensions\yulup@wyona.com
Windows 98, ME: Windows\Application Data\Mozilla\Firefox\PROFILE\extensions\yulup@wyona.com
Open this file and add the path to the Yulup source, e.g. /home/USER/src/yulup/src/trunk/yulup/src (Unix) or C:\src\yulup\src\trunk\yulup\src (Windows)
- Delete compreg.dat and xpti.dat from your profile directory if you change or add typelibs (currently not required)
Restart Firefox
3. Building Releases: Generating XPI from source (Unix only)
Assume a path snippet $CURRENT which currently points to public/yulup/src/trunk/yulup/src.
Edit $CURRENT/install.rdf and bump version number contained in the <em:version> element (XPath: RDF/Description/em:version), set the revision to the current head, and remove -dev.
In directory $CURRENT, issue ant (make sure that Apache Ant is installed).
The new package can then be found in public/website/yulup/download (the update.rdf file in the download directory is modified automatically to include the new release).
Make sure to update the Mozilla Firefox Add-ons page of Yulup for users who have downloaded the XPI from there:
- cp yulup/website/download/yulup-0.2.3-r22739.xpi tmp/.
- cd tmp
- unzip yulup-0.2.3-r22739.xpi
- Remove or comment "updateURL" within install.rdf
- rm yulup-0.2.3-r22739.xpi
- zip -r yulup-0.2.3-r22739.xpi .
- Click on "Developer Login"
- Click on "Edit Item"
- Upload new XPI
- Add ProxyPass entry to www.yulup.org vhost within /usr/local/httpd-2.2.3/conf/extra/httpd-vhosts.conf
4. Building Debug Releases: Generating XPI from source (Unix only)
Assume a path snippet $CURRENT which currently points to public/yulup/src/trunk/yulup/src.
Edit $CURRENT/install.rdf and set the revision to the current head contained in the <em:version> element (XPath: RDF/Description/em:version), and replace -dev by -debug.
In directory $CURRENT, issue ant -Ddebug=true pkg (make sure that Apache Ant is installed).
The new package can then be found in public/yulup/src/trunk/yulup/pkg/.
5. Set Up your Environment for Code Development
Preferences Settings
To make your life easier (and the code better), you first might want to change some of your browser preferences (via "about:config", see this mozillaZine kb entry for details if you are not acquainted to setting preferences manually):
- Set browser.dom.window.dump.enabled to true
-
Enables the use of the dump() statement to print to the standard console. For this output to be seen, you must of course run Firefox/Mozilla/SeaMonkey from a terminal. You can do this by simply running e.g. firefox-bin (in the case of Firefox).
- Set extensions.logging.enabled to true
-
Enables more logging.
- Set javascript.options.showInConsole to true
-
Logs errors in chrome files to the JavaScript Console to make debugging easier.
- Set javascript.options.strict to true
-
Enables strict Javascript warnings in the JavaScript Console. Note that since many people have this setting turned off when developing, you will see lots of warnings for problems with their code in addition to warnings for your own extension.
- Set nglayout.debug.disable_xul_cache to true
-
Disables the XUL cache so that changes do not require a restart, i.e. everytime a XUL document gets reloaded (like editor.xul when reloading the editor tab, but NOT yulup.xul, since this only gets loaded once, namely when the browser is started or a new window is opened), the new version is used and not the old cached one.
Note that some of these settings might not already exist in the preferences list. If you cannot find a setting, you need to create it by context-clicking (right mouse button) anywhere in the preferences list, and then choose "New" in the context menu. "New" itself opens a new sub-menu. Since all settings listed above are of type bool, you can then choose "Boolean". In the dialog which pops up, enter the preference string as shown above.
See also the Setting up extension development environment mozillaZine kb entry. Note though that not all information in that article is up-to-date anymore. In the case of doubt, the information stated here overrides information in that article.
Displaying Debug Messages
In order to see the debug messages on stdout, you have to start Firefox from the console:
- Unix
$ firefox
The log output will go to the terminal from where you started Firefox.
- MacOS X
$ /Applications/Firefox.app/Contents/MacOS/firefox
The log output will go to the terminal from where you started Firefox.
- Windows
> cd Program Files\Mozilla Firefox (or wherever your Firefox installation lives; if in doubt, simply search for firefox.exe)
> firefox.exe -console
Firefox will open a new window called "firefox.exe -console" into which the log output goes. You might want to extend the number of lines it holds by clicking on the system icon (the Firefox logo in the upper left corner of that console window), and choose "Properties". In the opened dialog choose the "Layout" tab, and in the "Screen Buffer Size" group set "width" to 400 and "height" to 9999.
6. Debugging the Client-Server Data Exchange
Download Axis and use TCP Monitor:
$ java -classpath lib/axis.jar org.apache.axis.utils.tcpmon
or ngrep, e.g. to check what DTDs are being retrieved:
$ sudo bash # ngrep -w dtd
or to grep stuff on localhost (127.0.0.1):
# ngrep -d lo
or check for regular expressions on a specific port:
# ngrep "Atom" "port 80"
7. System Requirements for Development
- svn client (for checking out the source code)
- GNU make (for building documentation)
- ant (for building packages and i18n DTD and properties files)
- GNU/BSD toolchain (for building packages)
- xsltproc (for building the user manual and code documentation)
- dia (for building code documentation)
- dia2code (for building code documentation)
- ImageMagick (for building themes)
|