Skip to content

Commit

Permalink
[web] Add --local-web-sdk flag and use precompiled platform kernels…
Browse files Browse the repository at this point in the history
… 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]>
  • Loading branch information
eyebrowsoffire and mdebbar authored Nov 12, 2022
1 parent 0a5b531 commit 0e9ee36
Show file tree
Hide file tree
Showing 21 changed files with 602 additions and 230 deletions.
24 changes: 12 additions & 12 deletions packages/flutter_tools/lib/src/android/gradle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -277,22 +277,22 @@ class AndroidGradleBuilder implements AndroidBuilder {
if (!buildInfo.androidGradleDaemon) {
command.add('--no-daemon');
}
if (_artifacts is LocalEngineArtifacts) {
final LocalEngineArtifacts localEngineArtifacts = _artifacts as LocalEngineArtifacts;
final LocalEngineInfo? localEngineInfo = _artifacts.localEngineInfo;
if (localEngineInfo != null) {
final Directory localEngineRepo = _getLocalEngineRepo(
engineOutPath: localEngineArtifacts.engineOutPath,
engineOutPath: localEngineInfo.engineOutPath,
androidBuildInfo: androidBuildInfo,
fileSystem: _fileSystem,
);
_logger.printTrace(
'Using local engine: ${localEngineArtifacts.engineOutPath}\n'
'Using local engine: ${localEngineInfo.engineOutPath}\n'
'Local Maven repo: ${localEngineRepo.path}'
);
command.add('-Plocal-engine-repo=${localEngineRepo.path}');
command.add('-Plocal-engine-build-mode=${buildInfo.modeName}');
command.add('-Plocal-engine-out=${localEngineArtifacts.engineOutPath}');
command.add('-Plocal-engine-out=${localEngineInfo.engineOutPath}');
command.add('-Ptarget-platform=${_getTargetPlatformByLocalEnginePath(
localEngineArtifacts.engineOutPath)}');
localEngineInfo.engineOutPath)}');
} else if (androidBuildInfo.targetArchs.isNotEmpty) {
final String targetPlatforms = androidBuildInfo
.targetArchs
Expand Down Expand Up @@ -611,20 +611,20 @@ class AndroidGradleBuilder implements AndroidBuilder {
);
}

if (_artifacts is LocalEngineArtifacts) {
final LocalEngineArtifacts localEngineArtifacts = _artifacts as LocalEngineArtifacts;
final LocalEngineInfo? localEngineInfo = _artifacts.localEngineInfo;
if (localEngineInfo != null) {
final Directory localEngineRepo = _getLocalEngineRepo(
engineOutPath: localEngineArtifacts.engineOutPath,
engineOutPath: localEngineInfo.engineOutPath,
androidBuildInfo: androidBuildInfo,
fileSystem: _fileSystem,
);
_logger.printTrace(
'Using local engine: ${localEngineArtifacts.engineOutPath}\n'
'Using local engine: ${localEngineInfo.engineOutPath}\n'
'Local Maven repo: ${localEngineRepo.path}'
);
command.add('-Plocal-engine-repo=${localEngineRepo.path}');
command.add('-Plocal-engine-build-mode=${buildInfo.modeName}');
command.add('-Plocal-engine-out=${localEngineArtifacts.engineOutPath}');
command.add('-Plocal-engine-out=${localEngineInfo.engineOutPath}');

// Copy the local engine repo in the output directory.
try {
Expand All @@ -639,7 +639,7 @@ class AndroidGradleBuilder implements AndroidBuilder {
);
}
command.add('-Ptarget-platform=${_getTargetPlatformByLocalEnginePath(
localEngineArtifacts.engineOutPath)}');
localEngineInfo.engineOutPath)}');
} else if (androidBuildInfo.targetArchs.isNotEmpty) {
final String targetPlatforms = androidBuildInfo.targetArchs
.map(getPlatformNameForAndroidArch).join(',');
Expand Down
Loading

0 comments on commit 0e9ee36

Please sign in to comment.