Skip to content

Commit

Permalink
Merge pull request #3 from cscott/build-fixes
Browse files Browse the repository at this point in the history
Build fixes
  • Loading branch information
mfinkle committed Sep 10, 2012
2 parents fc713d6 + 3b64241 commit a45ea7c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
15 changes: 5 additions & 10 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ const Cu = Components.utils;
Cu.import("resource://gre/modules/Services.jsm");

function isNativeUI() {
let appInfo = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo);
return (appInfo.ID == "{aa3c5121-dab2-40e2-81ca-7ea25febc110}");
return (Services.appinfo.ID == "{aa3c5121-dab2-40e2-81ca-7ea25febc110}");
}

function showToast(aWindow) {
Expand Down Expand Up @@ -83,17 +82,15 @@ var windowListener = {
};

function startup(aData, aReason) {
let wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);

// Load into any existing windows
let windows = wm.getEnumerator("navigator:browser");
let windows = Services.wm.getEnumerator("navigator:browser");
while (windows.hasMoreElements()) {
let domWindow = windows.getNext().QueryInterface(Ci.nsIDOMWindow);
loadIntoWindow(domWindow);
}

// Load into any new windows
wm.addListener(windowListener);
Services.wm.addListener(windowListener);
}

function shutdown(aData, aReason) {
Expand All @@ -102,13 +99,11 @@ function shutdown(aData, aReason) {
if (aReason == APP_SHUTDOWN)
return;

let wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);

// Stop listening for new windows
wm.removeListener(windowListener);
Services.wm.removeListener(windowListener);

// Unload from any existing windows
let windows = wm.getEnumerator("navigator:browser");
let windows = Services.wm.getEnumerator("navigator:browser");
while (windows.hasMoreElements()) {
let domWindow = windows.getNext().QueryInterface(Ci.nsIDOMWindow);
unloadFromWindow(domWindow);
Expand Down
6 changes: 4 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,13 @@ mkdir --parents --verbose $TMP_DIR/chrome
# generate the JAR file, excluding CVS, SVN, and temporary files
JAR_FILE=$TMP_DIR/chrome/$APP_NAME.jar
echo "Generating $JAR_FILE..."
rm -f files ; touch files
for CHROME_SUBDIR in $CHROME_PROVIDERS; do
find $CHROME_SUBDIR \( -path '*CVS*' -o -path '*.svn*' \) -prune -o -type f -print | grep -v \~ >> files
done

zip -0 -r $JAR_FILE -@ < files
echo $JAR_FILE > files
# The following statement should be used instead if you don't wish to use the JAR file
#cp --verbose --parents `cat files` $TMP_DIR/chrome

Expand All @@ -88,8 +90,8 @@ done

# Copy other files to the root of future XPI.
for ROOT_FILE in $ROOT_FILES install.rdf chrome.manifest; do
cp --verbose $ROOT_FILE $TMP_DIR
if [ -f $ROOT_FILE ]; then
cp --verbose $ROOT_FILE $TMP_DIR
echo $ROOT_FILE >> files
fi
done
Expand Down Expand Up @@ -130,7 +132,7 @@ echo "Done!"
$AFTER_BUILD

if [ $PUSH_TO_DEVICE = 1 ]; then
adb push ../$APP_NAME.xpi /sdcard/$APP_NAME.xpi
adb push ./$APP_NAME.xpi /sdcard/$APP_NAME.xpi
adb shell am start -a android.intent.action.VIEW \
-c android.intent.category.DEFAULT \
-d file:///mnt/sdcard/$APP_NAME.xpi \
Expand Down
2 changes: 1 addition & 1 deletion install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<Description>
<em:id>{aa3c5121-dab2-40e2-81ca-7ea25febc110}</em:id>
<em:minVersion>14.0</em:minVersion>
<em:maxVersion>16.*</em:maxVersion>
<em:maxVersion>18.*</em:maxVersion>
</Description>
</em:targetApplication>

Expand Down

0 comments on commit a45ea7c

Please sign in to comment.