Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
88
gaia/tv_apps/browser/build/build.js
Executable file
88
gaia/tv_apps/browser/build/build.js
Executable file
|
|
@ -0,0 +1,88 @@
|
|||
'use strict';
|
||||
|
||||
/* jshint node: true */
|
||||
|
||||
var utils = require('utils');
|
||||
var preprocessor = require('preprocessor');
|
||||
|
||||
var BrowserAppBuilder = function() {
|
||||
};
|
||||
|
||||
BrowserAppBuilder.prototype.setOptions = function(options) {
|
||||
this.stageDir = utils.getFile(options.STAGE_APP_DIR);
|
||||
this.appDir = utils.getFile(options.APP_DIR);
|
||||
this.distDirPath = options.GAIA_DISTRIBUTION_DIR;
|
||||
};
|
||||
|
||||
BrowserAppBuilder.prototype.initJSON = function() {
|
||||
var defaultJSONpath =
|
||||
utils.joinPath(this.appDir.path, 'build', 'default.json');
|
||||
var defaultJson = utils.getJSON(utils.getFile(defaultJSONpath));
|
||||
var file =
|
||||
utils.getFile(this.stageDir.path, 'js', 'init.json');
|
||||
utils.writeContent(file,
|
||||
utils.getDistributionFileContent('browser', defaultJson, this.distDirPath));
|
||||
};
|
||||
|
||||
BrowserAppBuilder.prototype.initTopsitesJSON = function() {
|
||||
var defaultJSONpath =
|
||||
utils.joinPath(this.appDir.path, 'build', 'topsites.json');
|
||||
var defaultJson = utils.getJSON(utils.getFile(defaultJSONpath));
|
||||
|
||||
defaultJson.topSites.forEach(function(site) {
|
||||
if (site.iconPath) {
|
||||
var file = utils.getFile(this.appDir.path, 'build', site.iconPath);
|
||||
var icon = utils.getFileAsDataURI(file);
|
||||
site.iconUri = icon;
|
||||
delete site.iconPath;
|
||||
}
|
||||
}.bind(this));
|
||||
|
||||
var file =
|
||||
utils.getFile(this.stageDir.path, 'js', 'inittopsites.json');
|
||||
utils.writeContent(file,
|
||||
utils.getDistributionFileContent('topsites', defaultJson,
|
||||
this.distDirPath));
|
||||
};
|
||||
|
||||
BrowserAppBuilder.prototype.enableFirefoxSync = function(options) {
|
||||
var fileList = {
|
||||
process: [
|
||||
['index.html'],
|
||||
['js', 'awesomescreen.js'],
|
||||
['js', 'bookmarkStore.js'],
|
||||
['js', 'historyStore.js'],
|
||||
['js', 'browser_dialog.js'],
|
||||
['js', 'index.js'],
|
||||
['js', 'settings.js'],
|
||||
['js', 'toolbar.js'],
|
||||
['style', 'settings.css'],
|
||||
['style', 'browser_dialog.css']
|
||||
],
|
||||
remove: [
|
||||
['js', 'sync', 'bookmarks.js'],
|
||||
['js', 'sync', 'db.js'],
|
||||
['js', 'sync', 'ds_helper.js'],
|
||||
['js', 'sync', 'history.js'],
|
||||
['js', 'sync', 'manager_bridge.js'],
|
||||
['js', 'sync', 'settings.js'],
|
||||
['js', 'sync', 'toolbar.js'],
|
||||
['test', 'unit', 'sync', 'manager_bridge_test.js'],
|
||||
['test', 'unit', 'sync', 'settings_test.js'],
|
||||
['test', 'unit', 'sync', 'toolbar_test.js']
|
||||
]
|
||||
};
|
||||
preprocessor.execute(options, 'FIREFOX_SYNC', fileList);
|
||||
};
|
||||
|
||||
BrowserAppBuilder.prototype.execute = function(options) {
|
||||
this.setOptions(options);
|
||||
this.initJSON();
|
||||
this.initTopsitesJSON();
|
||||
this.enableFirefoxSync(options);
|
||||
};
|
||||
|
||||
exports.execute = function(options) {
|
||||
utils.copyToStage(options);
|
||||
(new BrowserAppBuilder()).execute(options);
|
||||
};
|
||||
Loading…
Reference in a new issue