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
47
gaia/build/contacts-import-services.js
Executable file
47
gaia/build/contacts-import-services.js
Executable file
|
|
@ -0,0 +1,47 @@
|
|||
'use strict';
|
||||
|
||||
/**
|
||||
* This module contains all the build time generation logic needed to
|
||||
* use the import functionality both by the FTU and Comms Applications
|
||||
*
|
||||
* The Functions exported by this module are used by the build scripts
|
||||
* of Comms and FTU apps
|
||||
*/
|
||||
|
||||
const utils = require('./utils');
|
||||
|
||||
// Generates the communications services configuration as JS file
|
||||
// loaded by the application (parameters.js)
|
||||
function generateServicesConfig(config) {
|
||||
var importServicesFile = utils.resolve(config.CONTACTS_IMPORT_SERVICES_PATH,
|
||||
config.GAIA_DIR);
|
||||
|
||||
if (!importServicesFile.exists()) {
|
||||
throw new Error('file not found: ' + importServicesFile.path);
|
||||
}
|
||||
|
||||
var importServices = utils.getJSON(importServicesFile);
|
||||
|
||||
// Bug 883344 Only use default facebook app id if is mozilla partner build
|
||||
if (config.OFFICIAL === '1') {
|
||||
importServices.facebook.applicationId = '395559767228801';
|
||||
importServices.live.applicationId = '00000000440F8B08';
|
||||
}
|
||||
|
||||
var resultFile = utils.resolve(utils.joinPath('shared', 'pages', 'import',
|
||||
'js', 'parameters.js'), config.GAIA_DIR);
|
||||
var jsPrefix = 'var oauthflow = this.oauthflow || {}; oauthflow.params = ';
|
||||
var content = jsPrefix + JSON.stringify(importServices) + ';';
|
||||
|
||||
if (resultFile.exists()) {
|
||||
let prev = utils.getFileContent(resultFile);
|
||||
if (prev === content) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
utils.writeContent(resultFile, content);
|
||||
}
|
||||
|
||||
exports.execute = function(config) {
|
||||
generateServicesConfig(config);
|
||||
};
|
||||
Loading…
Reference in a new issue