Skip to content

Commit 0e9ee36

Browse files
[web] Add --local-web-sdk flag and use precompiled platform kernels for dart2js and ddc (#114639)
* Dart2JS build step looks for compiled platform binaries. * Use new locations of platform binaries. * Added --local-web-sdk command line flag. * Need to use the matching frontend server when doing ddc stuff. * Update packages/flutter_tools/lib/src/test/web_test_compiler.dart Co-authored-by: Mouad Debbar <[email protected]> * Update packages/flutter_tools/lib/src/runner/flutter_command_runner.dart Co-authored-by: Mouad Debbar <[email protected]> * Formatting issues. * Need to use URI format for platform dill. * Fix resident runner tests. * Fix analysis issue. * Fix and add unit tests. * Add some useful comments. * Refine doc comments for flags. Co-authored-by: Mouad Debbar <[email protected]>
1 parent 0a5b531 commit 0e9ee36

21 files changed

+602
-230
lines changed

packages/flutter_tools/lib/src/android/gradle.dart

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -277,22 +277,22 @@ class AndroidGradleBuilder implements AndroidBuilder {
277277
if (!buildInfo.androidGradleDaemon) {
278278
command.add('--no-daemon');
279279
}
280-
if (_artifacts is LocalEngineArtifacts) {
281-
final LocalEngineArtifacts localEngineArtifacts = _artifacts as LocalEngineArtifacts;
280+
final LocalEngineInfo? localEngineInfo = _artifacts.localEngineInfo;
281+
if (localEngineInfo != null) {
282282
final Directory localEngineRepo = _getLocalEngineRepo(
283-
engineOutPath: localEngineArtifacts.engineOutPath,
283+
engineOutPath: localEngineInfo.engineOutPath,
284284
androidBuildInfo: androidBuildInfo,
285285
fileSystem: _fileSystem,
286286
);
287287
_logger.printTrace(
288-
'Using local engine: ${localEngineArtifacts.engineOutPath}\n'
288+
'Using local engine: ${localEngineInfo.engineOutPath}\n'
289289
'Local Maven repo: ${localEngineRepo.path}'
290290
);
291291
command.add('-Plocal-engine-repo=${localEngineRepo.path}');
292292
command.add('-Plocal-engine-build-mode=${buildInfo.modeName}');
293-
command.add('-Plocal-engine-out=${localEngineArtifacts.engineOutPath}');
293+
command.add('-Plocal-engine-out=${localEngineInfo.engineOutPath}');
294294
command.add('-Ptarget-platform=${_getTargetPlatformByLocalEnginePath(
295-
localEngineArtifacts.engineOutPath)}');
295+
localEngineInfo.engineOutPath)}');
296296
} else if (androidBuildInfo.targetArchs.isNotEmpty) {
297297
final String targetPlatforms = androidBuildInfo
298298
.targetArchs
@@ -611,20 +611,20 @@ class AndroidGradleBuilder implements AndroidBuilder {
611611
);
612612
}
613613

614-
if (_artifacts is LocalEngineArtifacts) {
615-
final LocalEngineArtifacts localEngineArtifacts = _artifacts as LocalEngineArtifacts;
614+
final LocalEngineInfo? localEngineInfo = _artifacts.localEngineInfo;
615+
if (localEngineInfo != null) {
616616
final Directory localEngineRepo = _getLocalEngineRepo(
617-
engineOutPath: localEngineArtifacts.engineOutPath,
617+
engineOutPath: localEngineInfo.engineOutPath,
618618
androidBuildInfo: androidBuildInfo,
619619
fileSystem: _fileSystem,
620620
);
621621
_logger.printTrace(
622-
'Using local engine: ${localEngineArtifacts.engineOutPath}\n'
622+
'Using local engine: ${localEngineInfo.engineOutPath}\n'
623623
'Local Maven repo: ${localEngineRepo.path}'
624624
);
625625
command.add('-Plocal-engine-repo=${localEngineRepo.path}');
626626
command.add('-Plocal-engine-build-mode=${buildInfo.modeName}');
627-
command.add('-Plocal-engine-out=${localEngineArtifacts.engineOutPath}');
627+
command.add('-Plocal-engine-out=${localEngineInfo.engineOutPath}');
628628

629629
// Copy the local engine repo in the output directory.
630630
try {
@@ -639,7 +639,7 @@ class AndroidGradleBuilder implements AndroidBuilder {
639639
);
640640
}
641641
command.add('-Ptarget-platform=${_getTargetPlatformByLocalEnginePath(
642-
localEngineArtifacts.engineOutPath)}');
642+
localEngineInfo.engineOutPath)}');
643643
} else if (androidBuildInfo.targetArchs.isNotEmpty) {
644644
final String targetPlatforms = androidBuildInfo.targetArchs
645645
.map(getPlatformNameForAndroidArch).join(',');

0 commit comments

Comments
 (0)