Skip to content

[objective_c] Move test/util.c to helper package (objective_c_helper)#3050

Open
Gurleen-kansray wants to merge 7 commits intodart-lang:mainfrom
Gurleen-kansray:move-util-to-helper
Open

[objective_c] Move test/util.c to helper package (objective_c_helper)#3050
Gurleen-kansray wants to merge 7 commits intodart-lang:mainfrom
Gurleen-kansray:move-util-to-helper

Conversation

@Gurleen-kansray
Copy link
Contributor

@Gurleen-kansray Gurleen-kansray commented Feb 4, 2026

Until issue #2272 is fixed, test/util.c cannot be conditionally included in test builds. This PR moves it to a separate helper package and updates the tests to import it from there.

Changes:
Created objective_c_helper with:
lib/src/util.c containing the original test C code

Updated objective_c tests to import util.dart from the helper package
Removed util.c from objective_c
Added dependency_overrides in pubspec.yaml for local helper package:

objective_c_helper:
path: ../objective_c_helper

Commits:
Move test/util.c to helper package
Remove test/util.c from objective_c
Update test imports to use objective_c_helper
Update pubspec.yaml

[x] I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Related issue: #2272

@Gurleen-kansray
Copy link
Contributor Author

Hi @liamappelbe , the commit adding pkgs/objective_c_helper/lib/src/util.c and pubspec.yaml is included in this branch. GitHub shows util.c as deleted from objective_c/test and updates the test files, but the new helper package files aren’t separately highlighted... that’s just how renamed/moved files appear. Everything is up-to-date and included in this PR, ready for review.

@liamappelbe liamappelbe self-requested a review February 4, 2026 23:51
@github-actions
Copy link

github-actions bot commented Feb 5, 2026

PR Health

License Headers ✔️
// Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
Files
no missing headers

All source files should start with a license header.

Unrelated files missing license headers
Files
pkgs/hooks_runner/test_data/download_assets/hook/build.dart
pkgs/jni/test/debug_release_test.dart
pkgs/objective_c/example/command_line/lib/main.dart
pkgs/objective_c/lib/src/ns_input_stream.dart

This check can be disabled by tagging the PR with skip-license-check.

API leaks ✔️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbol Leaking sources

This check can be disabled by tagging the PR with skip-leaking-check.

Breaking changes ⚠️
Package Change Current Version New Version Needed Version Looking good?
objective_c Breaking 9.2.5 9.3.0 10.0.0
Got "9.3.0" expected >= "10.0.0" (breaking changes)
⚠️
objective_c_helper Breaking 0.0.0 0.0.0 0.0.0
Report was not created for package:objective_c_helper 0.0.1 (dir=/home/runner/work/native/native/current_repo/pkgs/objective_c_helper). Error: Error: Exception: Package not available (could not find package objective_c_helper at https://pub.dev).
⚠️

This check can be disabled by tagging the PR with skip-breaking-check.

Changelog Entry
Package Changed Files
package:objective_c pkgs/objective_c/pubspec.yaml

Changes to files need to be accounted for in their respective changelogs.

This check can be disabled by tagging the PR with skip-changelog-check.

@liamappelbe
Copy link
Contributor

util.c and util.dart are two different files. You've moved util.c, but not util.dart, then you've updated all the imports for util.dart, so they now point at a non-existent file. You shouldn't just move util.dart though. There are parts of that file that should remain in pkg:objc. Only move the parts of util.dart that relate to util.c.

Anyway, the bigger part of this job is updating the build hooks. The build bot is currently failing because you moved the file without updating the hook: https://github.com/dart-lang/native/blob/main/pkgs/objective_c/hook/build.dart.

@Gurleen-kansray
Copy link
Contributor Author

Hi @liamappelbe ,this PR refactors internal utility code and updates the related build wiring.
Happy to add a changelog entry if you prefer, otherwise is skip-changelog-check okay here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants