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

Storyboards swift4 template fails #443

Closed
mikkelam opened this issue Jun 28, 2018 · 5 comments
Closed

Storyboards swift4 template fails #443

mikkelam opened this issue Jun 28, 2018 · 5 comments

Comments

@mikkelam
Copy link

Hi, I have a problem with the swift4 storyboard template. I'm using the newest version of swiftgen and i have the folowing config

storyboards:
  paths: 'Controllers/'
  templateName: swift4
  output: 'Storyboards.swift'

The template generates files like so:

...
import App_Name 
...


internal enum StoryboardScene {
  internal enum Something: StoryboardType {
    internal static let storyboardName = "Something"

    internal static let searchResultsViewController = SceneType<App_Name.SearchResultsViewController>(storyboard: Something.self, identifier: "SearchResultsViewController")
  }

Which always fails as the file is inside App_Name module already. I've tried various module params yet it doesn't fix it. Do you guys have any idea?

If it helps my module has two targets:

  • App_Name
  • App_Name_Dev

which use the same files, it's just used for deployment

@djbe
Copy link
Member

djbe commented Jun 28, 2018

This is a duplicate of #405, and some other issues, will be fixed by #435. Quick solutions:

  • Provide the module in the storyboard as --param module=App_Name
  • Write your own template that ignores both App_Name and App_Name_Dev.

Quick tip: use configurations instead of targets for multiple environments.

@djbe djbe closed this as completed Jun 28, 2018
@djbe djbe added the duplicate label Jun 28, 2018
@mikkelam
Copy link
Author

mikkelam commented Jul 4, 2018

Yeah like i said, i tried that. Doing that it correctly removes the statement import App_Name
yet it still adds App_name to my scenetypes. Anyway thanks for your reply and time

@djbe
Copy link
Member

djbe commented Jul 4, 2018

It shouldn't do that? 😕
What if you add the ignoreTargetModule flag?

@mikkelam
Copy link
Author

mikkelam commented Jul 5, 2018

that's also not working :/

@djbe
Copy link
Member

djbe commented Jul 5, 2018

Then I suggest you try the 2nd solution I originally mentioned, copying the existing template and modifying it to check for all your available targets. At least until #435 is implemented.

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

2 participants