Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
even better
  • Loading branch information
kevmoo committed May 2, 2023
commit 6f587604732dfa940837d176ef435d312523644f
7 changes: 5 additions & 2 deletions packages/flutter_tools/bin/fuchsia_asset_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,13 @@ Future<void> writeDepfile(AssetBundle assets, String outputManifest, String depf
assets.inputFiles,
<libfs.File>[globals.fs.file(outputManifest)],
);

final DepfileService depfileService = DepfileService(
fileSystem: globals.fs,
logger: globals.logger,
);
final libfs.File depfile = globals.fs.file(depfilePath);
await depfile.create(recursive: true);
globals.depFileService.writeToFile(depfileContent, depfile);
depfileService.writeToFile(depfileContent, depfile);
}

Future<void> writeFuchsiaManifest(AssetBundle assets, String outputBase, String fileDest, String componentName) async {
Expand Down
14 changes: 7 additions & 7 deletions packages/flutter_tools/lib/src/commands/assemble.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class AssembleCommand extends FlutterCommand {
final FlutterProject flutterProject = FlutterProject.current();
try {
return CustomDimensions(
commandBuildBundleTargetPlatform: environment.defines[kTargetPlatform],
commandBuildBundleTargetPlatform: _environment.defines[kTargetPlatform],
commandBuildBundleIsModule: flutterProject.isModule,
);
} on Exception {
Expand All @@ -151,7 +151,7 @@ class AssembleCommand extends FlutterCommand {

@override
Future<Set<DevelopmentArtifact>> get requiredArtifacts async {
final String? platform = environment.defines[kTargetPlatform];
final String? platform = _environment.defines[kTargetPlatform];
if (platform == null) {
return super.requiredArtifacts;
}
Expand Down Expand Up @@ -204,10 +204,10 @@ class AssembleCommand extends FlutterCommand {
return false;
}

late final Environment environment = createEnvironment();
late final Environment _environment = _createEnvironment();

/// The environmental configuration for a build invocation.
Environment createEnvironment() {
Environment _createEnvironment() {
final FlutterProject flutterProject = FlutterProject.current();
String? output = stringArg('output');
if (output == null) {
Expand Down Expand Up @@ -289,7 +289,7 @@ class AssembleCommand extends FlutterCommand {
Target? target;
List<String> decodedDefines;
try {
decodedDefines = decodeDartDefines(environment.defines, kDartDefines);
decodedDefines = decodeDartDefines(_environment.defines, kDartDefines);
} on FormatException {
throwToolExit(
'Error parsing assemble command: your generated configuration may be out of date. '
Expand All @@ -314,7 +314,7 @@ class AssembleCommand extends FlutterCommand {
final ArgResults argumentResults = argResults!;
final BuildResult result = await _buildSystem.build(
target!,
environment,
_environment,
buildSystemConfig: BuildSystemConfig(
resourcePoolSize: argumentResults.wasParsed('resource-pool-size')
? int.tryParse(stringArg('resource-pool-size')!)
Expand Down Expand Up @@ -346,7 +346,7 @@ class AssembleCommand extends FlutterCommand {
if (argumentResults.wasParsed('depfile')) {
final File depfileFile = globals.fs.file(stringArg('depfile'));
final Depfile depfile = Depfile(result.inputFiles, result.outputFiles);
globals.depFileService.writeToFile(depfile, globals.fs.file(depfileFile));
_environment.depFileService.writeToFile(depfile, globals.fs.file(depfileFile));
}
return FlutterCommandResult.success();
}
Expand Down
6 changes: 0 additions & 6 deletions packages/flutter_tools/lib/src/globals.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import 'base/terminal.dart';
import 'base/time.dart';
import 'base/user_messages.dart';
import 'build_system/build_system.dart';
import 'build_system/depfile.dart';
import 'cache.dart';
import 'custom_devices/custom_devices_config.dart';
import 'device.dart';
Expand Down Expand Up @@ -114,11 +113,6 @@ FileSystem get fs => ErrorHandlingFileSystem(
platform: platform,
);

DepfileService get depFileService => DepfileService(
fileSystem: localFileSystem,
logger: logger,
);

FileSystemUtils get fsUtils => context.get<FileSystemUtils>() ?? FileSystemUtils(
fileSystem: fs,
platform: platform,
Expand Down