PlatformTargetAnalyzer class

Parses the @NitroModule(...) annotation from a spec file once and exposes typed query methods for each platform target.

Replaces five independent regex passes with a single parse so callers that need multiple platform attributes (e.g. discoverModuleInfos) avoid re-reading and re-matching the annotation for every query.

final analyzer = PlatformTargetAnalyzer.fromSpec(specFile);
if (analyzer.requiresCpp) { /* at least one platform is C++ */ }
if (analyzer.supportsApple) { /* ios or macos is C++ */ }

Constructors

PlatformTargetAnalyzer.fromContent(String content)
Parses the annotation from already-loaded content (zero file reads).
factory
PlatformTargetAnalyzer.fromSpec(File specFile)
Parses the annotation from specFile (one file read, one regex match).
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
isNativeCpp bool
True when Android or Linux use direct C++ (src/CMakeLists.txt NDK/GCC path).
no setter
requestsSeparateLinuxImpl bool
True when the annotation spells Linux's implementation using the SPECIFIC LinuxNativeImpl.cpp marker rather than the generic NativeImpl.cpp shorthand. See requestsSeparateWindowsImpl — same mechanism, independent per platform.
no setter
requestsSeparateWindowsImpl bool
True when the annotation spells Windows's implementation using the SPECIFIC WindowsNativeImpl.cpp marker rather than the generic NativeImpl.cpp shorthand. Both resolve to the identical CppImpl singleton at the type level (see nitro_annotations/lib/src/annotations.dart) — this distinction only exists in the SOURCE TEXT, which is exactly what this (link-time, regex-based) analyzer reads.
no setter
requiresCpp bool
True when at least one platform uses direct C++ (broad check). Matches ios, android, macos, windows, and linux C++ declarations.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportsAndroid bool
True when Android uses direct C++ (bypasses JNI bridge).
no setter
supportsApple bool
True when iOS or macOS use direct C++ (Apple platforms only).
no setter
supportsIosCpp bool
True when only iOS uses direct C++ (not macOS).
no setter
supportsLinux bool
True when Linux uses direct C++ — distinct from isNativeCpp, which is true for android OR linux and can't tell them apart.
no setter
supportsMacosCpp bool
True when only macOS uses direct C++ (not iOS).
no setter
supportsWindows bool
True when Windows uses direct C++ (windows/CMakeLists.txt path).
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited