Skip to content

Commit

Permalink
Fix path for require.js (#118722)
Browse files Browse the repository at this point in the history
Matches new location in the Dart SDK.
https://dart-review.googlesource.com/c/sdk/+/275482

Includes fall back logic so the old file location will continue to be used
until the new location change lands. Then we can remove the logic and only
use the new location in a future change.

Issue: #118119
  • Loading branch information
nshahan committed Jan 18, 2023
1 parent ae1cc18 commit bb8b96a
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions packages/flutter_tools/lib/src/test/flutter_web_platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,31 @@ class FlutterWebPlatform extends PlatformPlugin {
));

/// The require js binary.
File get _requireJs => _fileSystem.file(_fileSystem.path.join(
_artifacts!.getArtifactPath(Artifact.engineDartSdkPath, platform: TargetPlatform.web_javascript),
'lib',
'dev_compiler',
'kernel',
'amd',
'require.js',
));
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',
));
}

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

0 comments on commit bb8b96a

Please sign in to comment.