Skip to content

Fix creating optional file#547

Closed
KyoheiG3 wants to merge 1 commit into
yonaskolb:masterfrom
KyoheiG3:fix-optional-file
Closed

Fix creating optional file#547
KyoheiG3 wants to merge 1 commit into
yonaskolb:masterfrom
KyoheiG3:fix-optional-file

Conversation

@KyoheiG3

Copy link
Copy Markdown

Fixes #546.

@yonaskolb

Copy link
Copy Markdown
Owner

Hi @KyoheiG3. I'm not sure what this fixes?

case .group:
if targetSource.optional {
// Is optional so if it doesn't exist just return an empty array
return []

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't checking if a directory exists, so it would always return nothing

@ra1028

ra1028 commented Mar 28, 2019

Copy link
Copy Markdown

Hi @yonaskolb

This pull request is my colleague's.
We want to fix to reference auto-generated files that hasn't been generated yet when runs xcodegen.
For example, case of generate localized strings file using SwiftGen in build phases.
Requires to generate a Xcode project before runs SwiftGen in the pre-build phase.
So we expect like following:
Screen Shot 2019-03-28 at 23 38 47

How should we fix?

@AlexisQapa

Copy link
Copy Markdown

I think there is a pre gen hook or at least it was mentioned in another issue. Right now I deal with this by either having blank files (we don't use swiftgen for storyboard so files are known in advance) or running swiftgen once before Xcode gen.

@yonaskolb

Copy link
Copy Markdown
Owner

Comments left in #546
@AlexisQapa suggestions should resolve this issue.
Closing this for now

@yonaskolb yonaskolb closed this Mar 29, 2019
@KyoheiG3
KyoheiG3 deleted the fix-optional-file branch April 1, 2019 03:14
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.

4 participants