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

Add folder reference support #151

Merged
merged 2 commits into from
Nov 15, 2017
Merged

Add folder reference support #151

merged 2 commits into from
Nov 15, 2017

Conversation

yonaskolb
Copy link
Owner

@yonaskolb yonaskolb commented Nov 15, 2017

Resolves #25
This adds a type property to TargetSource which can be either

  • file
  • group
  • folder

If the type is left out it will be guessed. (If the path points to a file or the directory has an extension it will be treated as a file reference, otherwise it will be a group)

If it's set to folder it will be a folder reference.

This also refactors some more source generation code

Copy link
Collaborator

@bkase bkase left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks!

}

groups.insert(group, at: 0)
return (allSourceFiles, groups)
}

private func getSourceFiles(targetSource: TargetSource, path: Path) throws -> [SourceFile] {

let type = targetSource.type ?? (path.isFile || path.extension != nil ? .file : .group)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is awesome! This will make our generation way faster since we waited on I/O for the path.isFile check for every file in our project.

@yonaskolb yonaskolb merged commit 0508145 into master Nov 15, 2017
@yonaskolb yonaskolb deleted the folder_references branch November 15, 2017 08:37
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