Fix Swift files placed in Xcode Resources phase instead of Compile Sources#4722
Merged
shai-almog merged 3 commits intocodex/add-swift-support-for-codename-one-interfacesfrom Apr 8, 2026
Conversation
…es phase The ByteCodeTranslator was placing .swift files in the Copy Bundle Resources phase instead of the Compile Sources phase of the generated Xcode project. This prevented the Swift bridge class from being compiled, so the ObjC shim could not find it at runtime. Changes: - ByteCodeTranslator: recognize .swift as source files (compile phase, correct file type sourcecode.swift, proper path resolution) - IPhoneBuilder: restore #import of Impl.h header in generated native peer code for compile-time method signatures Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/d03d4ad3-d347-40b7-8d32-7a83904d638e Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
shai-almog
April 8, 2026 09:29
View session
Collaborator
|
Compared 33 screenshots: 33 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
|
Contributor
✅ ByteCodeTranslator Quality ReportTest & Coverage
Benchmark Results
Static Analysis
Generated automatically by the PR CI workflow. |
…nditionally The SWIFT_VERSION, DEFINES_MODULE, and SWIFT_OBJC_BRIDGING_HEADER build settings were only configured inside the if(runPods) block, so they were never applied when CocoaPods was not used. This caused Xcode to fail with "SWIFT_VERSION '' is unsupported" when Swift files were present without CocoaPods. Fix: add these settings directly to the pbxproj template so they are always present, and create the bridging header file unconditionally. Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/4ba434ac-7e49-4c9e-8041-82a78d146d75 Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
…ject Reverts the unconditional SWIFT_VERSION, DEFINES_MODULE, and SWIFT_OBJC_BRIDGING_HEADER from the pbxproj template. Instead, these settings are now injected at build time in IPhoneBuilder only when hasSwiftFiles() detects .swift files in the dist directory. This avoids adding Swift-specific settings to pure Objective-C projects. Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/e0fe80ff-947f-4796-857c-bd4248280e1a Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
Collaborator
5b318b3
into
codex/add-swift-support-for-codename-one-interfaces
12 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

hasSwiftFiles()helper in IPhoneBuilder.java to recursively scan dist dir for .swift filesreplaceInFilewhen Swift files are present