[web] use 'dart compile js' instead of 'dart2js' in web_ui and felt (flutter/engine#29179)

This commit is contained in:
sigmundch
2021-10-14 14:33:01 -07:00
committed by GitHub
parent edb91badae
commit 357aae21f0
4 changed files with 8 additions and 12 deletions

View File

@@ -92,10 +92,6 @@ class Environment {
/// The "pub" executable file.
String get pubExecutable => pathlib.join(dartSdkDir.path, 'bin', 'pub');
/// The "dart2js" executable file.
String get dart2jsExecutable =>
pathlib.join(dartSdkDir.path, 'bin', 'dart2js');
/// Path to where github.com/flutter/engine is checked out inside the engine workspace.
io.Directory get flutterDirectory =>
io.Directory(pathlib.join(engineSrcDir.path, 'flutter'));

View File

@@ -34,13 +34,13 @@ DART_SDK_DIR="${ENGINE_SRC_DIR}/out/host_debug_unopt/dart-sdk"
GN="${FLUTTER_DIR}/tools/gn"
DART_TOOL_DIR="${WEB_UI_DIR}/.dart_tool"
PUB_PATH="$DART_SDK_DIR/bin/pub"
DART2JS_PATH="$DART_SDK_DIR/bin/dart2js"
DART_PATH="$DART_SDK_DIR/bin/dart"
SNAPSHOT_PATH="${DART_TOOL_DIR}/felt.snapshot"
STAMP_PATH="${DART_TOOL_DIR}/felt.snapshot.stamp"
SCRIPT_PATH="${DEV_DIR}/felt.dart"
REVISION="$(cd "$FLUTTER_DIR"; git rev-parse HEAD)"
if [ ! -f "${PUB_PATH}" -o ! -f "${DART2JS_PATH}" ]
if [ ! -f "${PUB_PATH}" -o ! -f "${DART_PATH}" ]
then
echo "Compiling the Dart SDK."
gclient sync

View File

@@ -136,6 +136,8 @@ Future<bool> compileUnitTest(FilePath input, { required bool forCanvasKit }) asy
}
final List<String> arguments = <String>[
'compile',
'js',
'--no-minify',
'--disable-inlining',
'--enable-asserts',
@@ -155,7 +157,7 @@ Future<bool> compileUnitTest(FilePath input, { required bool forCanvasKit }) asy
];
final int exitCode = await runProcess(
environment.dart2jsExecutable,
environment.dartExecutable,
arguments,
workingDirectory: environment.webUiRootDir.path,
);
@@ -196,8 +198,10 @@ Future<void> buildHostPage() async {
}
final int exitCode = await runProcess(
environment.dart2jsExecutable,
environment.dartExecutable,
<String>[
'compile',
'js',
hostDartPath,
'-o',
'$hostDartPath.js',

View File

@@ -111,10 +111,6 @@ class Environment {
/// The "pub" executable file.
String get pubExecutable => pathlib.join(dartSdkDir.path, 'bin', 'pub');
/// The "dart2js" executable file.
String get dart2jsExecutable =>
pathlib.join(dartSdkDir.path, 'bin', 'dart2js');
/// Path to where github.com/flutter/engine is checked out inside the engine workspace.
io.Directory get flutterDirectory =>
io.Directory(pathlib.join(engineSrcDir.path, 'flutter'));