File tree Expand file tree Collapse file tree 4 files changed +23
-4
lines changed 
Sources/NIOPerformanceTester Expand file tree Collapse file tree 4 files changed +23
-4
lines changed Original file line number Diff line number Diff line change 7575    name : Android Swift SDK 
7676    #  Workaround https://github.com/nektos/act/issues/1875
7777    uses : apple/swift-nio/.github/workflows/android_sdk.yml@main 
78-     with :
79-       additional_command_arguments : " --target NIOCore" 
8078
8179  macos-tests :
8280    name : macOS tests 
Original file line number Diff line number Diff line change @@ -109,8 +109,6 @@ jobs:
109109    name : Android Swift SDK 
110110    #  Workaround https://github.com/nektos/act/issues/1875
111111    uses : apple/swift-nio/.github/workflows/android_sdk.yml@main 
112-     with :
113-       additional_command_arguments : " --target NIOCore" 
114112
115113  release-builds :
116114    name : Release builds 
Original file line number Diff line number Diff line change @@ -28,7 +28,12 @@ import NIOCore
2828import  NIOEmbedded
2929import  NIOFoundationCompat
3030import  NIOHTTP1
31+ #if os(Android) 
32+ // workaround for error: reference to var 'stdout' is not concurrency-safe because it involves shared mutable state
33+ @preconcurrency   import  NIOPosix
34+ #else 
3135import  NIOPosix
36+ #endif 
3237import  NIOWebSocket
3338
3439// Use unbuffered stdout to help detect exactly which test was running in the event of a crash.
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ version="${INSTALL_SWIFT_VERSION:=""}"
2525arch=" ${INSTALL_SWIFT_ARCH:= " aarch64"  " 
2626os_image=" ${INSTALL_SWIFT_OS_IMAGE:= " ubuntu22.04"  " 
2727sdk=" ${INSTALL_SWIFT_SDK:= " static-sdk"  " 
28+ android_ndk_version=" ${INSTALL_ANDROID_NDK:= " r27d"  " 
2829
2930if  [[ !  ( -n " $branch " &&  -z " $version " &&  !  ( -z " $branch " &&  -n " $version " ;  then 
3031  fatal " Exactly one of build or version must be defined." 
@@ -127,3 +128,20 @@ swift --version
127128
128129log " Installing Swift SDK" 
129130swift sdk install " $sdk_path " 
131+ 
132+ log " Swift SDK Post-install" 
133+ if  [[ " $sdk " ==  " android-sdk" ;  then 
134+     #  guess some common places where the swift-sdks folder lives
135+     cd  ~ /Library/org.swift.swiftpm ||  cd  ~ /.config/swiftpm ||  cd  ~ /.local/swiftpm ||  cd  ~ /.swiftpm ||  cd  /root/.swiftpm ||  fatal " Cannot locate swiftpm config directory" 
136+ 
137+     #  download and link the NDK
138+     android_ndk_url=" https://dl.google.com/android/repository/android-ndk-${android_ndk_version} -$( uname -s) " 
139+     log " Android Native Development Kit URL: ${android_ndk_url} " 
140+     " $CURL_BIN " " ${android_ndk_url} " 
141+     unzip -q ndk.zip
142+     rm ndk.zip
143+     export  ANDROID_NDK_HOME=" ${PWD} /android-ndk-${android_ndk_version} " 
144+     bundledir=$( find .  -type d -maxdepth 2 -name ' *android*.artifactbundle' |  head -n 1) 
145+     " ${bundledir} " 
146+     cd  - ||  fatal " Cannot cd back to previous directory" 
147+ fi 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments