Xcodegen: Running the shell script before project generation

Created on 29 Jun 2020  路  3Comments  路  Source: yonaskolb/XcodeGen

What is the best solution to run a shell script before the project generation starts if any?
I'm using SwiftGen to have type-safe assets and localization usage in my app.
I want to remove generated files from the repository and run generation script before project generation and then after every build(the last part is easy). Files are needed to be generated before project generation, so they're added to the project.

One solution is to create setup.sh where I run the
Swiftgen and other needed scripts for the project and in the end xcodegen.
Is there any alternative way?
Sth like

preGenerationScripts:
  - swiftgen.sh
  - someAnotherCoolScript.sh

This works, but then I need to reconfigure all Jenkins jobs 馃槥 and force every teammate to use a new solution - which doable, but thought, maybe there is a better way to do it already or planned.

Most helpful comment

There's a preGenCommand option in the project spec that does what you're asking for.

All 3 comments

That would be some extension to the main purpose of XcodeGen.

XcodeGen is a command line tool written in Swift that generates your Xcode project using your folder structure and a project spec.

For me, I use a Makefile or Rakefile or Fastlane custom action to perform those pregeneration scripts.

There's a preGenCommand option in the project spec that does what you're asking for.

There's a preGenCommand option in the project spec that does what you're asking for.

Thank you very much! That's what I need!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JFryer12 picture JFryer12  路  6Comments

yonaskolb picture yonaskolb  路  3Comments

samedson picture samedson  路  5Comments

ismetanin picture ismetanin  路  3Comments

pvinis picture pvinis  路  6Comments