yonaskolb / XcodeGen

A Swift command line tool for generating your Xcode project
MIT License
6.88k stars 809 forks source link

mlpackage bundles not recognized #1397

Closed aaron-foreflight closed 10 months ago

aaron-foreflight commented 10 months ago

mlpackage bundles are not recognized as a bundle by xcodegen. These bundles should be treated like a file and added to the compiled sources build phase. It would be nice if xcodegen could support these out of the box.

Here is the configuration I had to use to properly set this up in our project:

- path: Sources/FancyMLFeature/models/mypackage.mlpackage
  group: Sources/FancyMLFeature/models
  buildPhase: sources
  type: file

- path: Sources
  excludes:
     - FancyMLFeature/models/mypackage.mlpackage/**

More on mlpackage bundles from Apple here: https://developer.apple.com/documentation/coreml/updating_a_model_file_to_a_model_package

yonaskolb commented 10 months ago

Thanks for the info @aaron-foreflight. Would you like to have a go at submitting a pr to add a new line here https://github.com/yonaskolb/XcodeGen/blob/a0e71fe3dff95f964e1508748027fb93a693cc2d/Sources/ProjectSpec/FileType.swift#L77

aaron-foreflight commented 10 months ago

Thanks for the pointer! That made it quite easy to implement.