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

Support CompilerFlags in Sources #121

Merged
merged 1 commit into from
Nov 3, 2017

Conversation

bkase
Copy link
Collaborator

@bkase bkase commented Nov 2, 2017

Added support for compilerFlags in source list. If any source file
metadata (like compilerFlags) is attached to a directory the metadata
propagates downwards to all children recursively until the files are
reached.

Since there is an extra bit of metadata we need to carry around during
production of PBXObjects, we can no longer pass a Path directly.
Source needs path to be String because we don't know the
basePath until the spec is fully loaded. When we do have the basePath
we can compute the real Path and start to use PathKit APIs.

I attempted a first pass where I just used the Source everywhere and
forwarded along a basePath at all operations that needed it, but that
was too messy, so I ended up making another struct that enriched the
source with the basePath (called EnrichedSource). I don't love the
name, let me know if you come up with a better one.

Fixtures and unit tests are updated as well.

@bkase bkase force-pushed the support-compiler-flags branch from 029c2c0 to ef720ee Compare November 2, 2017 04:07
@yonaskolb
Copy link
Owner

Instead of creating EnrichedSource or passing through the basePath everywhere, could we just read the spec.basePath wherever it's needed?

@bkase bkase force-pushed the support-compiler-flags branch from ef720ee to 8c1e046 Compare November 2, 2017 19:57
@bkase
Copy link
Collaborator Author

bkase commented Nov 2, 2017

Tests will fail for now, but will pass when #108 lands (after a rebase)

@bkase bkase force-pushed the support-compiler-flags branch from 8c1e046 to ae8ff93 Compare November 2, 2017 20:21
Added support for compilerFlags in source list. If any source file
metadata (like compilerFlags) is attached to a directory the metadata
propagates downwards to all children recursively until the files are
reached.

Files are now processed in the same way as directories in `getSources`
this depends on yonaskolb#108 to not over-eagerly cache groups. The `source` is
propagated as metadata down all the way (thanks @yonaskolb)

Fixtures and unit tests are updated as well.
@bkase bkase force-pushed the support-compiler-flags branch from ae8ff93 to 6b17b76 Compare November 2, 2017 20:47
@yonaskolb yonaskolb merged commit b166634 into yonaskolb:master Nov 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants