Add Swift/Kotlin native sample support, runtime validator, and iPhoneBuilder improvements#4684
Open
liannacasper wants to merge 38 commits intomasterfrom
Open
Add Swift/Kotlin native sample support, runtime validator, and iPhoneBuilder improvements#4684liannacasper wants to merge 38 commits intomasterfrom
liannacasper wants to merge 38 commits intomasterfrom
Conversation
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
Collaborator
|
Compared 36 screenshots: 36 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
Collaborator
|
Compared 35 screenshots: 35 matched. Benchmark Results
Detailed Performance Metrics
|
|
Developer Guide build artifacts are available for download from this workflow run:
Developer Guide quality checks:
Unused image preview:
|
…urces (#4722) * Fix Swift native interface support: add .swift to Xcode compile sources 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> * Set SWIFT_VERSION in pbxproj template and create bridging header unconditionally 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> * Only add Swift build settings when Swift files are present in the project 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> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
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.
Motivation
Description
package-info.javaandpackage.html) to mention Swift as a supported iOS native implementation language.IPhoneBuilderto use a newcn1_createNativeInterfacePeerhelper that looks up Objective-C/Swift classes by name and falls back to the app bundle-prefixed name, and changed native peer handling to use genericidvalues.SwiftKotlinNativeand platform implementations: a Kotlin implementationSwiftKotlinNativeImpl.ktfor Android and a Swift implementationcom_codenameone_examples_hellocodenameone_SwiftKotlinNativeImpl.swiftfor iOS.NativeInterfaceLanguageValidatorand wired it into the sample app (HelloCodenameOne.kt) to assert that Android useskotlinand iOS usesswiftimplementations at runtime.Testing
IPhoneBuilderand new sample source files; the build succeeded.Codex Task