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

dart-lang / native / 14492079124
76%

Build:
DEFAULT BRANCH: main
Ran 16 Apr 2025 11:56AM UTC
Jobs 9
Files 69
Run time 1min
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: 75.75%. First build
14492079124

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)

35 of 127 new or added lines in 5 files covered. (27.56%)

3558 of 4697 relevant lines covered (75.75%)

21.29 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
4
88.89
pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart
15
83.2
pkgs/native_assets_cli/lib/src/config.dart
24
0.0
pkgs/native_assets_cli/lib/src/user_defines.dart
49
57.84
pkgs/native_assets_cli/lib/src/hooks/syntax.g.dart
Subprojects
ID Flag name Job ID Ran Files Coverage
1 native_assets_cli_windows 14492079124.1 16 Apr 2025 11:58AM UTC 32
63.75
GitHub Action Run
2 native_toolchain_c_ubuntu 14492079124.2 16 Apr 2025 11:57AM UTC 26
74.47
GitHub Action Run
3 native_assets_builder_macos 14492079124.3 16 Apr 2025 11:59AM UTC 11
87.67
GitHub Action Run
4 native_assets_cli_ubuntu 14492079124.4 16 Apr 2025 11:57AM UTC 32
63.85
GitHub Action Run
5 native_toolchain_c_windows 14492079124.5 16 Apr 2025 12:00PM UTC 26
79.08
GitHub Action Run
6 native_toolchain_c_macos 14492079124.6 16 Apr 2025 11:56AM UTC 26
68.88
GitHub Action Run
7 native_assets_builder_ubuntu 14492079124.7 16 Apr 2025 12:01PM UTC 11
87.67
GitHub Action Run
8 native_assets_cli_macos 14492079124.8 16 Apr 2025 11:56AM UTC 32
63.85
GitHub Action Run
9 native_assets_builder_windows 14492079124.9 16 Apr 2025 12:06PM UTC 11
87.67
GitHub Action Run
Source Files on build 14492079124
  • Tree
  • List 69
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #14492079124
  • 222eb982 on github
  • Prev Build on main (#14491769747)
  • Next Build on main (#14493027253)
  • 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