-
Notifications
You must be signed in to change notification settings - Fork 823
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
Add TargetSource.buildPhase for overriding build phase #206
Conversation
8aa5029
to
cf6df04
Compare
- file.apns | ||
- file.123 | ||
- file.xcassets | ||
- Info.plist |
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.
What happens if it's MyApp_Info.plist
instead of Info.plist
?
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.
It’s treated as a resource. Would be a good test case as well 👍
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.
I was about to comment the same. I wouldn't assume that Info.plist
is the name of the target info.plist file. Is it feasible to get a list of all the info.plists defined in the yaml and us that to filter these .plist out from the resources?
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.
Yeah it's a tricky problem. I think it's fair to say that if we find a Info.plist
, it's being used for that purpose. But yes, some projects may also have other names. It would be possible to check all the build settings for any INFOPLIST_FILE
settings, and then ignore those. I've created a seperate issue for this #207
|
||
public enum SourceType: String { | ||
case group | ||
case file | ||
case folder | ||
} | ||
|
||
public init(path: String, name: String? = nil, compilerFlags: [String] = [], excludes: [String] = [], type: SourceType? = nil, optional: Bool = false) { | ||
public init(path: String, name: String? = nil, compilerFlags: [String] = [], excludes: [String] = [], type: SourceType? = nil, optional: Bool = false, buildPhase: BuildPhase? = nil) { |
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.
I think @toshi0383 mentioned something in another PR but what do you think about splitting this into multiple lines to make it easier to read. Out of curiosity, is there any linter being passed on CI in every PR? That could help keeping method names short.
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.
At the moment no linter is run on CI. There's a format_code
make task though that I occasionally run. This is yet to be automated. Along with the automation, rules for line wrapping can be added 👍
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.
Just a minor code-style-related comment 👏
This lets you override the build phase for a source file or all the files in a directory.
This is useful if XcodeGen makes the wrong guesses based off the file extension.
I think we have a pretty stable list of files right now, but this gives us more flexibility. Especially as we are treating all unknown file types as resources by default, which may not be the desired behaviour.