moduleSpecFiles function
.native.dart files under libDir that declare a @NitroModule. Type-only
files (shared @HybridStruct/@HybridEnum/@HybridRecord) are not modules: no
registry, JNI bridge, SwiftPM target or CMake library of their own.
Implementation
List<File> moduleSpecFiles(Directory libDir) => libDir.existsSync()
? libDir.listSync(recursive: true).whereType<File>().where((f) => f.path.endsWith('.native.dart') && declaresNitroModule(f.readAsStringSync())).toList()
: <File>[];