switch to generating install.rdf, chrome.manifest, and defaults/preferences/prefs.js
authorMyk Melez <myk@mozilla.org>
Tue, 07 Apr 2009 19:11:15 -0700
changeset 661 2e394bb3dd233751942218cf89108ab3e6cc273f
parent 660 7a5ecc8b14696ac2a5c8f13249dfc4aad5c9cdf9
child 662 da33b2e11c9e76fdc7b5daf569a453b62c685846
push id95
push usermyk@mozilla.com
push dateWed, 08 Apr 2009 07:18:46 +0000
switch to generating install.rdf, chrome.manifest, and defaults/preferences/prefs.js
Makefile
VERSION
chrome.manifest
chrome.manifest.in
defaults/preferences/prefs.js
defaults/preferences/prefs.js.in
install.rdf
install.rdf.in
--- a/Makefile
+++ b/Makefile
@@ -34,93 +34,95 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 site_url_base     := https://people.mozilla.com/~myk/snowl
 site_path_local   := website
 site_path_remote  := people.mozilla.com:/home/myk/public_html/snowl
 
-name              := $(shell perl -ane 'print $$1 if /<em:name>(.*)<\/em:name>/' install.rdf)
-version           := $(shell perl -ane 'print $$1 if /<em:version>(.*)<\/em:version>/' install.rdf)
+name              := $(shell perl -ane 'print $$1 if /<em:name>(.*)<\/em:name>/' install.rdf.in)
+version           := $(shell cat VERSION)
 
 date              := $(shell date --utc +%Y%m%d%H%M)
 revision_id       := $(shell hg tip --template '{node|short}')
 
-chrome_path       := jar:chrome.jar!/
-
 # Development Channel
 ifeq ($(channel),dev)
   # Development build updates are managed by the website, so we construct
   # an update URL that points to the update manifest we are going to create.
   update_name     := update-$(channel).rdf
   update_url      := $(site_url_base)/dist/$(update_name)
   update_url_tag  := <em:updateURL>$(update_url)</em:updateURL>
   package_version := $(version)d$(date)
   package_name    := $(name)-$(channel)-$(package_version).xpi
   package_alias   := $(name)-$(channel)-latest.xpi
   package_url     := $(site_url_base)/dist/$(package_name)
+  chrome_path     := jar:chrome.jar!/
 
 # Release Channel
 else ifeq ($(channel),rel)
   # Release build updates are managed by AMO, which provides its own update.
   update_name     := 
   update_url      := 
   update_url_tag  := 
   package_version := $(version)
   package_name    := $(name)-$(version).xpi
   package_url     := 
+  chrome_path     := jar:chrome.jar!/
 
 # No Channel
 else
   # Builds without a channel don't update.
   update_name     := 
   update_url      := 
   update_url_tag  := 
   package_version := 0
   package_name    := $(name).xpi
   package_url     := 
+  chrome_path     :=
 endif
 
+dotin_files := $(shell find . -type f -name \*.in)
+dotin_files := $(dotin_files:.in=)
+
 
-all: package
+all: build
+
+.PHONY: $(dotin_files) substitute build package publish
+
+substitute := perl -p -e 's/@([^@]+)@/defined $$ENV{$$1} ? $$ENV{$$1} : $$&/ge'
+export package_version update_url_tag package_url revision_id chrome_path
 
-.PHONY: package publish subscribe
+$(dotin_files): $(dotin_files:=.in)
+	$(substitute) $@.in > $@
+
+substitute: $(dotin_files)
+
+build: substitute
 
 chrome_files      := content/* locale/* skin/*
 
 chrome.jar: $(chrome_files)
 	zip -ur chrome.jar $(chrome_files)
 
 # FIXME: use a package manifest to determine which files to package.
 package_files     := defaults modules chrome.manifest chrome.jar install.rdf
 
-substitute := perl -p -e 's/@([^@]+)@/defined $$ENV{$$1} ? $$ENV{$$1} : $$&/ge'
-export package_version update_url_tag package_url revision_id chrome_path
-
-package: $(package_files) chrome.jar
-	mv install.rdf .\#install.rdf.bak
-	mv chrome.manifest .\#chrome.manifest.bak
-	mv defaults/preferences/prefs.js .\#prefs.js.bak
-	$(substitute) install.rdf.in > install.rdf
-	$(substitute) chrome.manifest.in > chrome.manifest
-	$(substitute) defaults/preferences/prefs.js.in > defaults/preferences/prefs.js
+package: build chrome.jar $(package_files)
 	zip -ur $(package_name) $(package_files) -x \*.in
-	mv .\#install.rdf.bak install.rdf
-	mv .\#chrome.manifest.bak chrome.manifest
-	mv .\#prefs.js.bak defaults/preferences/prefs.js
 ifneq ($(package_url),)
-	$(substitute) update.rdf.in > $(site_path_local)/dist/$(update_name)
 	mv $(package_name) $(site_path_local)/dist/
 	ln -s -f $(package_name) $(site_path_local)/dist/$(package_alias)
+	mv update.rdf $(site_path_local)/dist/$(update_name)
 endif
 
 publish:
 	rsync -av $(site_path_local)/ $(site_path_remote)/
 
 help:
 	@echo 'Targets:'
+	@echo '  build:     build the extension'
 	@echo '  package:   build a XPI'
-	@echo '  publish:   push files to the website'
-	@echo '  clean'
+	@echo '  publish:   push distribution files to the website'
 	@echo
 	@echo 'Variables:'
 	@echo '  channel: "rel", "dev", or blank'
new file mode 100644
--- /dev/null
+++ b/VERSION
@@ -0,0 +1,1 @@
+0.3pre1
deleted file mode 100644
--- a/chrome.manifest
+++ /dev/null
@@ -1,62 +0,0 @@
-# IMPORTANT: When changing this file, make sure to keep changes in sync with chrome.manifest.in.
-
-# Generic browser chrome integration points: an icon in the status bar,
-# a menu in the Tools menu, View > Sidebar entries, etc.
-overlay chrome://browser/content/browser.xul chrome://snowl/content/browser.xul
-
-# The parts of the list view that are part of the browser chrome rather than
-# the list view sidebar.
-overlay chrome://browser/content/browser.xul chrome://snowl/content/list.xul
-
-# For Customize to display our buttons correctly.
-style chrome://global/content/customizeToolbar.xul chrome://snowl/content/browser.css
-
-# For our About dialog.
-overlay chrome://mozapps/content/extensions/about.xul chrome://snowl/content/about.xul
-
-# For customizing Places bookmarks dialog.
-overlay chrome://browser/content/places/bookmarkProperties.xul chrome://snowl/content/bookmarkProperties.xul
-
-# Note: we overlay the river view via xul-overlay processing instructions
-# because chrome.manifest instructions require exact URLs, and the river view's
-# URL varies because of query params in response to user searches.
-
-# Add the collections view to the list view sidebar.
-overlay chrome://snowl/content/list-sidebar.xul chrome://snowl/content/collections.xul
-
-# Add the interface for writing messages to the stream view.
-overlay chrome://snowl/content/stream.xul chrome://snowl/content/write.xul
-
-# Add preferences to the main Options dialog.
-overlay chrome://browser/content/preferences/preferences.xul chrome://snowl/content/preferences.xul
-
-# Register a resource: protocol alias so we can refer to extension modules
-# via resource://snowl/modules/[module name] URLs.
-resource snowl ./
-
-# Register the content directory, which contains the chrome of the extension.
-# Note: chrome in this case includes cross-OS style (skin).  OS-specific style
-# should go into OS-specific subdirectories of the skin directory, as defined
-# below.
-content snowl   content/
-
-# Register separate skins for each primary platform so we can fit personas
-# into each one's very different skin.
-skin    snowl   classic/1.0   skin/luna/      os=WINNT    osversion<6
-skin    snowl   classic/1.0   skin/aero/      os=WINNT    osversion>=6
-skin    snowl   classic/1.0   skin/mac/       os=Darwin
-skin    snowl   classic/1.0   skin/linux/     os=Linux
-
-# localizations in alphabetical order
-locale  snowl   ca-AD   locale/ca-AD/
-locale  snowl   cs-CZ   locale/cs-CZ/
-locale  snowl   da-DK   locale/da-DK/
-locale  snowl   de-DE   locale/de-DE/
-locale  snowl   en-US   locale/en-US/
-locale  snowl   es-ES   locale/es-ES/
-locale  snowl   fr-FR   locale/fr-FR/
-locale  snowl   ja-JP   locale/ja-JP/
-locale  snowl   nl-NL   locale/nl-NL/
-locale  snowl   pl-PL   locale/pl-PL/
-locale  snowl   pt-BR   locale/pt-BR/
-locale  snowl   zh-CN   locale/zh-CN/
new file mode 100644
--- /dev/null
+++ b/chrome.manifest.in
@@ -0,0 +1,60 @@
+# Generic browser chrome integration points: an icon in the status bar,
+# a menu in the Tools menu, View > Sidebar entries, etc.
+overlay chrome://browser/content/browser.xul chrome://snowl/content/browser.xul
+
+# The parts of the list view that are part of the browser chrome rather than
+# the list view sidebar.
+overlay chrome://browser/content/browser.xul chrome://snowl/content/list.xul
+
+# For Customize to display our buttons correctly.
+style chrome://global/content/customizeToolbar.xul chrome://snowl/content/browser.css
+
+# For our About dialog.
+overlay chrome://mozapps/content/extensions/about.xul chrome://snowl/content/about.xul
+
+# For customizing Places bookmarks dialog.
+overlay chrome://browser/content/places/bookmarkProperties.xul chrome://snowl/content/bookmarkProperties.xul
+
+# Note: we overlay the river view via xul-overlay processing instructions
+# because chrome.manifest instructions require exact URLs, and the river view's
+# URL varies because of query params in response to user searches.
+
+# Add the collections view to the list view sidebar.
+overlay chrome://snowl/content/list-sidebar.xul chrome://snowl/content/collections.xul
+
+# Add the interface for writing messages to the stream view.
+overlay chrome://snowl/content/stream.xul chrome://snowl/content/write.xul
+
+# Add preferences to the main Options dialog.
+overlay chrome://browser/content/preferences/preferences.xul chrome://snowl/content/preferences.xul
+
+# Register a resource: protocol alias so we can refer to extension modules
+# via resource://snowl/modules/[module name] URLs.
+resource snowl ./
+
+# Register the content directory, which contains the chrome of the extension.
+# Note: chrome in this case includes cross-OS style (skin).  OS-specific style
+# should go into OS-specific subdirectories of the skin directory, as defined
+# below.
+content snowl   @chrome_path@content/
+
+# Register separate skins for each primary platform so we can fit personas
+# into each one's very different skin.
+skin    snowl   classic/1.0   @chrome_path@skin/luna/   os=WINNT    osversion<6
+skin    snowl   classic/1.0   @chrome_path@skin/aero/   os=WINNT    osversion>=6
+skin    snowl   classic/1.0   @chrome_path@skin/mac/    os=Darwin
+skin    snowl   classic/1.0   @chrome_path@skin/linux/  os=Linux
+
+# localizations in alphabetical order
+locale  snowl   ca-AD   @chrome_path@locale/ca-AD/
+locale  snowl   cs-CZ   @chrome_path@locale/cs-CZ/
+locale  snowl   da-DK   @chrome_path@locale/da-DK/
+locale  snowl   de-DE   @chrome_path@locale/de-DE/
+locale  snowl   en-US   @chrome_path@locale/en-US/
+locale  snowl   es-ES   @chrome_path@locale/es-ES/
+locale  snowl   fr-FR   @chrome_path@locale/fr-FR/
+locale  snowl   ja-JP   @chrome_path@locale/ja-JP/
+locale  snowl   nl-NL   @chrome_path@locale/nl-NL/
+locale  snowl   pl-PL   @chrome_path@locale/pl-PL/
+locale  snowl   pt-BR   @chrome_path@locale/pt-BR/
+locale  snowl   zh-CN   @chrome_path@locale/zh-CN/
deleted file mode 100644
--- a/defaults/preferences/prefs.js
+++ /dev/null
@@ -1,12 +0,0 @@
-// IMPORTANT: When changing this file, make sure to keep changes in sync with prefs.js.in.
-
-// About box description, so it's localizable
-pref("extensions.snowl@mozilla.org.description", "chrome://snowl/locale/about.properties");
-
-// Header view pref: 0 = none, 1 = brief, 2 = full
-pref("extensions.snowl.message.headerView", 1);
-
-pref("extensions.snowl.log.logger.root.level",        "All");
-pref("extensions.snowl.log.appender.console.level",   "Warn");
-pref("extensions.snowl.log.appender.dump.level",      "Debug");
-pref("extensions.snowl.log.appender.file.level",      "Debug");
--- a/defaults/preferences/prefs.js.in
+++ b/defaults/preferences/prefs.js.in
@@ -1,10 +1,8 @@
-// IMPORTANT: When changing this file, make sure to keep changes in sync with prefs.js.
-
 // About box description, so it's localizable
 pref("extensions.snowl@mozilla.org.description", "chrome://snowl/locale/about.properties");
 
 // Header view pref: 0 = none, 1 = brief, 2 = full
 pref("extensions.snowl.message.headerView", 1);
 
 pref("extensions.snowl.log.logger.root.level",        "All");
 pref("extensions.snowl.log.appender.console.level",   "Warn");
deleted file mode 100644
--- a/install.rdf
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0"?>
-<!-- IMPORTANT: When changing this file, make sure to keep changes in sync with install.rdf.in. -->
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>snowl@mozilla.org</em:id>
-    <em:name>Snowl</em:name>
-    <em:version>0.3pre1</em:version>
-    <em:description>conversations redelivered</em:description>
-    <em:creator>Myk Melez</em:creator>
-    <em:developer>alta88</em:developer>
-    <em:developer>Atul Varma</em:developer>
-    <em:homepageURL>http://labs.mozilla.com/projects/snowl/</em:homepageURL>
-    <em:optionsURL>chrome://snowl/content/preferences.xul</em:optionsURL>
-    <!-- <em:aboutURL>chrome://snowl/content/about.xul</em:aboutURL> -->
-    <em:aboutURL/>
-    <em:iconURL>chrome://snowl/content/icons/snowl-40.jpg</em:iconURL>
-
-    <em:targetApplication> <!-- Firefox -->
-      <Description>
-        <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
-        <em:minVersion>3.0</em:minVersion>
-        <em:maxVersion>3.5b4pre</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-  </Description>
-
-</RDF>
--- a/install.rdf.in
+++ b/install.rdf.in
@@ -1,10 +1,9 @@
 <?xml version="1.0"?>
-<!-- IMPORTANT: When changing this file, make sure to keep changes in sync with install.rdf. -->
 
 <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
      xmlns:em="http://www.mozilla.org/2004/em-rdf#">
 
   <Description about="urn:mozilla:install-manifest">
     <em:id>snowl@mozilla.org</em:id>
     <em:name>Snowl</em:name>
     <em:version>@package_version@</em:version>