testing library

Test support for native-api-bindgen packages: compiles the synthetic Java fixtures and builds an extractor over them. Not for production use.

Constants

fixtureNonSdkClasses → const Set<String>
Classes excluded from the synthetic API list (simulated non-SDK API) and annotation stubs that are not part of the fixture API surface.
fixturePackages → const List<String>
All fixture API classes (excluding annotation stubs).

Properties

javacAvailable → bool
Whether javac is available (fixture tests skip otherwise).
no setter

Functions

compileFixtures({String name = 'basic'}) → Directory
Compiles fixtures/java/<name>/src with javac --release 17 -g into a fresh temporary directory and returns it.
compileKotlinStubs() → Directory
Compiles fixtures/java/kotlin-stubs into a fresh temporary directory.
extractFixtures(AndroidApiExtractor extractor) → ApiModule
Convenience: extract the whole fixture package.
extractKotlinFixtures(String jar) → ApiModule
Extracts the Kotlin fixture classes from jar as library APIs.
findRepoRoot([String? start]) → String
Repository root, located by walking up to the workspace pubspec.
fixtureAnnotationsZip(Directory dir) → String?
Packs fixtures/java/basic/annotations (external annotations in the annotations.zip layout) into <dir>/annotations.zip with the JDK's jar tool. Returns null when jar is unavailable.
fixtureApiVersionsXml(DirectoryClassSource classes) → String
Builds a complete synthetic api-versions.xml for classes: every public class and member is listed at since="1", except fixtureNonSdkClasses; classes present in the hand-written fixtures/java/basic/api-versions.xml are taken verbatim from it (so availability tests control them exactly).
fixtureExtractor() → ({Directory classesDir, AndroidApiExtractor extractor})
An extractor over freshly compiled fixtures with the synthetic API list. Documentation links are disabled (fixtures have no official pages).
kotlinFixtureJar() → String?
fixtures/kotlin/basic/build/libs/kfixtures.jar if it was built (with Gradle, see fixtures/kotlin/basic/build.gradle.kts), else null.