Fallback to standard Bundle access when running outside JNI environment#28
Merged
Conversation
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.
When testing a Skip Fuse module that tries to access
Bundle.moduleviaskip android test, the following crash would happen:As discussed at https://skip.dev/docs/testing/,
skip android testis a "bare-bones" testing tool, in that it runs the tests as a bare native Android executable, rather than bundling everything into an .apk and executing instrumented tests likeskip test --android-serial=emulator-5554does.This is normally fine, but when the module under test incorporates Skip by using the
skipstoneplugin, then we generate a shim to intercept bundle access and redirect it to Skip's bridged Bundle support, which integrates with our packaging of the SwiftPM resources into the apk's assets/ folder and uses theAssetManagerto retrieve these resources. None of this happens at all under the bare metal testing ofskip android test, and so it doesn't work: we crash when we first try to bridge through to Skip because there is no ambient java environment in this scenario.This PR provides a stopgap that bypasses bridging and falls back to the default Linux-style .resources/ folder handling that a non-Skip project would use.