Skip to content

Commit

Permalink
[web] use 'dart compile js' instead of 'dart2js' in web_ui and felt (f…
Browse files Browse the repository at this point in the history
  • Loading branch information
sigmundch authored Oct 14, 2021
1 parent 123c25b commit 97831d0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
4 changes: 0 additions & 4 deletions lib/web_ui/dev/environment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
4 changes: 2 additions & 2 deletions lib/web_ui/dev/felt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions lib/web_ui/dev/steps/compile_tests_step.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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,
);
Expand Down Expand Up @@ -196,8 +198,10 @@ Future<void> buildHostPage() async {
}

final int exitCode = await runProcess(
environment.dart2jsExecutable,
environment.dartExecutable,
<String>[
'compile',
'js',
hostDartPath,
'-o',
'$hostDartPath.js',
Expand Down
4 changes: 0 additions & 4 deletions web_sdk/web_test_utils/lib/environment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down

0 comments on commit 97831d0

Please sign in to comment.