Back to Flutter Rust Bridge

Frb Codegen Command Generate

website/docs/generated/_frb-codegen-command-generate.mdx

2.12.04.0 KB
Original Source
Execute the main code generator

Usage: flutter_rust_bridge_codegen generate [OPTIONS]

Options:
      --watch
          Automatically re-generate the output whenever the changes are detected on the input files

      --config-file <CONFIG_FILE>
          Path to a YAML config file.
          
          If present, other options and flags will be ignored. Accepts the same options as the CLI, but uses snake_case keys.

  -r, --rust-input <RUST_INPUT>
          Input Rust files, such as `crate::api,crate::hello::world,another-third-party-crate`

  -d, --dart-output <DART_OUTPUT>
          Directory of output generated Dart code

  -c, --c-output <C_OUTPUT>
          Output path of generated C header

      --duplicated-c-output <DUPLICATED_C_OUTPUT>
          Duplicate the files generated at the location `--c-output` specifies

      --rust-root <RUST_ROOT>
          Crate directory for your Rust project

      --rust-output <RUST_OUTPUT>
          Output path of generated Rust code

      --dart-entrypoint-class-name <DART_ENTRYPOINT_CLASS_NAME>
          Generated dart entrypoint class name

      --dart-format-line-length <DART_FORMAT_LINE_LENGTH>
          Line length for Dart formatting

      --dart-preamble <DART_PREAMBLE>
          Raw header of output generated Dart code, pasted as-it-is

      --rust-preamble <RUST_PREAMBLE>
          Raw header of output generated Rust code, pasted as-it-is

      --no-dart-enums-style
          The generated Dart enums will not have their variant names camelCased

      --no-add-mod-to-lib
          Skip automatically adding `mod frb_generated;` to `lib.rs`

      --llvm-path <LLVM_PATH>...
          Path to the installed LLVM

      --llvm-compiler-opts <LLVM_COMPILER_OPTS>
          LLVM compiler opts

      --dart-root <DART_ROOT>...
          Path to root of Dart project, otherwise inferred from --dart-output

      --no-build-runner
          Skip running build_runner even when codegen-required code is detected

      --extra-headers <EXTRA_HEADERS>
          extra_headers is used to add dependencies header

      --no-web
          Disable web module generation

      --no-deps-check
          Skip dependencies check

      --default-external-library-loader-web-prefix <DEFAULT_EXTERNAL_LIBRARY_LOADER_WEB_PREFIX>
          The value for defaultExternalLibraryLoader.webPrefix

      --wasm-bindgen-name <WASM_BINDGEN_NAME>
          The name of the wasm_bindgen module

      --no-dart3
          Disable language features introduced in Dart 3

      --full-dep
          Enable full dependencies

      --default-rust-opaque-codec <DEFAULT_RUST_OPAQUE_CODEC>
          Default implementation of rust opaque

          Possible values:
          - moi: Use moi codec
          - nom: Use nom codec

      --enable-lifetime
          Enable parsing types with lifetimes (e.g. references and borrows)

      --type-64bit-int
          Let 64 bit types be translated to `int`s instead of types like `BigInt`s

      --no-default-dart-async
          Whether default Dart code is asynchronous or synchronous

      --no-auto-upgrade-dependency
          Whether to skip auto upgrading the dependencies

      --parse-const
          Whether to automatically parse constants

      --no-dart-format
          Whether to disable automatic Dart formatting

      --no-dart-fix
          Whether to disable automatic Dart fix

      --no-rust-format
          Whether to disable automatic Rust formatting

      --stop-on-error
          If having error when, for example, parsing a function, directly stop instead of continue and skip it

      --dump [<DUMP>...]
          A list of data to be dumped. If specified without a value, defaults to all
          
          [possible values: config, source, hir, mir, generator-info, generator-spec, generator-text]

      --dump-all
          Dump all internal data. Same as `--dump` with all possible choices chosen

      --rust-features <RUST_FEATURES>
          List of cargo feature flags to enable when generating

  -h, --help
          Print help (see a summary with '-h')