VulpesOS/gaia/apps/communications/build/build.js
OverSu b38dea0597 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.
2026-09-30 23:13:03 +02:00

42 lines
1.2 KiB
JavaScript
Executable file

'use strict';
/* jshint node: true */
var utils = require('utils');
var importBuild = require('import-config.js');
var DEBUG = false;
var CommAppBuilder = function() {
};
// Set destination directory and application directory
CommAppBuilder.prototype.setOptions = function(options) {
this.stageDir = utils.getFile(options.STAGE_APP_DIR);
this.appDir = utils.getFile(options.APP_DIR);
this.gaia = utils.gaia.getInstance(options);
this.gaia.stageDir = this.stageDir;
this.gaia.gaiaDir = options.GAIA_DIR;
this.webapp = options.webapp;
};
CommAppBuilder.prototype.generateManifest = function() {
var manifestObject = importBuild.generateManifest(this.webapp, this.gaia);
var file = utils.getFile(this.stageDir.path, 'manifest.webapp');
var args = DEBUG ? [manifestObject, undefined, 2] : [manifestObject];
utils.writeContent(file, JSON.stringify.apply(JSON, args));
};
CommAppBuilder.prototype.generateAll = function() {
this.generateManifest();
importBuild.generateConfig('communications', 'contacts', this.gaia);
};
CommAppBuilder.prototype.execute = function(options) {
this.setOptions(options);
this.generateAll();
};
exports.execute = function(options) {
utils.copyToStage(options);
(new CommAppBuilder()).execute(options);
};