-
Notifications
You must be signed in to change notification settings - Fork 810
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
Optionally make intermediate filler groups #108
Optionally make intermediate filler groups #108
Conversation
let group: PBXGroup | ||
if let cachedGroup = groupsByPath[path] { | ||
group = cachedGroup | ||
if spec.options.mirrorsFileSystem { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once thing that would need to be checked for is the case where you define a source outside of the base path eg. sources: ../directory
. Currently this would probably add every directory until the filesystem root
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch
Could you add documentation to In terms of the fixture, you could add something to the TestProject. You could make a hierarchy of directories and then include one as a source at least one level down to validate this works |
@@ -29,6 +29,7 @@ public struct ProjectSpec { | |||
|
|||
public struct Options { | |||
public var carthageBuildPath: String? | |||
public var mirrorsFileSystem: Bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As XcodeGen already somewhat mirrors the file system, can we call this createIntermediateGroups
or something similar?
e5802c4
to
3bcb212
Compare
@yonaskolb okay made requested changes + added example to fixture |
To fix the tests, re-run |
This commit adds a new option `createIntermediateGroups` that defaults to false. When it is false, the behavior of XcodeGen is the same as before. When it is true, we make intermediate groups recursively until we reach the basePath. In practice that means if you've chosen `Platform/PINFoundation/Sources` as one of your sourcePaths, you get a top-level group of `Platform` and under that `PINFoundation` and under that `Sources`. This is instead of the default behavior of just making `Sources` a top-level group (which is confusing when your directory is called `Sources` for example).
3bcb212
to
e48045d
Compare
Okay rebased + |
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.
This commit adds a new option
mirrorsFileSystem
that defaults tofalse. When it is false, the behavior of XcodeGen is the same as
before. When it is true, we make intermediate groups recursively until
we reach the basePath. In practice that means if you've chosen
Platform/PINFoundation/Sources
as one of your sourcePaths, you get atop-level group of
Platform
and under thatPINFoundation
and underthat
Sources
. This is instead of the default behavior of just makingSources
a top-level group (which is confusing when your directory iscalled
Sources
for example).I think this would probably be a good place to put a fixture, but I wasn't
sure how I should go about adding one. Please advise, thanks!
mirrorsFileSystem: false
(or unset):mirrorsFileSystem: true
: