Github user vladimir-kotikov commented on a diff in the pull request:
https://github.com/apache/cordova-medic/pull/29#discussion_r24392364
--- Diff: src/build/makers/ios.js ---
@@ -15,63 +15,44 @@ module.exports = function(output,lib_location,test_dir,
sha, devices, entry_poin
function log(msg) {
console.log('[IOS] ' + msg + ' (sha: ' + sha + ')');
}
- if (keychain_location.length === 0 || keychain_password.length === 0) {
- log('No keychain information. Fill that out in config.json if you
want to build for iOS.');
+ log('starting iOS prepare');
+ try {
+ var projectWww = path.join(output, 'www');
+ // add the medic configuration (sha,host) to destination folder
+ var
medic_config='{"sha":"'+sha+'","couchdb":"'+couchdb_cfg.host+'","couchdbext":"'+couchdb_cfg.exthost+'"}';
+ fs.writeFileSync(path.join(output, 'www','autotest','pages',
'medic.json'),medic_config,'utf-8');
+
+ // modify config.xml
+ var configFile = path.join(output, 'mobilespec', 'config.xml');
+ fs.writeFileSync(configFile, fs.readFileSync(configFile,
'utf-8').replace(/<content\s*src=".*"/gi, '<content src="'+entry_point+'"'),
'utf-8');
+ // make sure the couch db server is whitelisted
+ fs.writeFileSync(configFile, fs.readFileSync(configFile,
'utf-8').replace(/<access origin="http:..audio.ibeat.org" *.>/gi,'<access
origin="http://audio.ibeat.org" /><access origin="'+couchdb_cfg.host+'" />',
'utf-8'));
+
+ } catch(e) {
+ error_writer('ios', sha, 'Exception thrown modifying mobile spec
application for iOS.', e.message);
callback(true);
return;
- } else {
- // unlock the chain
- log('setting up keychain');
- var security = shell.exec('security default-keychain -s \'' +
keychain_location + '\' && security unlock-keychain -p \'' + keychain_password
+ '\' \'' + keychain_location+'\'', {silent:true});
- if (security.code > 0) {
- log('keychain setup failed');
- error_writer('ios', sha, 'Could not unlock keychain.',
security.output);
- callback(true);
- } else {
- log('starting iOS prepare');
- try {
- var projectWww = path.join(output, 'www');
- // add the medic configuration (sha,host) to destination folder
- var
medic_config='{"sha":"'+sha+'","couchdb":"'+couchdb_cfg.host+'","couchdbext":"'+couchdb_cfg.exthost+'"}';
- fs.writeFileSync(path.join(output, 'www','autotest','pages',
'medic.json'),medic_config,'utf-8');
+ }
+ // compile
+ log('Compiling.');
+ log(output);
- // modify config.xml
- var configFile = path.join(output, 'mobilespec', 'config.xml');
- fs.writeFileSync(configFile, fs.readFileSync(configFile,
'utf-8').replace(/<content\s*src=".*"/gi, '<content src="'+entry_point+'"'),
'utf-8');
- // make sure the couch db server is whitelisted
- fs.writeFileSync(configFile, fs.readFileSync(configFile,
'utf-8').replace(/<access origin="http:..audio.ibeat.org" *.>/gi,'<access
origin="http://audio.ibeat.org" /><access origin="'+couchdb_cfg.host+'" />',
'utf-8'));
+ var mobileSpecDir = path.join(output, '../', '../');
--- End diff --
Just nitpick: there is no need to add slashes to paths being joined.
`path.join` will handle separators by itself.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]