The Wayback Machine - https://web.archive.org/web/20200526172043/https://github.com/mac-cain13/R.swift/issues/415
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

Declare Input and Output Files in Run Script Phase #415

Open
fabb opened this issue Jun 10, 2018 · 2 comments
Open

Declare Input and Output Files in Run Script Phase #415

fabb opened this issue Jun 10, 2018 · 2 comments

Comments

@fabb
Copy link

@fabb fabb commented Jun 10, 2018

In several WWDC talks, Apple suggests to set the Input and Output files in all run script phases, so the build system can choose to skip a run script phase if nothing changed, improving incremental build time.

How could we improve R.swift‘s behavior here?

Note that I did not yet check if wildcards were allowed in the Input Files field. Or if we could somehow leverage the new File List field.

@mac-cain13
Copy link
Owner

@mac-cain13 mac-cain13 commented Jun 11, 2018

Good suggestion, I was already thinking if we can leverage this. Few things that I noticed/came to mind:

  • We can't modify the new file lists (and also the "old" input files) during build as mentioned in Building Faster in Xcode
  • I think generating this list with a command you need to run by hand is to cumbersome, we need something automated for R.swift to make it really useful
  • We already do not write the file if there are no changes to prevent Xcode from thinking the file is changed/touched, but still the optimisation of not calling R.swift at all if not needed would be great
  • I'm wondering if we could add the Xcode project file to the list, that would be a nice thing to try. If that work I think we can use that to detect new resources and update the list.

See also the discussion the neighbours at SwiftGen have: SwiftGen/SwiftGen#441

@mac-cain13
Copy link
Owner

@mac-cain13 mac-cain13 commented Nov 28, 2018

Researched this a bit and also discussed this also with @tomlokhorst today;

  • Input file lists must exists if the file list doesn't exists compilation fails
  • Any file can be given, Xcode just looks at the last modified time of the input file
  • We would need to generate an input list of:
    • The project file (to detect added resources)
    • All resources found: images, xibs, storyboards, etc (to detect changes to these resources)
    • All the Contents.json files inside asset catalogs (to detect additions/deletions to assets, since those are not mentioned in the project file, and also changes to specific assets)

The big question is how to bootstrap this correctly, since integrating R.swift then would also mean you need to generate a file list by hand to make sure the first compilation keeps working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.