-
Archives
- February 2010
- October 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- November 2007
- October 2007
- September 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005
- September 2005
- August 2005
- July 2005
- June 2005
- May 2005
- April 2005
- March 2005
- February 2005
- January 2005
- December 2004
- November 2004
- October 2004
- September 2004
- August 2004
- July 2004
- June 2004
- May 2004
- April 2004
- March 2004
- February 2004
-
Meta
Daily Archives: March 3, 2005
A Simple Firefox Extension Build Script
I’ve been working on building some extensions for Firefox, including my prawn doohickey and, starting today, something for work. When you build an extension, you have to follow a given directory hierarchy that’s pretty well documented here. You also have to zip up a couple of sets of files and rename them appropriately, move them around, etc. I’ve got a code directory set up that’s forked into a “src” (source) and an “xpi” (the file extension given to completed Firefox extensions) directory. I change files in the src directory and then build the xpi file and save it in the xpi directory. Initially, this was a pain because you have to edit the files, zip some of them, move some of them, zip something else, etc. And every time you make changes to an extension, you have to do this routine. After about three iterations of it, I wrote a quick little shell script that does the build for me. I just execute “./build” from the command line and it assembles the xpi for me. Here’s the build script:
#!/bin/sh
echo “- Removing old r2.jar.”
rm chrome/r2.jarecho “- Zipping new r2.jar from content.”
zip -r r2.jar content skin locale
mv r2.jar chrome/echo “- Creating xpi.”
zip -r r2.xpi install.rdf chrome/echo “- Moving xpi to output directory.”
mv r2.xpi ../../xpi/
If I weren’t lazy, I’d make this portable so that I didn’t have to change the script for each extension, but for now, I can just do a regular expression and, in this case, replace “r2″ throughout the script with whatever the directory name for the current script is. I think you can actually use ant and an xml config file to build extensions, and for more complicated extensions, that might be in order. This seems to fit the bill pretty well for small ones, though.
The script assumes that the current directory contains an install.rdf file, a directory named “chrome,” and directories named “content,” “skin,” and “locale.” It zips the latter three directories into a file named (in this case) r2.jar, shoves that jar file into the “chrome” directory, and then creates a zip of install.rdf and “chrome” with the xpi extension. It copies this up into the xpi directory from which I open xpis to install them. Continue reading
Early to Rise
Wake up, look at clock, see that it’s 6:00. Get out of bed, pour big bowl of Honey Bunches of Oats with Almonds and start slowly munching it even though you’re not feeling the usual morning hungriness. Start reading email, check an ebay purchase you sort of inadvertently made and didn’t think you’d actually win but that it appears you may win after all. Note that the auction isn’t as close to being finished as you had thought it should be. Look at clock on computer screen and see that it is in fact just a little after 2:00. Find yourself puzzled. No wonder you’re not hungry. No wonder you’re still so frigging tired. Regretfully finish your bowl of cereal. Shuffle back into the bedroom. Sure enough, it’s just after 2:00 there as well. It was no clock malfunction. Climb back into bed.
Wake up, look at clock, see that it’s 6:00. Get out of bed, sort of hungry now. Still so frigging tired. It’s gonna be a long day. Continue reading