[build.ps1] remove Android API level from Dispatch.swiftmodule names #78800
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.
Purpose
When determining output paths for Android binaries in the SDK, ensure that the Android API level integer is not included in paths. E.g. use the versionless "module triple"
aarch64-unknown-linux-android
instead ofaarch64-unknown-linux-android28
.Overview
Get-TargetInfo $Arch
method that returns the result ofswift.exe -target $Arch.LLVMTarget -print-target-info
as parsed JSON object using the newly built toolchain$Arch
hashtable to avoid making multiple callsGet-ModuleTriple $Arch
method that callsGet-TargetInfo $Arch
and returns the resulting.target.moduleTriple
stringGet-ModuleTriple
to calculate the target path inInstall-Platform
when copying.swiftmodule
,.swiftdoc
, and.swiftinterface
files (this case includesDispatch.swiftmodule
).$Arch.LLVMTarget.Replace("$AndroidAPILevel","")
with aGet-ModuleTriple $Arch
Validation
Local toolchain build with
-AndroidSDKs aarch64,x86_64
and verified the expected directory structure of the Dispatch module in the Android SDK:Successfully built this simple Swift program for Android using the locally built SDK.