Skip to content

[native_assets_builder] build.dart dependencies cannot be dev dependencies. #160

Closed
@dcharkes

Description

@dcharkes

TODO for closing this issue: Add a check somewhere, or add documentation.

Consider package:my_app depends on package:foo, and package:foo has a build.dart using package:http to download a dylib from a CIDN.

A. If package:foo would only add package:http as a dev dependency, then

  1. (current behavior) the native assets builder will invoke the build.dart with the root package (package:my_app) package_config.json, and the build.dart invocation will fail, or
  2. (possible alternative behavior) the native assets builder will run pub get inside the pub cache containing package:foo and use the resulting package config to run build.dart.

B. If package:foo adds package:http as a normal dependency, then

  1. (current behavior) the native assets builder will invoke the build.dart with the root package (package:my_app) package_config.json, and the build.dart invocation will succeed.

So with the current setup, build.dart dependencies must be added as normal dependencies, not dev dependencies.

@jonasfj would probably not enjoy us running pub get inside the pub cache.

Switching to the alternative behavior A.2. enables various build.dart scripts to rely on incompatible versions of package:http.

However, build.dart does not need all the other dev dependencies, nor possibly the main dependencies. So this sounds like another hint in the direction of introducing build_dependencies.

Thanks for reporting @craiglabenz!

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions