How to use the cordova-lib.configparser function in cordova-lib

To help you get started, we’ve selected a few cordova-lib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hybridgroup / commander / hooks / after_prepare / icons_and_splash.js View on Github external
(function() {
  'use strict';

  var cordova_util = require('cordova-lib/src/cordova/util');
  var projectRoot = cordova_util.isCordova(process.cwd());
  var projectXml = cordova_util.projectConfig(projectRoot + '/www');
  var projectPlatforms = cordova_util.listPlatforms(projectRoot);
  var CordovaConfigParser,
    projectConfig;

  if ( typeof cordova_util.config_parser === 'undefined' ) {
    CordovaConfigParser = require('cordova-lib').configparser;
    projectConfig = new CordovaConfigParser(projectXml);
  } else {
    projectConfig = new cordova_util.config_parser(projectXml);
  }

  var fs = require ('fs');
  var path = require('path');

  var platformDir = {
    ios: {
      icon: '{$projectName}/Resources/icons',
      splash: '{$projectName}/Resources/splash',
      platformsDir: 'ios',
      nameMap: {

        // iOS >= 7 Settings icon