@@ -16,7 +16,13 @@ const EXPECTED_XCFRAMEWORK_PLATFORMS = [
1616 "xros-arm64-simulator" ,
1717] ;
1818
19- async function verifyAndroidDirectory ( dirent : fs . Dirent ) {
19+ async function verifyAndroidPrebuild ( dirent : fs . Dirent ) {
20+ console . log (
21+ "Verifying Android prebuild" ,
22+ dirent . name ,
23+ "in" ,
24+ dirent . parentPath
25+ ) ;
2026 for ( const arch of EXPECTED_ANDROID_ARCHS ) {
2127 const archDir = path . join ( dirent . parentPath , dirent . name , arch ) ;
2228 for ( const file of await fs . promises . readdir ( archDir , {
@@ -31,7 +37,8 @@ async function verifyAndroidDirectory(dirent: fs.Dirent) {
3137 }
3238}
3339
34- async function verifyXcframework ( dirent : fs . Dirent ) {
40+ async function verifyApplePrebuild ( dirent : fs . Dirent ) {
41+ console . log ( "Verifying Apple prebuild" , dirent . name , "in" , dirent . parentPath ) ;
3542 for ( const arch of EXPECTED_XCFRAMEWORK_PLATFORMS ) {
3643 const archDir = path . join ( dirent . parentPath , dirent . name , arch ) ;
3744 for ( const file of await fs . promises . readdir ( archDir , {
@@ -75,16 +82,17 @@ async function verifyXcframework(dirent: fs.Dirent) {
7582 }
7683}
7784
78- for ( const dirent of await fs . promises . readdir ( EXAMPLES_DIR , {
85+ for await ( const dirent of fs . promises . glob ( "**/*.*.node" , {
86+ cwd : EXAMPLES_DIR ,
7987 withFileTypes : true ,
80- recursive : true ,
8188} ) ) {
82- if ( ! dirent . isDirectory ( ) ) {
83- continue ;
84- }
8589 if ( dirent . name . endsWith ( ".android.node" ) ) {
86- await verifyAndroidDirectory ( dirent ) ;
87- } else if ( dirent . name . endsWith ( ".xcframework" ) ) {
88- await verifyXcframework ( dirent ) ;
90+ await verifyAndroidPrebuild ( dirent ) ;
91+ } else if ( dirent . name . endsWith ( ".apple.node" ) ) {
92+ await verifyApplePrebuild ( dirent ) ;
93+ } else {
94+ throw new Error (
95+ `Unexpected prebuild file: ${ dirent . name } in ${ dirent . parentPath } `
96+ ) ;
8997 }
9098}
0 commit comments