Skip to content

Conversation

brentleyjones
Copy link
Contributor

@brentleyjones brentleyjones commented Apr 12, 2022

Part of #208.

@brentleyjones brentleyjones force-pushed the bj/support-coredata-files branch 4 times, most recently from 9af4ec8 to f3fb165 Compare April 13, 2022 16:35
@brentleyjones brentleyjones marked this pull request as draft April 13, 2022 16:48
@brentleyjones
Copy link
Contributor Author

brentleyjones commented Apr 13, 2022

This currently has an issue related to codegen. For an executable bundle (e.g. app, dynamic framework, extension, etc.), the data model should be in the Compile Sources phase. This will create any necessary codegen and still bundle the resources. For other targets (e.g. resource bundle) it should be in the Bundle Resources phase (as it's invalid for iOS resource bundles to have an executable) and also the Compile Sources phase of the associated static library/framework.

This results in weird behavior though, because the Bundle Resource phase will complain about generated code. Disabling codegen gets rid of all of this, but it needs to be enabled on the entities for apple_core_data_model to work. Ohh, and apple_core_data_model generates these sources as well, so we have to deal with the duplication somehow.

So this is what I'm thinking: we post-process the .xcdatamodel/contents files, removing the codeGenerationType key. We keep the xcdatamodeld in Bundle Resources phase for all targets (versus Compile Sources). We allow the sources from apple_core_data_model to land where they land. This should mimic how Bazel behaves.

@brentleyjones brentleyjones force-pushed the bj/support-coredata-files branch from f3fb165 to ce0ea49 Compare April 13, 2022 17:32
@brentleyjones brentleyjones added the feature request New feature or request label Apr 16, 2022
@brentleyjones brentleyjones added this to the Build with Xcode milestone Apr 16, 2022
@brentleyjones brentleyjones force-pushed the bj/support-coredata-files branch from ce0ea49 to 8dc093f Compare May 3, 2022 22:55
@brentleyjones brentleyjones marked this pull request as ready for review May 3, 2022 22:55
@brentleyjones
Copy link
Contributor Author

Rebased. I'll address the issue above at a later time. I'll open an issue for it.

@brentleyjones brentleyjones force-pushed the bj/support-coredata-files branch from 8dc093f to 1a0a821 Compare May 3, 2022 22:58
@brentleyjones brentleyjones force-pushed the bj/support-coredata-files branch from 1a0a821 to 9ee52d1 Compare May 3, 2022 23:15
@erikkerber
Copy link
Contributor

This combined with the recent signing fix has us building and running on the simulator 🎉

@brentleyjones brentleyjones merged commit f134df7 into main May 3, 2022
@brentleyjones brentleyjones deleted the bj/support-coredata-files branch May 3, 2022 23:23
@brentleyjones brentleyjones self-assigned this May 4, 2022
@brentleyjones brentleyjones modified the milestones: Build with Xcode, 0.3: Initial Build with Bazel May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants