Old-style plist linter

714 views Asked by At

I am writing an application that generates .xcodeproj files. It's generated a .pbxproj file, however when opening it in Xcode, I get an error message, "cannot be opened because the project file cannot be parsed." and nothing more.

Is there a reliable application for syntax parsing old-style plists?

If it requires me to use low-level Cocoa APIs, I'm fine with that, but some pointers at least?

1

There are 1 answers

0
Evan Cordell On BEST ANSWER

You should take a look at Xcodeproj.

It's not a linter, but it may help you to understand why your project isn't being opened correctly.

You have a few options:

  • Try to parse your project with Xcodeproj to see if it gives you more useful errors.
  • You don't mention what language you're writing in, but if it's ruby, you could simply use the gem directly.
  • See if you can call the CF calls directly. You'll note that the part of Xcodeproj that actually writes to the file calls this c extension which simply uses CFPropertyListWriteToStream.

This all assumes that your problem is one that could actually be solved by a linter. If your formatting is correct but you're writing values that somehow confuse Xcode then these suggestions may not apply, although I do think reading through the Xcodeproj source would help you.