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 file names generator (nibs, plists, etc) #284

Closed
valerianb opened this issue Mar 24, 2017 · 8 comments
Closed

Add file names generator (nibs, plists, etc) #284

valerianb opened this issue Mar 24, 2017 · 8 comments

Comments

@valerianb
Copy link

Hi,

@AliSoftware We've met at AppDevCon, I wanted to adapt #108 to the new structure and making it more generic. As discussed back then, I'm opening an issue to discuss this.
You told me you were working on writing some docs on how to contribute now the project has been split in subprojects.
The first step would be to work on the SwiftGenKit part, right ?

@djbe
Copy link
Member

djbe commented Mar 24, 2017

For generators, the steps are:

  • First implement the generator in SwiftGenKit
  • Then implement the tests in SwiftGenKit. The necessary assets (input) and contexts (output) will be stored in the templates repository. Once you reach this point you'll open a related PR in the templates repo.
  • Once your contexts are correctly generated and tested, write your new templates (stencil) in the templates repo.
  • Once your templates are ready, write tests for them (in the templates repo). This will require the same contexts (input), but now you'll add the expected output (swift) files.
  • Finally, if need be, we might add some stuff to ensure the compilation of the output files works.
  • Once all this is done and merged, we could add a new command for this to the main swiftgen CLI tool (this repo).

@djbe
Copy link
Member

djbe commented Mar 24, 2017

Quick question: could you describe what features you'd like to implement?

What's the overlap with the reuseIdentifier issues/PRs? (SwiftGen/SwiftGenKit#16, SwiftGen/SwiftGenKit#15, #134) Or is it more an overlap with the codegen feature (#188), that could be expanded from JSON to include plist's?

@valerianb
Copy link
Author

valerianb commented Mar 28, 2017

Thank you for the explanations.

We use it solely to list nibs for the moment. There's no actual parsing of the nibs.
So the feature would simply be a listing of any type of files.

I will look into the issues/PRs you mentioned and get back to you !

@Robuske
Copy link
Contributor

Robuske commented Nov 30, 2018

Any updates on the state of this?
I am in need of something similar but with JSON’s, I mean, seems like the existing templates for JSON’s already give me a reference to the files, but then I would be parsing some pretty big files without the need for it

@AliSoftware
Copy link
Collaborator

AliSoftware commented Nov 30, 2018

@Robuske to my knowledge, I don't think any contributor took the time to start this yet.

Would be a good starter PR imho though, as the parser to implement for this would be pretty straightforward (nothing to parse actually, just return the file names) so the contexts to generate as output of the parser would just be something like an array of strings and the rest will follow.

We could improve further afterwards to not just return the file names but also the file type (UTI and/or MIME type), modification date and other meta data, but even adding that to the generated context shouldn't be that complicated 😉

@Robuske
Copy link
Contributor

Robuske commented Dec 1, 2018

Would be interesting to do it, but I honestly don’t know how to even start. Is the process still the same outlined by @djbe in the first comment?

@djbe
Copy link
Member

djbe commented Dec 1, 2018

Oh it's a bit simpler now, there are only 2 repos: StencilSwiftKit and SwiftGen. For this feature, you'd only need to modify the SwiftGen repo.

The steps themselves remain the same though, they're all just on 1 repo, and can be done in 1 PR. But before you start on a PR, maybe write a general outline of what the new command would and wouldn't do, general structure etc... So we can minimise the number of direction changes in the PR itself.

@djbe
Copy link
Member

djbe commented Jul 26, 2022

This feature was implemented as part of 6.5.0, which was released a while ago. Use the new files parser for these and other needs.

@djbe djbe closed this as completed Jul 26, 2022
@djbe djbe modified the milestones: Nice to Have, 6.5.0 Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants