• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dart-lang / native / 14492079124 / 4 – native_assets_cli_ubuntu
76%
main: 76%

Build:
DEFAULT BRANCH: main
Ran 16 Apr 2025 12:06PM UTC
Files 32
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

16 Apr 2025 11:55AM UTC coverage: 63.855%. First build
native_assets_cli_ubuntu – 14492079124.4

push

github

web-flow
[native_assets_cli] Add base path for user-defines (#2209)

Bug: https://github.com/dart-lang/native/issues/39
Closes: https://github.com/dart-lang/native/issues/2187
Closes: https://github.com/dart-lang/native/issues/2201

### Relative paths in user-defines accessible as absolute paths in hooks

This PR enables resolving relative paths in user-defines as absolute paths. The `input.json` now is structured as follows:

```json
{
  "user_defines": {
    "workspace_pubspec": {
      "base_path": "/private/var/folders/2y/mngq9h194yzglt4kzttzfq6800klzg/T/QqYcWN/user_defines/pubspec.yaml",
      "defines": {
        "user_define_key": "user_define_value",
        "user_define_key2": {
          "foo": "bar"
        },
        "some_file": "assets/data.json"
      }
    },
  },
}
```

We don't want to expose the workspace/pubspec path (except for resolving user-defines), so this can be done in the Dart API as follows:

```dart
extension type HookInputUserDefines._(HookInput _input) {
  /// The value for the user-define for [key] for this package.
  ///
  /// This can be arbitrary JSON/YAML if provided from the SDK from such source.
  /// If it's provided from command-line arguments, it's likely a string.
  Object? operator [](String key) => // already present before this PR

  /// The absolute path for user-defines for [key] for this package.key
  ///
  /// The relative path passed as user-define is resolved against the base path.
  /// For user-defines originating from a JSON/YAML, the base path is this
  /// JSON/YAML. For user-defines originating from command-line aruments, the
  /// base path is the working directory of the command-line invocation.
  ///
  /// If the user-define is `null` or not a [String], returns `null`.
  Uri? path(String key) => // added in this PR.
}
```

This PR does _not_ yet add support for command-line user-defines. But the JSON has been set up so that it's extensible.

### Move r... (continued)

1756 of 2750 relevant lines covered (63.85%)

3.59 hits per line

Source Files on job native_assets_cli_ubuntu - 14492079124.4
  • Tree
  • List 32
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 14492079124
  • 222eb982 on github
  • Next Job for on main (#14493027253.3)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc