Skip to content

Commit

Permalink
Removed dep on package meta.
Browse files Browse the repository at this point in the history
  • Loading branch information
simphotonics committed Apr 4, 2024
1 parent 931ea67 commit 54349e7
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 56 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.2.6
* Updated dependencies.
* Removed dependency on package `meta`.

## 0.2.5

* Updated examples and docs.
Expand Down
3 changes: 0 additions & 3 deletions lib/merging_builder.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/// Library providing the builders [MergingBuilder] and [StandaloneBuilder].
/// * Note: The builders use synthetic input.
export 'src/builders/merging_builder.dart';
export 'src/generators/merging_generator.dart';
export 'src/builders/standalone_builder.dart';
Expand Down
17 changes: 6 additions & 11 deletions lib/src/builders/merging_builder.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import 'dart:async';

import 'package:build/build.dart';
import 'package:exception_templates/exception_templates.dart';
import 'package:glob/glob.dart';
import 'package:path/path.dart' as path show equals;
import 'package:source_gen/source_gen.dart' show LibraryReader;

import '../generators/merging_generator.dart';
import 'formatter.dart';
import 'synthetic_builder.dart';
import 'synthetic_input.dart';

Expand All @@ -33,19 +33,14 @@ class MergingBuilder<T, S extends SyntheticInput> extends SyntheticBuilder<S> {
/// source code contains invalid syntax. To temporarily suppress formatting
/// use: `(String input) => input`.
MergingBuilder({
String inputFiles = 'lib/*.dart',
super.inputFiles = 'lib/*.dart',
this.outputFile = 'lib/merged_output.dart',
required this.generator,
String header = '',
String footer = '',
super.header,
super.footer,
this.sortAssets = false,
Formatter? formatter,
}) : super(
inputFiles: inputFiles,
header: header,
footer: footer,
formatter: formatter,
);
super.formatter,
});

/// Path to output file relative to the package root directory.
/// Example: `lib/merged_output.dart`
Expand Down
19 changes: 7 additions & 12 deletions lib/src/builders/standalone_builder.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:async';

import 'package:build/build.dart';
import 'package:exception_templates/exception_templates.dart';
import 'package:file/local.dart';
Expand All @@ -7,9 +8,8 @@ import 'package:lazy_memo/lazy_memo.dart';
import 'package:path/path.dart' as path;
import 'package:source_gen/source_gen.dart' show Generator, LibraryReader;

import 'formatter.dart';
import 'synthetic_input.dart';
import 'synthetic_builder.dart';
import 'synthetic_input.dart';

/// Builder that uses synthetic input and
/// creates one output file for each input file.
Expand Down Expand Up @@ -37,19 +37,14 @@ class StandaloneBuilder<S extends SyntheticInput> extends SyntheticBuilder<S> {
/// To disable formatting one may pass a closure returning the
/// input: `(input) => input` as argument for `formatter`.
StandaloneBuilder({
String inputFiles = 'lib/*.dart',
super.inputFiles = 'lib/*.dart',
this.outputFiles = 'lib/standalone_(*).dart',
required this.generator,
String header = '',
String footer = '',
Formatter? formatter,
super.header,
super.footer,
super.formatter,
String root = '',
}) : root = root.trim(),
super(
inputFiles: inputFiles,
header: header,
footer: footer,
formatter: formatter) {
}) : root = root.trim() {
_resolvedOutputFiles = Lazy(_outputPaths);
}

Expand Down
13 changes: 5 additions & 8 deletions lib/src/builders/synthetic_input.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import 'package:exception_templates/exception_templates.dart';
import 'package:meta/meta.dart';

/// Base class representing synthetic builder input.
/// For more information about synthetic input see:
/// [Writing an Aggregate Builder](https://github.com/dart-lang/build/blob/master/docs/writing_an_aggregate_builder.md#writing-the-builder-using-a-synthetic-input).
abstract class SyntheticInput {
sealed class SyntheticInput {
const SyntheticInput._(this.value);

/// String value.
Expand Down Expand Up @@ -52,9 +51,8 @@ abstract class SyntheticInput {
/// Synthetic input representing files under the `lib` directory.
/// For more information about synthetic input see:
/// [Writing an Aggregate Builder](https://github.com/dart-lang/build/blob/master/docs/writing_an_aggregate_builder.md#writing-the-builder-using-a-synthetic-input).
@sealed
class LibDir extends SyntheticInput {
const LibDir._(String value) : super._(value);
final class LibDir extends SyntheticInput {
const LibDir._(super.value) : super._();

static LibDir? _instance;

Expand All @@ -69,9 +67,8 @@ class LibDir extends SyntheticInput {
/// Synthetic input representing files under the `root` directory.
/// For more information about synthetic input see:
/// [Writing an Aggregate Builder](https://github.com/dart-lang/build/blob/master/docs/writing_an_aggregate_builder.md#writing-the-builder-using-a-synthetic-input).
@sealed
class PackageDir extends SyntheticInput {
const PackageDir._(String value) : super._(value);
final class PackageDir extends SyntheticInput {
const PackageDir._(super.value) : super._();

static PackageDir? _instance;

Expand Down
36 changes: 17 additions & 19 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,33 @@ description: MergingBuilder reads several input files and writes merged output
to one file. StandaloneBuilder enables output to a custom folder with custom
output file name.

version: 0.2.5
version: 0.2.6

homepage: https://github.com/simphotonics/merging_builder

environment:
sdk: '>=2.17.0 <3.0.0'
sdk: '^3.0.0'

dependencies:
analyzer: ^5.4.0
build: ^2.3.1
build_runner: ^2.3.3
dart_style: ^2.2.4
directed_graph: ^0.3.7
exception_templates: ^0.2.1
file: ^6.1.4
glob: ^2.1.1
lazy_memo: ^0.1.2
meta: ^1.8.0
path: ^1.8.3
quote_buffer: ^0.2.3
source_gen: ^1.2.6
analyzer: ^6.4.1
build: ^2.4.1
build_runner: ^2.4.9
dart_style: ^2.3.6
directed_graph: ^0.4.1
exception_templates: ^0.3.0
file: ^7.0.0
glob: ^2.1.2
lazy_memo: ^0.2.2
path: ^1.9.0
quote_buffer: ^0.2.5
source_gen: ^1.5.0
dependency_overrides: null
# source_gen:
# git:
# url: [email protected]:dart-lang/source_gen.git
# ref: master
# path: source_gen
dev_dependencies:
build_test: ^2.1.5
crypto: ^3.0.2
lints: ^2.0.1
test: ^1.22.1
build_test: ^2.2.2
lints: ^3.0.0
test: ^1.25.2
6 changes: 3 additions & 3 deletions test/build_extensions_test.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:build/src/builder/build_step.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:exception_templates/exception_templates.dart';
import 'dart:async';

import 'package:analyzer/dart/element/element.dart';
import 'package:build/src/builder/build_step.dart';
import 'package:exception_templates/exception_templates.dart';
import 'package:merging_builder/merging_builder.dart';
import 'package:source_gen/src/constants/reader.dart';
import 'package:test/test.dart';
Expand Down

0 comments on commit 54349e7

Please sign in to comment.