Skip to content

Commit 304ea5c

Browse files
authored
Merge pull request #4 from danieletulone/main
Upgrade analyzer, sdk, build runner, dart_style and source_gen
2 parents 69290dd + a8c79c4 commit 304ea5c

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

lib/src/builders/synthetic_builder.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ abstract class SyntheticBuilder<S extends SyntheticInput> implements Builder {
3030
this.header = '',
3131
this.footer = '',
3232
Formatter? formatter,
33-
}) : formatter = formatter ?? DartFormatter().format,
33+
}) : formatter = formatter ??
34+
DartFormatter(languageVersion: DartFormatter.latestLanguageVersion)
35+
.format,
3436
syntheticInput = SyntheticInput.instance<S>();
3537

3638
/// Input files. Specify the complete path relative to the
@@ -123,8 +125,8 @@ abstract class SyntheticBuilder<S extends SyntheticInput> implements Builder {
123125
// Read library.
124126
final library = await buildStep.resolver.libraryFor(assetId);
125127
// Get dependencies
126-
for (final import in library.libraryImports) {
127-
final uri = Uri.parse(import.uri.toString());
128+
for (final import in library.importedLibraries) {
129+
final uri = Uri.parse(import.source.uri.toString());
128130
// Skip if uri scheme is not "package" or "asset".
129131
if (uri.scheme == 'package' ||
130132
uri.scheme == 'asset' ||

pubspec.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,22 @@ topics:
1313
- build-runner
1414
- source-code-generator
1515

16-
17-
1816
environment:
19-
sdk: '^3.0.0'
17+
sdk: '^3.6.0'
2018

2119
dependencies:
22-
analyzer: ^6.4.1
20+
analyzer: ^7.0.0
2321
build: ^2.4.1
24-
build_runner: ^2.4.9
25-
dart_style: ^2.3.6
22+
build_runner: ^2.4.14
23+
dart_style: ^3.0.1
2624
directed_graph: ^0.4.3
2725
exception_templates: ^0.3.0
2826
file: ^7.0.0
2927
glob: ^2.1.2
3028
lazy_memo: ^0.2.3
3129
path: ^1.9.0
32-
source_gen: ^1.5.0
30+
source_gen: ^2.0.0
31+
3332
#dependency_overrides:
3433
# source_gen:
3534
# git:

0 commit comments

Comments
 (0)