mirror of https://github.com/AMT-Cheif/drift.git
Disable our own caching algorithm across build steps
This commit is contained in:
parent
a17448683e
commit
a1f9e7ce13
|
@ -133,6 +133,7 @@ class Task {
|
|||
}
|
||||
break;
|
||||
default:
|
||||
assert(false, 'Unknown file type ${file.type}');
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ import 'package:analyzer/dart/element/element.dart';
|
|||
import 'package:build/build.dart' hide log;
|
||||
import 'package:build/build.dart' as build show log;
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:moor_generator/src/analyzer/runner/file_graph.dart';
|
||||
import 'package:moor_generator/src/backends/backend.dart';
|
||||
|
||||
class BuildBackend extends Backend {
|
||||
|
@ -53,13 +52,4 @@ class BuildBackendTask extends BackendTask {
|
|||
Future<bool> exists(Uri uri) {
|
||||
return step.canRead(_resolve(uri));
|
||||
}
|
||||
|
||||
Future finish(FoundFile inputFile) async {
|
||||
// the result could be cached if it was calculated in a previous build step.
|
||||
// we need to can canRead so that the build package can calculate the
|
||||
// dependency graph correctly
|
||||
for (var transitiveImport in backend.session.fileGraph.crawl(inputFile)) {
|
||||
await step.canRead(_resolve(transitiveImport.uri));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,8 +8,6 @@ import 'package:source_gen/source_gen.dart';
|
|||
|
||||
part 'options.dart';
|
||||
|
||||
final backendResource = Resource(() => BuildBackend());
|
||||
|
||||
class MoorBuilder extends SharedPartBuilder {
|
||||
final MoorOptions options;
|
||||
|
||||
|
@ -36,7 +34,7 @@ class MoorBuilder extends SharedPartBuilder {
|
|||
Writer createWriter() => Writer(options);
|
||||
|
||||
Future<ParsedDartFile> analyzeDartFile(BuildStep step) async {
|
||||
final backend = await step.fetchResource(backendResource);
|
||||
final backend = BuildBackend();
|
||||
final backendTask = backend.createTask(step);
|
||||
final session = backend.session;
|
||||
|
||||
|
@ -46,8 +44,6 @@ class MoorBuilder extends SharedPartBuilder {
|
|||
|
||||
task.printErrors();
|
||||
|
||||
await backendTask.finish(input);
|
||||
|
||||
return input.currentResult as ParsedDartFile;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue