Skip to content

[native_assets_cli] Add workspace path to input #2187

Closed
@simolus3

Description

@simolus3

I'm adopting user-defines for my native_assets package (thanks for shipping that btw! 🚀 ). One of the options I'd like to provide is for users to specify a custom C source file that would be used instead of (or in addition to) the default sources used by my package.

I'm imagining that users would configure this like that:

hooks:
  user_defines:
    sqlite3_native_assets:
      source:
        local: my_sqlite.c # file in the package applying mine

My build hooks are then reading that option and can use that as an input. However, since all paths resolve against my own package (#1915), I need a way to figure out the root input package in some cases. At the moment, I'm reconstructing it from the output path but I'd like something more reliable than this:

  @override
  String inputPath(String path) => absolute(
    normalize(join(input.outputDirectory.path, '../../../../../../', path)),
  );

I couldn't find anything in HookInputs that provides that root input path.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions