Repository navigation
feat: leave debug-only frameworks out of release builds #567
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| // @COCOAPODS_SILENCE_WARNINGS@ // | ||
| #include "build.xcconfig" | ||
| #include "../plugins-debug.xcconfig" | ||
| // Debug configurations embed every debug framework. | ||
| NS_EMBEDDED_DEBUG_FRAMEWORKS = $(NS_DEBUG_FRAMEWORKS) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Xcode embeds only the NS_DEBUG_FRAMEWORKS that INCLUDED_SOURCE_FILE_NAMES lists, but it | ||
| # never deletes the copy an earlier build left in the app. | ||
|
|
||
| set -e | ||
|
|
||
| INCLUDED=" ${INCLUDED_SOURCE_FILE_NAMES} " | ||
|
|
||
| for FRAMEWORK in ${NS_DEBUG_FRAMEWORKS}; do | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Normalize comma-separated framework names before cleanup. With Split the supported comma-separated input into separate framework names. Normalize the inclusion list too, so comma-separated ship selections remain protected. Apply the correction to both template copies.
|
||
| if [[ "$INCLUDED" != *" $FRAMEWORK "* ]]; then | ||
| rm -rf "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/${FRAMEWORK}" | ||
| fi | ||
| done | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| // @COCOAPODS_SILENCE_WARNINGS@ // | ||
| #include "build.xcconfig" | ||
| #include "../plugins-debug.xcconfig" | ||
| // Debug configurations embed every debug framework. | ||
| NS_EMBEDDED_DEBUG_FRAMEWORKS = $(NS_DEBUG_FRAMEWORKS) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Xcode embeds only the NS_DEBUG_FRAMEWORKS that INCLUDED_SOURCE_FILE_NAMES lists, but it | ||
| # never deletes the copy an earlier build left in the app. | ||
|
|
||
| set -e | ||
|
|
||
| INCLUDED=" ${INCLUDED_SOURCE_FILE_NAMES} " | ||
|
|
||
| for FRAMEWORK in ${NS_DEBUG_FRAMEWORKS}; do | ||
| if [[ "$INCLUDED" != *" $FRAMEWORK "* ]]; then | ||
| rm -rf "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/${FRAMEWORK}" | ||
| fi | ||
| done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accept comma-separated names in
NS_DEBUG_FRAMEWORKSin both scripts.The linker wrapper matches
NS_DEBUG_FRAMEWORKSonly when each name is surrounded by spaces. WithNS_DEBUG_FRAMEWORKS = TKLiveSync.framework, Probe.framework, the value containsTKLiveSync.framework,, so the match fails.TKLiveSyncstays strongly linked. The stale-removal loop splits on spaces only, so it treatsTKLiveSync.framework,as one name and does not remove the stale framework copy.The PR states that these settings accept comma-separated names. Normalize commas to spaces before both matches.
Suggested fix
project-template-ios/internal/nsld.sh:project-template-ios/internal/remove-stale-debug-frameworks.sh: