3
> parser/toolkit for xcodeproj project files
5
Allows you to edit xcodeproject files and write them back out.
9
// API is a bit wonky right now
10
var xcode = require('xcode'),
12
projectPath = 'myproject.xcodeproj/project.pbxproj',
13
myProj = xcode.project(projectPath);
15
// parsing is async, in a different process
16
myProj.parse(function (err) {
17
myProj.addHeaderFile('foo.h');
18
myProj.addSourceFile('foo.m');
19
myProj.addFramework('FooKit.framework');
21
fs.writeFileSync(projectPath, myProj.writeSync());
22
console.log('new project written');
25
## Working on the parser
27
If there's a problem parsing, you will want to edit the grammar under
28
`lib/parser/pbxproj.pegjs`. You can test it online with the PEGjs online thingy
29
at http://pegjs.majda.cz/online - I have had some mixed results though.
31
Tests under the `test/parser` directory will compile the parser from the
32
grammar. Other tests will use the prebuilt parser (`lib/parser/pbxproj.js`).
34
To rebuild the parser js file after editing the grammar, run:
36
./node_modules/.bin/pegjs lib/parser/pbxproj.pegjs
38
(easier if `./node_modules/.bin` is in your path)