Unverified Commit f3624196 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

make sure profile is forwarded through build web command (#39414)

parent 13f18d5a
......@@ -22,6 +22,7 @@ import '../artifacts.dart';
import '../base/file_system.dart';
import '../base/logger.dart';
import '../base/platform.dart';
import '../build_info.dart';
import '../compile.dart';
import '../convert.dart';
import '../dart/package_map.dart';
......@@ -41,7 +42,7 @@ class BuildRunnerWebCompilationProxy extends WebCompilationProxy {
Future<bool> initialize({
Directory projectDirectory,
String testOutputDir,
bool release = false,
BuildMode mode,
}) async {
// Create the .dart_tool directory if it doesn't exist.
projectDirectory.childDirectory('.dart_tool').createSync();
......@@ -92,7 +93,7 @@ class BuildRunnerWebCompilationProxy extends WebCompilationProxy {
result = await _runBuilder(
buildEnvironment,
buildOptions,
release,
mode,
buildDirs,
);
return result.status == core.BuildStatus.success;
......@@ -101,7 +102,7 @@ class BuildRunnerWebCompilationProxy extends WebCompilationProxy {
result = await _runBuilder(
buildEnvironment,
buildOptions,
release,
mode,
buildDirs,
);
return result.status == core.BuildStatus.success;
......@@ -110,7 +111,7 @@ class BuildRunnerWebCompilationProxy extends WebCompilationProxy {
result = await _runBuilder(
buildEnvironment,
buildOptions,
release,
mode,
buildDirs,
);
return result.status == core.BuildStatus.success;
......@@ -135,7 +136,7 @@ class BuildRunnerWebCompilationProxy extends WebCompilationProxy {
return result.status == core.BuildStatus.success;
}
Future<core.BuildResult> _runBuilder(core.BuildEnvironment buildEnvironment, BuildOptions buildOptions, bool release, Set<core.BuildDirectory> buildDirs) async {
Future<core.BuildResult> _runBuilder(core.BuildEnvironment buildEnvironment, BuildOptions buildOptions, BuildMode buildMode, Set<core.BuildDirectory> buildDirs) async {
_builder = await BuildImpl.create(
buildOptions,
buildEnvironment,
......@@ -145,11 +146,13 @@ class BuildRunnerWebCompilationProxy extends WebCompilationProxy {
'flutterWebSdk': artifacts.getArtifactPath(Artifact.flutterWebSdk),
},
'flutter_tools:entrypoint': <String, dynamic>{
'release': release,
'release': buildMode == BuildMode.release,
'flutterWebSdk': artifacts.getArtifactPath(Artifact.flutterWebSdk),
'profile': buildMode == BuildMode.profile,
},
'flutter_tools:test_entrypoint': <String, dynamic>{
'release': release,
'release': buildMode == BuildMode.release,
'profile': buildMode == BuildMode.profile,
},
},
isReleaseBuild: false,
......
......@@ -30,7 +30,7 @@ Future<void> buildWeb(FlutterProject flutterProject, String target, BuildInfo bu
try {
result = await webCompilationProxy.initialize(
projectDirectory: FlutterProject.current().directory,
release: buildInfo.isRelease,
mode: buildInfo.mode,
);
if (result) {
// Places assets adjacent to the web stuff.
......@@ -81,7 +81,7 @@ class WebCompilationProxy {
Future<bool> initialize({
@required Directory projectDirectory,
String testOutputDir,
bool release,
BuildMode mode,
}) async {
throw UnimplementedError();
}
......
......@@ -41,7 +41,7 @@ void main() {
fs.file(fs.path.join('lib', 'main.dart')).createSync(recursive: true);
when(mockWebCompilationProxy.initialize(
projectDirectory: anyNamed('projectDirectory'),
release: anyNamed('release')
mode: anyNamed('mode')
)).thenAnswer((Invocation invocation) {
final String path = fs.path.join('.dart_tool', 'build', 'flutter_web', 'foo', 'lib', 'main_web_entrypoint.dart.js');
fs.file(path).createSync(recursive: true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment