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
javacis available (fixture tests skip otherwise).no setter
Functions
-
compileFixtures(
{String name = 'basic'}) → Directory -
Compiles
fixtures/java/<name>/srcwithjavac --release 17 -ginto a fresh temporary directory and returns it. -
compileKotlinStubs(
) → Directory -
Compiles
fixtures/java/kotlin-stubsinto a fresh temporary directory. -
extractFixtures(
AndroidApiExtractor extractor) → ApiModule - Convenience: extract the whole fixture package.
-
extractKotlinFixtures(
String jar) → ApiModule -
Extracts the Kotlin fixture classes from
jaras 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 theannotations.ziplayout) into<dir>/annotations.zipwith the JDK'sjartool. Returns null whenjaris unavailable. -
fixtureApiVersionsXml(
DirectoryClassSource classes) → String -
Builds a complete synthetic
api-versions.xmlforclasses: every public class and member is listed atsince="1", except fixtureNonSdkClasses; classes present in the hand-writtenfixtures/java/basic/api-versions.xmlare 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.jarif it was built (with Gradle, seefixtures/kotlin/basic/build.gradle.kts), else null.