Skip to content

add a builder to clean up transitive digests #3625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions _test/test/goldens/generated_build_script.dart
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,16 @@ final _builders = <_i1.BuilderApplication>[
_i1.toAllPackages(),
isOptional: true,
hideOutput: true,
appliesBuilders: const [r'build_resolvers:transitive_digest_cleanup'],
),
_i1.applyPostProcess(
r'build_modules:module_cleanup',
_i6.moduleCleanup,
),
_i1.applyPostProcess(
r'build_resolvers:transitive_digest_cleanup',
_i8.transitiveDigestCleanup,
),
_i1.applyPostProcess(
r'build_web_compilers:dart2js_archive_extractor',
_i3.dart2jsArchiveExtractor,
Expand Down
4 changes: 4 additions & 0 deletions build_resolvers/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.4.2

- Add a builder to clean up transitive digest files from the build output.

## 2.4.1

- Fix an issue where deleted files were not removed from the analysis engine,
Expand Down
6 changes: 6 additions & 0 deletions build_resolvers/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ builders:
is_optional: True
required_inputs: [".dart"]
build_to: cache
applies_builders:
- :transitive_digest_cleanup
post_process_builders:
transitive_digest_cleanup:
import: "package:build_resolvers/builder.dart"
builder_factory: transitiveDigestCleanup
4 changes: 4 additions & 0 deletions build_resolvers/lib/builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import 'src/build_asset_uri_resolver.dart';

Builder transitiveDigestsBuilder(_) => _TransitiveDigestsBuilder();

PostProcessBuilder transitiveDigestCleanup(BuilderOptions options) =>
FileDeletingBuilder([transitiveDigestExtension],
isEnabled: options.config['enabled'] as bool? ?? true);

/// Computes a digest comprised of the current libraries digest as well as its
/// transitive dependency digests, and writes it to a file next to the library.
///
Expand Down
2 changes: 1 addition & 1 deletion build_resolvers/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: build_resolvers
version: 2.4.1
version: 2.4.2
description: Resolve Dart code in a Builder
repository: https://github.com/dart-lang/build/tree/master/build_resolvers

Expand Down