XcodeGen/xcconfig migration #2024
Replies: 8 comments 12 replies
This comment has been hidden.
This comment has been hidden.
-
A few points to consider
In summary, we gonna have a big change in paradigm in our project that does not really solves a problem. |
Beta Was this translation helpful? Give feedback.
-
This change still lessens the overall pain level, because it will prevent Xcode from throwing up dialogs every time the tracked project changes, like during a rebase, instead of every time the generated project changes, which is controlled by us in our own private workflows. |
Beta Was this translation helpful? Give feedback.
-
This is a well-known tool in the iOS community. And it's a simple spec language. Please have a read through the project.yml and point out anything you don't understand or think would be confusing about it. |
Beta Was this translation helpful? Give feedback.
-
If this happens, we can do 2 things:
|
Beta Was this translation helpful? Give feedback.
-
Within one month of working on it I had annoyances as well as experiencing merge conflict issues. Just the constant switching of the watchOS app's xcscheme is annoying to no end. |
Beta Was this translation helpful? Give feedback.
-
The public/include/etc header files actually don't need to be in specific folders like we currently have them. And if we're going to change the whole organization of files on disk, since that's where the real flatness currently is, we might as well do away with this idea as well (which I'm happy to do!) |
Beta Was this translation helpful? Give feedback.
-
I'm going to shelve the xcodegen refactor for now and focus on fixing things in the "fixed" section of this discussion within the context of our current project structure. |
Beta Was this translation helpful? Give feedback.
-
This discussion seeks feedback on moving to managing our Xcode projects and configurations in an XcodeGen spec and xcconfigs. It also serves as a memory aid for my own purposes as I have been working on this on a backburner for a while, as well as general tracking of tasks and visibility for open-source stakeholders.
Draft PR
Motivation
Removing the Xcode project and workspace from Git tracking and instead tracking an XcodeGen yml spec is easier to work on as a team. We have a large collection of separate Xcode projects which makes managing all the settings, targets and schemes unwieldy (11 projects and over 30 targets). Also, tracking Xcode project files in Git is a pain: merge conflicts can be tough to resolve (and automatic resolution sometimes lets spurious things creep in that don't actually break anything, but don't do anything either), and if you've modified the project then changing branches usually causes Xcode to ask about whether to resave/reload files or breaks the UI completely until you close/reopen.
Along with that, it's much cleaner to keep settings in xcconfig files vs Xcode projects, as you can deduplicate lots of things, and it makes it clearer what setting affects what targets.
And then, since the xcodeproj isn't in git, we wouldn't need to do what some other teams do by adding a Danger check to make sure nobody's committing settings to the xcodeproj instead of in xcconfigs.
Finally, going through the project and settings have teased out a few issues to fix.
TODOs
make init
Extract all settings into xcconfigs
We have an xcworkspace with many projects–find them all
Ensured there was a scheme for every target in every project; we only had app schemes but not test schemes as the app/framework schemes directly ran test targets
Capture all build settings by running
//scripts/output-all-schemes-showbuildsettings.sh
Used BuildSettingsExtractor to output xcconfigs for all Xcode projects in
sentry-cocoa
Set the corresponding xcconfigs for every project’s target configuration file
Deleted all pbxproj build settings for every project/target
As in (3), again capture output of
xcodebuild -showBuildSettings
for every target of every project under each configuration (all hadDebug
/Release
only, with the exception of Sentry.xcodeproj which also hasTest
/TestCI
) into text files in anafter/
directory, for comparisonxcodebuild_showBuildSettings_before
withxcodebuild_showBuildSettings_after
Verify parity of build settings by comparing
before/
andafter/
directories and finding no differencesdiff xcodebuild_showBuildSettings_before/ xcodebuild_showBuildSettings_after/ | sort | uniq -c
shows all the actual differences (and how many files contained each), such as:mend any differences in subsequent commits
do another output to
after-fixed/
which should be identical tobefore/
Capture workspace structure in XcodeGen spec
need to refactor xcconfigs to combine the previously separate xcodeproj’ project-level xcconfigs into one for the new single project
Irregularities fixed
- Removed a bunch of test resources that were unused:I wound up finding where these were used- SentryFileIOTrackingIntegrationTests was in SentryTests and iOS-SwiftUITests; should not be in the latter, it’s not even a UI testDhiogo pointed out why this is the casec++14
: fix: standardize on C++14 #2068LD_RUNPATH_SEARCH_PATHS
for macOS compilation of Sentry framework (was set to include the iOS runpaths)iOS-SwiftUI
, isiOS-SwiftUITests
a unit test or ui test target? isiOS-SwiftUITests
a UI test foriOS-Swift
or a unit test foriOS-SwiftUI
?)TestSentryCrashWrapper.swift
(appears to have been rewritten in objc)SentryRateLimitsParserTests.m
(appears to have been rewritten in swift)Tests/SentryTests/Integrations/Performance/CoreData/TestModel.xcdatamodeld/TestModel.xcdatamodel/contents
and since it had automatic code generation, the generated classes conflicted with others that were hand written and actually compiled into the testsSentrySerializationTests.m
(rewritten in swift)SentryStacktraceEquality.swift
(empty)/Users/andrewmcknight/Code/organization/getsentry/repos/public/sentry-cocoa-clone-always-master/Samples/iOS-Swift/iOS-Swift.xcodeproj Building for iOS, but the linked and embedded framework 'Sentry.framework' is building for Mac Catalyst. You may need to configure 'Sentry.framework' to build for iOS.
dyld[21098]: Library not loaded: @rpath/Sentry.framework/Versions/A/Sentry Referenced from: /Users/andrewmcknight/Library/Developer/Xcode/DerivedData/Sentry-ewgvnkbxbplozgbzvtnbhxsvcpmm/Build/Products/Debug-maccatalyst/iOS-Swift.app/Contents/MacOS/iOS-Swift Reason: tried: '/Users/andrewmcknight/Library/Developer/Xcode/DerivedData/Sentry-ewgvnkbxbplozgbzvtnbhxsvcpmm/Build/Products/Debug-maccatalyst/Sentry.framework/Versions/A/Sentry' (code signature in <460E704C-3130-32B2-8415-9A4EA208213C> '/Users/andrewmcknight/Library/Developer/Xcode/DerivedData/Sentry-ewgvnkbxbplozgbzvtnbhxsvcpmm/Build/Products/Debug-maccatalyst/Sentry.framework/Versions/A/Sentry' not valid for use in process: Trying to load an unsigned library), '/Users/andrewmcknight/Library/Developer/Xcode/DerivedData/Sentry-ewgvnkbxbplozgbzvtnbhxsvcpmm/Build/Products/Debug-iphoneos/Sentry.framework/Versions/A/Sentry' (no such file), '/Users/andrewmcknight/Library/Developer/Xcode/DerivedData/Sentry-ewgvnkbxbplozgbzvtnbhxsvcpmm/Build/Products/Debug-maccatalyst/PackageFrameworks/Sentry.framework/Versions/A/Sentry' (no such file), '/Users/andrewmcknight/Library/Developer/Xcode/DerivedData/Sentry-ewgvnkbxbplozgbzvtnbhxsvcpmm/Build/Products/Debug-iphoneos/PackageFrameworks/Sentry.framework/Versions/A/Sentry' (no such file), '/usr/lib/swift/Sentry.framework/Versions/A/Sentry' (no such file), '/Users/andrewmcknight/Library/Developer/Xcode/DerivedData/Sentry-ewgvnkbxbplozgbzvtnbhxsvcpmm/Build/Products/Debug-maccatalyst/iOS-Swift.app/Contents/MacOS/Frameworks/Sentry.framework/Versions/A/Sentry' (no such file), '/Users/andrewmcknight/Library/Developer/Xcode/DerivedData/Sentry-ewgvnkbxbplozgbzvtnbhxsvcpmm/Build/Products/Debug-maccatalyst/iOS-Swift.app/Contents/MacOS/Frameworks/Sentry.framework/Versions/A/Sentry' (no such file), '/usr/lib/swift/Sentry.framework/Versions/A/Sentry' (no such file), '/Users/andrewmcknight/Library/Developer/Xcode/DerivedData/Sentry-ewgvnkbxbplozgbzvtnbhxsvcpmm/Build/Products/Debug-maccatalyst/iOS-Swift.app/Contents/MacOS/Frameworks/Sentry.framework/Versions/A/Sentry' (no such file), '/Users/andrewmcknight/Library/Developer/Xcode/DerivedData/Sentry-ewgvnkbxbplozgbzvtnbhxsvcpmm/Build/Products/Debug-maccatalyst/iOS-Swift.app/Contents/MacOS/Frameworks/Sentry.framework/Versions/A/Sentry' (no such file), '/System/Library/Frameworks/Sentry.framework/Versions/A/Sentry' (no such file)
SentryTests
into the framework://Tests/SentryTests/Helper/SentryTestObjCRuntimeWrapper.h
//Tests/SentryTests/TestUtils/SentryClassRegistrator.h
Other improvements
macOS-SPM-CommandLine
sample app andtest-server
to the new projectmake build-for-watchos
XCFramework build stepBeta Was this translation helpful? Give feedback.
All reactions