native icon indicating copy to clipboard operation
native copied to clipboard

[jnigen] Output dependencies

Open dcharkes opened this issue 1 year ago • 0 comments

If JNIgen is run as part of another build system (https://github.com/dart-lang/native/pull/977#issuecomment-1984614525), or if JNIgen is run as standalone (https://github.com/dart-lang/native/issues/879), it would be useful to know what files an JNIgen run transitively depends on.

The list of files / directories / glob patterns should include:

  • entrypoints headers declared in config.
  • Any transitive dependencies (can libclang report what was used? Would using include directive suffice?)
  • pubspec.yaml ffigen version might be updated
  • jnigen.yaml the config file (@HosseinYousefi how would this work once we switch to a programmatic config? I guess the dart script running JNIgen would need to be in the deps.)

For standalone runs:

  • We should maybe save the environment, so that subsequent runs can check for equality.

For runs from another build system:

  • We should maybe have a flag in the config to ignore the environment (A build system invoking might also try to invoke FFIgen with a (mostly) empty environment https://github.com/dart-lang/native/issues/32)

The list of files/directories/globs should be output in some kind of format. (Maybe we should align with the BuildOutput.dependencies in the native assets CLI, which currently supports files and directories.)

dcharkes avatar Mar 14 '24 09:03 dcharkes