[flutter_tools] introduce a BuildSystem interface (#56946)
This commit is contained in:
@@ -464,7 +464,11 @@ void main() {
|
||||
});
|
||||
|
||||
testWithoutContext('trackSharedBuildDirectory handles a missing .last_build_id', () {
|
||||
BuildSystem.trackSharedBuildDirectory(environment, fileSystem, <String, File>{});
|
||||
FlutterBuildSystem(
|
||||
fileSystem: fileSystem,
|
||||
logger: BufferLogger.test(),
|
||||
platform: FakePlatform(),
|
||||
).trackSharedBuildDirectory(environment, fileSystem, <String, File>{});
|
||||
|
||||
expect(environment.outputDir.childFile('.last_build_id'), exists);
|
||||
expect(environment.outputDir.childFile('.last_build_id').readAsStringSync(),
|
||||
@@ -475,7 +479,11 @@ void main() {
|
||||
environment.outputDir.childFile('.last_build_id')
|
||||
..writeAsStringSync('6666cd76f96956469e7be39d750cc7d9')
|
||||
..setLastModifiedSync(DateTime(1991, 8, 23));
|
||||
BuildSystem.trackSharedBuildDirectory(environment, fileSystem, <String, File>{});
|
||||
FlutterBuildSystem(
|
||||
fileSystem: fileSystem,
|
||||
logger: BufferLogger.test(),
|
||||
platform: FakePlatform(),
|
||||
).trackSharedBuildDirectory(environment, fileSystem, <String, File>{});
|
||||
|
||||
expect(environment.outputDir.childFile('.last_build_id').lastModifiedSync(),
|
||||
DateTime(1991, 8, 23));
|
||||
@@ -491,7 +499,11 @@ void main() {
|
||||
environment.outputDir
|
||||
.childFile('stale')
|
||||
.createSync();
|
||||
BuildSystem.trackSharedBuildDirectory(environment, fileSystem, <String, File>{});
|
||||
FlutterBuildSystem(
|
||||
fileSystem: fileSystem,
|
||||
logger: BufferLogger.test(),
|
||||
platform: FakePlatform(),
|
||||
).trackSharedBuildDirectory(environment, fileSystem, <String, File>{});
|
||||
|
||||
expect(environment.outputDir.childFile('.last_build_id').readAsStringSync(),
|
||||
'6666cd76f96956469e7be39d750cc7d9');
|
||||
@@ -510,7 +522,11 @@ void main() {
|
||||
..createSync();
|
||||
otherBuildDir.childFile('outputs.json')
|
||||
.writeAsStringSync(json.encode(<String>[staleFile.absolute.path]));
|
||||
BuildSystem.trackSharedBuildDirectory(environment, fileSystem, <String, File>{});
|
||||
FlutterBuildSystem(
|
||||
fileSystem: fileSystem,
|
||||
logger: BufferLogger.test(),
|
||||
platform: FakePlatform(),
|
||||
).trackSharedBuildDirectory(environment, fileSystem, <String, File>{});
|
||||
|
||||
expect(environment.outputDir.childFile('.last_build_id').readAsStringSync(),
|
||||
'6666cd76f96956469e7be39d750cc7d9');
|
||||
@@ -568,7 +584,7 @@ void main() {
|
||||
}
|
||||
|
||||
BuildSystem setUpBuildSystem(FileSystem fileSystem) {
|
||||
return BuildSystem(
|
||||
return FlutterBuildSystem(
|
||||
fileSystem: fileSystem,
|
||||
logger: BufferLogger.test(),
|
||||
platform: FakePlatform(operatingSystem: 'linux'),
|
||||
|
||||
Reference in New Issue
Block a user