Skip to content

Conversation

brentleyjones
Copy link
Contributor

Before this change BazelDependencies would generate files for all of the targets in a scheme, even when only a subset of targets were being built. Now we leverage the cached data in XCBuildData to gain insight into what targets are actually being built, allowing us to only build what is needed.

Sadly this cached data doesn't say which exact target is being built as part of Index Build, so we still have to rely on our off-by-one logic there. Also of note, SwiftUI Previews build every target in a scheme, and this behavior is preserved with this method.

@brentleyjones
Copy link
Contributor Author

@jpsim I've added you for review to make sure this doesn't break normal schemes for you. I did a lot of testing, and everything seems good, but this was a tricky implementation.

@brentleyjones brentleyjones force-pushed the bj/limit-files-generated-when-using-custom-schemes branch from 5a9f8d4 to 16c168e Compare August 2, 2022 18:42
@brentleyjones brentleyjones force-pushed the bj/limit-files-generated-when-using-custom-schemes branch 3 times, most recently from 452bbfc to 3adc334 Compare August 3, 2022 19:23
Before this change `BazelDependencies` would generate files for all of the targets in a scheme, even when only a subset of targets were being built. Now we leverage the cached data in `XCBuildData` to gain insight into what targets are actually being built, allowing us to only build what is needed.

Sadly this cached data doesn't say which exact target is being built as part of Index Build, so we still have to rely on our off-by-one logic there. Also of note, SwiftUI Previews build every target in a scheme, and this behavior is preserved with this method.
@brentleyjones brentleyjones force-pushed the bj/limit-files-generated-when-using-custom-schemes branch from 3adc334 to e223e17 Compare August 3, 2022 21:16
@brentleyjones brentleyjones enabled auto-merge (squash) August 3, 2022 21:17
@brentleyjones brentleyjones merged commit fbb68df into main Aug 3, 2022
@brentleyjones brentleyjones deleted the bj/limit-files-generated-when-using-custom-schemes branch August 3, 2022 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants