FtuAppBuilder.prototype.setOptions = function(options) { this.stageDir = utils.getFile(options.STAGE_APP_DIR); this.appDir = utils.getFile(options.APP_DIR); this.webapp = utils.getWebapp(this.appDir.path, options.GAIA_DOMAIN, options.GAIA_SCHEME, options.GAIA_PORT, options.STAGE_DIR); this.gaia = utils.gaia.getInstance(options); this.gaia.stageDir = this.stageDir; this.gaia.gaiaDir = options.GAIA_DIR; };
exports.execute = function(options) { var webapp = utils.getWebapp(options.APP_DIR, options); require(webapp.appDir.leafName + '/build').execute(options, webapp); // Wait for all app tasks to be done before proceeding. utils.processEvents(function () { return { wait: false }; }); require('post-app').execute(options, webapp); };
scanningDirs.forEach(function(appDir) { var buildFile = utils.getFile(appDir, 'build', 'build.js'); var webapp = utils.getWebapp(appDir, options.GAIA_DOMAIN, options.GAIA_SCHEME, options.GAIA_PORT, options.STAGE_DIR) || {}; if ((buildFile.exists() || (utils.isExternalApp(webapp) && !webapp.pckManifest)) && rebuildAppDirs.indexOf(appDir) === -1) { rebuildAppDirs.push(appDir); } });
CommAppBuilder.prototype.setOptions = function(options) { var stageDirPath = [options.GAIA_DIR].concat(this.STAGE_DIR.split('/')); this.stageDir = utils.getFile.apply(utils, stageDirPath); var appDirPath = [options.GAIA_DIR].concat(this.APP_DIR.split('/')); this.appDir = utils.getFile.apply(utils, appDirPath); this.webapp = utils.getWebapp(this.appDir.path, options.GAIA_DOMAIN, options.GAIA_SCHEME, options.GAIA_PORT); this.gaia = utils.getGaia(options); var content = JSON.parse(utils.getFileContent(utils.getFile(this.appDir.path, 'build', 'communications_services.json'))); var custom = utils.getDistributionFileContent('communications_services', content); this.commsServices = JSON.parse(custom); this.official = options.OFFICIAL; };
scanningDirs.forEach(function(appDir) { if (rebuildAppDirs.indexOf(appDir) !== -1 || appDir === sharedPath) { return; } var buildFile = utils.getFile(appDir, 'build', 'build.js'); var webapp = utils.getWebapp(appDir, options); if (!webapp) { // Some leftover folders may still be in source tree, // without any valid app, like apps/browser that has been removed. return; } if (buildFile.exists() || (utils.isExternalApp(webapp) && !webapp.pckManifest) || !utils.fileExists(webapp.profileDirectoryFilePath)) { rebuildAppDirs.push(appDir); } });
CommAppBuilder.prototype.execute = function(options) { this.webapp = utils.getWebapp(options.APP_DIR, options); this.setOptions(options); this.generateAll(); };