[go: nahoru, domu]

Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Cleanup old Dart SDK layout compatibility (#118819)
Browse files Browse the repository at this point in the history
The changes to the Dart SDK have rolled so the backward compatibility
is no longer needed.
  • Loading branch information
nshahan committed Jan 24, 2023
1 parent c35efda commit 3735231
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 50 deletions.
32 changes: 7 additions & 25 deletions packages/flutter_tools/lib/src/isolated/devfs_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -926,31 +926,13 @@ class WebDevFS implements DevFS {
}

@visibleForTesting
final File requireJS = (() {
// TODO(nshahan): Remove the initilizing function once the file location
// change in the Dart SDK has landed and rolled to the engine
// and flutter repos. There is no long-term need for the
// fallback logic.
// See https://github.com/flutter/flutter/issues/118119
final File oldFile = globals.fs.file(globals.fs.path.join(
globals.artifacts!.getArtifactPath(Artifact.engineDartSdkPath, platform: TargetPlatform.web_javascript),
'lib',
'dev_compiler',
'kernel',
'amd',
'require.js',
));

return oldFile.existsSync()
? oldFile
: globals.fs.file(globals.fs.path.join(
globals.artifacts!.getArtifactPath(Artifact.engineDartSdkPath, platform: TargetPlatform.web_javascript),
'lib',
'dev_compiler',
'amd',
'require.js',
));
})();
final File requireJS = globals.fs.file(globals.fs.path.join(
globals.artifacts!.getArtifactPath(Artifact.engineDartSdkPath, platform: TargetPlatform.web_javascript),
'lib',
'dev_compiler',
'amd',
'require.js',
));

@visibleForTesting
final File stackTraceMapper = globals.fs.file(globals.fs.path.join(
Expand Down
32 changes: 7 additions & 25 deletions packages/flutter_tools/lib/src/test/flutter_web_platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -187,31 +187,13 @@ class FlutterWebPlatform extends PlatformPlugin {
));

/// The require js binary.
File get _requireJs {
// TODO(nshahan): Remove the initializing function once the file location
// change in the Dart SDK has landed and rolled to the engine
// and flutter repos. There is no long-term need for the
// fallback logic.
// See https://github.com/flutter/flutter/issues/118119
final File oldFile = _fileSystem.file(_fileSystem.path.join(
_artifacts!.getArtifactPath(Artifact.engineDartSdkPath, platform: TargetPlatform.web_javascript),
'lib',
'dev_compiler',
'kernel',
'amd',
'require.js',
));

return oldFile.existsSync()
? oldFile
: _fileSystem.file(_fileSystem.path.join(
_artifacts!.getArtifactPath(Artifact.engineDartSdkPath, platform: TargetPlatform.web_javascript),
'lib',
'dev_compiler',
'amd',
'require.js',
));
}
File get _requireJs => _fileSystem.file(_fileSystem.path.join(
_artifacts!.getArtifactPath(Artifact.engineDartSdkPath, platform: TargetPlatform.web_javascript),
'lib',
'dev_compiler',
'amd',
'require.js',
));

/// The ddc to dart stack trace mapper.
File get _stackTraceMapper => _fileSystem.file(_fileSystem.path.join(
Expand Down

0 comments on commit 3735231

Please sign in to comment.