Browse files

move Gaia profile to top-level dir to reduce filesystem path length p…

…er Windows length limitations
  • Loading branch information...
1 parent 798678a commit 16533d9e326955f392e1a391e46d9e6d8c9df527 @mykmelez mykmelez committed Nov 13, 2012
Showing with 18 additions and 11 deletions.
  1. +2 −2 .gitignore
  2. +9 −5 Makefile
  3. +7 −4 addon/lib/main.js
View
4 .gitignore
@@ -1,5 +1,5 @@
-# generated Gaia profile
-addon/data/profile
+# generated Gaia profile and other files the Add-on SDK needs to be in that dir
+addon/template
# platform-specific directories containing B2G Desktop binaries
addon/data/win32
View
14 Makefile
@@ -23,21 +23,25 @@ profile:
make -C gaia
$(DISABLE_OOP)
rm -rf gaia/profile/startupCache
- rm -rf addon/data/profile && mv gaia/profile addon/data/profile
+ rm -rf addon/template
+ mkdir -p addon/template
+ mv gaia/profile addon/template/
+ cp addon-sdk/python-lib/cuddlefish/app-extension/bootstrap.js addon/template/
+ cp addon-sdk/python-lib/cuddlefish/app-extension/install.rdf addon/template/
prosthesis: profile
- mkdir -p addon/data/profile/extensions
+ mkdir -p addon/template/profile/extensions
cd prosthesis && zip -r b2g-prosthesis\@mozilla.org.xpi content defaults locale skin chrome.manifest install.rdf
- mv prosthesis/b2g-prosthesis@mozilla.org.xpi addon/data/profile/extensions
+ mv prosthesis/b2g-prosthesis@mozilla.org.xpi addon/template/profile/extensions
b2g:
python ./build.py $(PLATFORM_ARG)
run:
- cd addon-sdk && . bin/activate && cd ../addon && cfx run
+ cd addon-sdk && . bin/activate && cd ../addon && cfx run --templatedir template/
package:
- cd addon-sdk && . bin/activate && cd ../addon && cfx xpi
+ cd addon-sdk && . bin/activate && cd ../addon && cfx xpi --templatedir template/
help:
@echo 'Targets:'
View
11 addon/lib/main.js
@@ -17,6 +17,9 @@ const SStorage = require("simple-storage");
const WindowUtils = require("api-utils/window-utils");
const Gcli = require('gcli');
+const { rootURI } = require('@loader/options');
+const profileURL = rootURI + "profile/";
+
require("addon-page");
let simulator = {
@@ -128,7 +131,7 @@ let simulator = {
updateApp: function(id, manual) {
console.log("Simulator.updateApp " + id);
- let webappsDir = URL.toFilename(Self.data.url("profile/webapps"));
+ let webappsDir = URL.toFilename(profileURL + "webapps");
let webappsFile = File.join(webappsDir, "webapps.json");
let webapps = JSON.parse(File.read(webappsFile));
@@ -274,7 +277,7 @@ let simulator = {
delete apps[id];
simulator.apps = apps;
- let webappsDir = URL.toFilename(Self.data.url("profile/webapps"));
+ let webappsDir = URL.toFilename(profileURL + "webapps");
let webappsFile = File.join(webappsDir, "webapps.json");
let webapps = JSON.parse(File.read(webappsFile));
@@ -725,7 +728,7 @@ function run() {
let args = [];
- let profile = URL.toFilename(Self.data.url("profile"));
+ let profile = URL.toFilename(profileURL);
args.push("-profile", profile);
if (simulator.jsConsoleEnabled) {
@@ -875,7 +878,7 @@ Gcli.addCommand({
/*
function create() {
- let webappsDir = URL.toFilename(Self.data.url("profile/webapps"));
+ let webappsDir = URL.toFilename(profileURL + "webapps");
let webappsFile = File.join(webappsDir, "webapps.json");
let webapps = JSON.parse(File.read(webappsFile));

0 comments on commit 16533d9

Please sign in to comment.