scripts/afterPrepareHook.js
function prepareWithCustomBuildOption(ctx, optionName, chcpXmlOptions) {
  if (optionName.length == 0) {
    return false;
  }

  var buildConfig = chcpBuildOptions.getBuildConfigurationByName(ctx, optionName);
  if (buildConfig == null) {
    console.warn('Build configuration for "' + optionName + '" not found in chcp.options. Ignoring it.');
    return false;
  }

  console.log('Using config from chcp.options:');
  console.log(JSON.stringify(buildConfig, null, 2));

  mergeBuildOptions(chcpXmlOptions, buildConfig);

  console.log('Resulting config will contain the following preferences:');
  console.log(JSON.stringify(chcpXmlOptions, null, 2));

  chcpConfigXmlWriter.writeOptions(ctx, chcpXmlOptions);

  return true;
}
function prepareWithCustomBuildOption(ctx, optionName, chcpXmlOptions) {
  if (optionName.length == 0) {
    return false;
  }

  var buildConfig = chcpBuildOptions.getBuildConfigurationByName(ctx, optionName);
  if (buildConfig == null) {
    console.warn('Build configuration for "' + optionName + '" not found in chcp.options. Ignoring it.');
    return false;
  }

  console.log('Using config from chcp.options:');
  console.log(JSON.stringify(buildConfig, null, 2));

  mergeBuildOptions(chcpXmlOptions, buildConfig);

  console.log('Resulting config will contain the following preferences:');
  console.log(JSON.stringify(chcpXmlOptions, null, 2));

  chcpConfigXmlWriter.writeOptions(ctx, chcpXmlOptions);

  return true;
}
function prepareWithCustomBuildOption ( ctx , optionName , chcpXmlOptions ) { if ( optionName . length == 0 ) { return false ; } var buildConfig = chcpBuildOptions . getBuildConfigurationByName ( ctx , optionName ) ; if ( buildConfig == null ) { console . warn ( 'Build configuration for "' + optionName + '" not found in chcp.options. Ignoring it.' ) ; return false ; } console . log ( 'Using config from chcp.options:' ) ; console . log ( JSON . stringify ( buildConfig , null , 2 ) ) ; mergeBuildOptions ( chcpXmlOptions , buildConfig ) ; console . log ( 'Resulting config will contain the following preferences:' ) ; console . log ( JSON . stringify ( chcpXmlOptions , null , 2 ) ) ; chcpConfigXmlWriter . writeOptions ( ctx , chcpXmlOptions ) ; return true ; }
Try to inject build options according to the arguments from the console.

@param {Object} ctx - cordova context object
@param {String} optionName - build option name from console; will be mapped to configuration from chcpbuild.options file
@return {boolean} true - if build option is found and we successfully injected it into config.xml; otherwise - false
Try to inject build options according to the arguments from the console .