0

I want to keep a xcode project sync to a visual studio project. How can I accomplish this?

BTW, how does xcode manage file reference? There is no path information in pbxproj file, only a "magic number" with each filereference.

rechardchen
  • 184
  • 2
  • 9

3 Answers3

0

For your first question, I suspect the only reasonable way is to use a cross platform build tool like make or ANT with separate includes for each target. This might be more easily managed if you then wrap these makefiles with each platform's native tools, Xcode and VS.

Your second question is puzzling, since the pbxproj file does have explicit paths for each file as well as search path sets, see the example below.

492991C11534DE51003993BA /* KeyboardButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = KeyboardButton.m; path = GUI/iPad/Session/Keyboard/KeyboardButton.m; sourceTree = ""; };

Taryn
  • 1,670
  • 1
  • 15
  • 22
0

Adding files to XCode Projects is quite strange. I haven't found out, for example, how XCode calculates it's hash values for the objects dictionary.

But after some analysis I wrote a little tool to add files to a xcode project. It just matches my needs, but can be extended. Feel free to contact me throgh github if you have extended needs to add files, such as to add a build rule for a selected target only, that I hadn't implemented yet, as I assume this feature isn't needed in >99% of the projects.

The XCodeControl Project is a macos XCode Project itself, as it's most easy to read and modify the .pbxproj files, that are simple serializations of a NSDictionary Object. Of course apple has added some salt to its serialization, so the output of XCodeControl looks quite different to what apple produces, but still it simply works.

ikrabbe
  • 1,909
  • 12
  • 25
0

.pbxproj file format

If you're interested in .pbxproj file format, you can check out this http://www.monobjc.net/xcode-project-file-format.html

The hash code is generated by UUID.

You can check out this question project.pbxproj hashing for files - what hash is used and how?

How To Change pbxproj?

1. CocoaPods by Ruby:

There is a Ruby API from Cocoapods for editing Xcode projects. https://github.com/CocoaPods/Xcodeproj

2. Python Tools pbxproj:

If you want to add files to .pbxproj manual, you can try the python tool pbxproj

Install by: sudo pip install pbxproj

More information at https://github.com/kronenthaler/mod-pbxproj/wiki/CLI

Have Fun ~

NSKevin
  • 564
  • 8
  • 20