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

Adding Extra parameter when running SwiftGen through Xcode #1087

Open
amornn opened this issue Oct 19, 2023 · 1 comment
Open

Adding Extra parameter when running SwiftGen through Xcode #1087

amornn opened this issue Oct 19, 2023 · 1 comment

Comments

@amornn
Copy link

amornn commented Oct 19, 2023

SwiftGen v6.6.2 (Stencil v0.15.1, StencilSwiftKit v2.10.1, SwiftGenKit v6.6.2)
MacOS Sonoma M1 Pro, Xcode 15

Run script Phase in Aggregate Target
Screenshot 2023-10-19 at 12 38 13

Running SwiftGen command on terminal
Screenshot 2023-10-19 at 12 37 28

Running SwiftGen from Aggregate target in Xcode
Screenshot 2023-10-19 at 12 36 58

Config:

xcassets:
  inputs:
    - CoreUIModule/CoreUIModule/Assets.xcassets
  outputs:
    - templateName: swift5
      params:
        publicAccess: N/A
        forceProvidesNamespaces: true
      output: CoreUIModule/CoreUIModule/Generated/Assets.swift

ib:
  inputs:
    - .
  outputs:
    - templateName: scenes-swift5
      output: DGW/Generated/Storyboards.swift

@djbe
Copy link
Member

djbe commented Mar 15, 2024

Not sure about your setup in Xcode, but SwfitGen grabs the name of the "current module" (PRODUCT_MODULE_NAME ) when running in a build phase, so we know what to "fill in" as a module for view controllers. Remember that in IB, you can set the module of a component (view controller, view, …) to "inherit module from target".

Now, this may go wrong if you have an atypical setup, like you probably do.

In those cases, you can override this by setting the module template parameter to the one you need (check the docs), or even completely disable prefixing the module by setting ignoreTargetModule to true.

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