Merge upstream main and provide Skip-prefixed compatibility modules#1
Merged
Conversation
Add `swift-java-jni-core` dependency
Update `OSLog.Logger` to use `AndroidLogger`
* Add formatting and license headers * Update headers * Update swift format config * Update swift format config * Formatting fixes * Update formatting * Add docs_check_enabled to soundness
* Work around documentation validation errors * Fix starting space in YAML * Exclude AndroidLooper due to doc build errors * Fix doc errors
* Update to Swift 6.3 and swift-java-jni-core 0.5.0 * Disable docs check
…#33) * Update CI matrix to test Swift 6.3.2, nightly-6.4, and nightly-main * Add OSLog dependency to AndroidContextTests and AndroidHardwareTests on Android * Remove nightly-6.4 from CI Swift matrix * Fix YAML syntax
Add a SWIFT_BUILD_DYNAMIC_LIBRARY environment variable, following the same pattern used by PureSwift/Bluetooth, that switches every library product's type to .dynamic instead of the default automatic (static) linking. This lets downstream consumers cross-compiling for Android opt into dynamic libraries for these packages without needing a fork.
AndroidLooper's main-queue drain used CoreFoundation's CFRunLoopRunInMode, which requires linking all of Foundation (and, on this Android SDK, FoundationInternationalization + ICU with it) even though nothing else needs it. Add a "CoreFoundation" trait (off by default) that switches the drain to call _dispatch_main_queue_callback_4CF() directly instead - the same primitive CFRunLoop calls internally when its main-queue port fires. Consumers that want the original CoreFoundation-backed behavior can opt back in via traits: ["CoreFoundation"]. Also excludes Thread.swift's withLooper convenience wrapper on Android, since Thread requires the full Foundation module (not available via FoundationEssentials alone) and the wrapper isn't used by the Looper bridge itself.
Per review feedback: the trait should be the single toggle for this module's Foundation/CoreFoundation usage rather than mixing it with a platform check.
Add the trailing comma swift-format expects on the last element of the traits array.
Avoid linking Foundation on Android for the dispatch main queue drain
Support building library products as dynamic libraries
…imports Remove unused Foundation imports
# Conflicts: # Sources/AndroidAssetManager/AndroidAssetManager.swift # Sources/AndroidLooper/AndroidLooper.swift
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.
Brings
feature/pureswiftup to current upstreammainand replaces the target renames withcompatibility shims, so one source can serve every dependent again.
The problem
feature/pureswiftwas 87 commits behind upstream, and the "Add Skip prefix to conflictingpackages" commit renamed targets —
AndroidLogging→SkipAndroidLogging,AndroidLooper→SkipAndroidLooper,AndroidNDK→SkipAndroidNDK.A target's name is its module name, so that rename split the ecosystem in two:
skip-android-bridgeimportsSkipAndroidLoggingPureSwift/Androidimports the upstream names, and needsAndroidManifest,AndroidFileManager,AndroidInputandAndroidHardware— none of which this branch exportedSince SwiftPM resolves by package identity, a graph containing both dependents could not be
satisfied by any single revision of this package. Downstream that surfaced as an unresolvable
graph, and then as:
What this does
Merge upstream
main(-X theirsfor the two conflicts, both files upstream hadreorganized:
AndroidAssetManager.swiftfolded intoAndroidFileManager, andAndroidLooper.swiftsplit into several files). The branch now has the full upstream productset:
AndroidSystem,AndroidNative,AndroidContext,AndroidFileManager,AndroidLogging,AndroidLooper,AndroidChoreographer,AndroidManifest,AndroidInput,AndroidHardware.Re-add the Skip-prefixed names as thin re-export shims rather than renames:
with matching
SkipAndroidLogging/SkipAndroidLooperproducts. Bothimport AndroidLoggingandimport SkipAndroidLoggingnow resolve to the same code, soskip-android-bridgekeeps working unchanged whilePureSwift/Androidgets the upstream namesit expects.
AndroidNDKis left with its upstream name, as no dependent imports the Skip-prefixed variant.Note on the diff size
The commit count is large because merging upstream brings its history onto the branch. The
branch-specific change is small: the merge resolution plus two shim files and their manifest
entries.
Downstream
This is a prerequisite for PureSwift/Android#43 and PureSwift/AndroidBluetooth#4, which both point
at this branch. Merge this first.
Verified by resolving and building the BluetoothExplorer app graph against it.