项目作者: apache

项目描述 :
Apache cordova
高级语言: JavaScript
项目地址: git://github.com/apache/cordova-node-xcode.git
创建时间: 2017-04-08T07:00:06Z
项目社区:https://github.com/apache/cordova-node-xcode

开源协议:Apache License 2.0

下载


cordova-node-xcode

NPM

Node CI

Parser utility for xcodeproj project files

Allows you to edit xcodeproject files and write them back out.

based on donated code from alunny / node-xcode

Example

  1. // API is a bit wonky right now
  2. var xcode = require('xcode'),
  3. fs = require('fs'),
  4. projectPath = 'myproject.xcodeproj/project.pbxproj',
  5. myProj = xcode.project(projectPath);
  6. // parsing is async, in a different process
  7. myProj.parse(function (err) {
  8. myProj.addHeaderFile('foo.h');
  9. myProj.addSourceFile('foo.m');
  10. myProj.addFramework('FooKit.framework');
  11. fs.writeFileSync(projectPath, myProj.writeSync());
  12. console.log('new project written');
  13. });

Working on the parser

If there’s a problem parsing, you will want to edit the grammar under
lib/parser/pbxproj.pegjs. You can test it online with the PEGjs online thingy
at https://pegjs.org/online - I have had some mixed results though.

Tests under the test/parser directory will compile the parser from the
grammar. Other tests will use the prebuilt parser (lib/parser/pbxproj.js).

To rebuild the parser js file after editing the grammar, run:

  1. npm run pegjs

(and be sure to restore the Apache license notice in
lib/parser/pbxproj.js before committing)

License

Apache V2