hooks
A library that contains a Dart API for the JSON-based protocol for `hook/build.dart` and `hook/link.dart`.
2.2.0
10M downloads/mo
#22 most downloaded on pub.dev
dart-lang/native
What this package is like to depend on
Last release 6 days ago
18 Aug 2026
Ships fairly regularly
a new release about every 4 weeks
Nearly every release is documented
notes for 20 of 21 stable releases
4 versions withdrawn
withdrawn after publishing
13 years old
25 releases · first in 2013
13 releases in the last 12 months
see the full history below
Release timeline
25 releases · Aug 2013 to Aug 2026Releases
latest 25-
2.2.018 Aug 2026Release notes
Open source →- Add
ProtocolExtension.setupLogger, which the hooks runner calls to provide
the logger used for validation diagnostics before any other method is invoked
on the extension. - Fix
HookInputUserDefines.pathmangling absolute Windows paths: the drive
letter was parsed as a URI scheme. Absolute paths are now returned as-is;
relative paths are resolved against the source of the path. - Add
HookInputUserDefines.baseUri, which can be used to resolve paths
from nested user-defined options.
Release notes
Open source →- Add
ProtocolExtension.setupLogger, which the hooks runner calls to provide the logger used for validation diagnostics before any other method is invoked on the extension. - Fix
HookInputUserDefines.pathmangling absolute Windows paths: the drive letter was parsed as a URI scheme. Absolute paths are now returned as-is; relative paths are resolved against the source of the path. - Add
HookInputUserDefines.baseUri, which can be used to resolve paths from nested user-defined options.
- Add
-
2.1.013 Jul 2026 -
2.0.202 Jun 2026 -
2.0.101 Jun 2026Release notes
Open source →- Updated documentation for hook caching behavior and semi-hermetic environment variables.
-
2.0.018 May 2026Release notes
Open source →- Validate bundled dynamic libraries by reading their header: when the file is
a recognized ELF, Mach-O, or PE binary, check that it was built for the
target architecture. Reject multi-architecture Mach-O output because hooks
run once per target architecture. A file the built-in validators do not
recognize, or a recognized library built for an architecture they do not
know, warns on the supplied logger instead of failing. - Bump the dependency on
package:hooksto^2.2.0. - Breaking change: Overrode
==andhashCodeinOS,Architecture, andSanitizerto support custom targets. These objects can no longer be used as keys ofconstmaps and sets.- Migration: Use
final(runtime) maps and sets instead ofconst, or use the string representations (e.g.,OS.name,Architecture.name) as keys ifconstis required.
- Migration: Use
- Support custom target OS, architecture, and santizer in protocol extension.
Release notes
Open source →- Breaking change: Turned
ProtocolExtensioninto a base class instead of an interface, with default implementations for all methods including the newly addedoutputFiles.
- Validate bundled dynamic libraries by reading their header: when the file is
-
1.0.321 Apr 2026Release notes
Open source →- Deprecated
recordedUsagesFileinLinkInput. - Added
recordedUsesgetter toLinkInput. - Added dependency on
package:record_use.
- Deprecated
-
1.0.206 Mar 2026 -
1.0.103 Feb 2026 -
1.0.007 Nov 2025 -
0.20.527 Oct 2025 -
0.20.415 Oct 2025 -
0.20.313 Oct 2025 -
0.20.208 Oct 2025Release notes
Open source →- Change the length of the checksum used for
outputDirectoryto 10 hexadecimal characters to avoid running out of path length on Windows.
- Change the length of the checksum used for
-
0.20.127 Aug 2025Release notes
Open source →- Update outdated documentation.
- Deprecate
HookOutputBuilder.addDependencyandHookOutputBuilder.addDependenciesin favor ofHookOutputBuilder.dependencies.addandHookOutputBuilder.dependencies.addAll.
-
0.20.004 Aug 2025Release notes
Open source →- Breaking change Rename
EncodedAsset.jsonPathtoEncodedAsset.encodingJsonPath. This field only governs theEncodedAsset.encodingfield, not the whole object. - Enable passing metadata from link hooks of a package to the link hooks in dependencies, by fixing the link hook execution order.
- Breaking change Rename
-
0.19.512 Jun 2025 -
0.19.412 Jun 2025Release notes
Open source →- Fix native_toolchain_c failing with MSSSMS installed by requiring vswhere to only show output that includes the necessary build tools
- Link frameworks for C and C++ sources targeting macOS or iOS.
(#3162) - Bump
package:code_assetsdependency to^2.0.0. - Spawn all processes through a
package:processProcessManager, exposed as
an optional parameter onCBuilder.run,CLinker.run,CLibrary.build, and
CLibrary.link(defaulting toLocalProcessManager), so process invocations
can be mocked in tests. (#3072)
-
0.19.321 May 2025 -
0.19.221 May 2025Nothing published for this version
-
0.19.119 May 2025Release notes
Open source →- Added links to the
buildandlinkmethods as primary entry points. - Added failure outputs and documented exit codes.
- Added links to the
-
0.19.001 May 2025Release notes
Open source →- Split up
package:native_assets_cliinpackage:hooks,package:code_assets, andpackage:data_assets.
- Split up
-
0.1.206 Dec 2013 withdrawnNothing published for this version
-
0.1.116 Sep 2013 withdrawnNothing published for this version
-
0.1.013 Aug 2013 withdrawn -
0.0.108 Aug 2013 withdrawnNothing published for this version