commit | d06078f9e727c2006372e2d06b08d228ece8c9cd | [log] [tgz] |
---|---|---|
author | Christopher J. Brody <chris@brody.consulting> | Thu Sep 26 11:01:05 2019 -0400 |
committer | Christopher J. Brody <chris@brody.consulting> | Thu Sep 26 11:01:05 2019 -0400 |
tree | d0eda0af2cb365edc9018788a22f0565cf95478d | |
parent | b81970519188e4bac022f04c86a44f2437c4981e [diff] |
Travis CI now on Linux & macOS ("osx")
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
// API is a bit wonky right now var xcode = require('xcode'), fs = require('fs'), projectPath = 'myproject.xcodeproj/project.pbxproj', myProj = xcode.project(projectPath); // parsing is async, in a different process myProj.parse(function (err) { myProj.addHeaderFile('foo.h'); myProj.addSourceFile('foo.m'); myProj.addFramework('FooKit.framework'); fs.writeFileSync(projectPath, myProj.writeSync()); console.log('new project written'); });
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:
npm run pegjs
(and be sure to restore the Apache license notice in lib/parser/pbxproj.js
before committing)
Apache V2