Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialize ProjectSpec to JSON #123

Closed
jerrymarino opened this issue Nov 2, 2017 · 2 comments · Fixed by #545
Closed

Serialize ProjectSpec to JSON #123

jerrymarino opened this issue Nov 2, 2017 · 2 comments · Fixed by #545
Labels

Comments

@jerrymarino
Copy link
Contributor

Good afternoon!

Thanks so much for creating XcodeGen, the project is great.

I'd like to use the ProjectSpec and children as a protocol to write out a JSON file. My custom generator would be allocating data structures in ProjectSpec directly

Without being able to write the ProjectSpec and dependencies to JSON, I need to implement my own version of the spec ( currently on Swift 4 codeable ).

Is this something Xcode gen would support?

@yonaskolb
Copy link
Owner

Thanks @jerrymarino!
Getting the ProjectSpec to support Codable is possible, but slightly tricky due to the quite dynamic nature of the scheme. Codable in it's default state is quite strict in how things should be represented. It's something I want to add though. Feel free to open a PR for it 👍

Could you explain your usecase a bit more? You would be creating the ProjectSpec in Swift and then generating JSON form that to be used in your own project generator?

@jerrymarino
Copy link
Contributor Author

@yonaskolb awesome! I was looking at Spec JSON coding implementation this morning, and can see that this would be quite an undertaking. I think it is a better direction than writing and maintaining my own ( dumbed down ) version of it. In a way, this spec is the public API of XcodeGen, so having the data structures writing to a JSON file, would be super useful.

I'm taking iOS build configurations and writing an Xcode project that builds an iOS per that configuration. The program uses XcodeGen to achieve part of the process - XcodeGen reads in a JSON rep of the spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants