@@ -92,8 +92,14 @@ enum HostArtifact {
9292 idevicesyslog,
9393 idevicescreenshot,
9494 iproxy,
95+
9596 /// The root of the sky_engine package.
9697 skyEnginePath,
98+
99+ // The Impeller shader compiler.
100+ impellerc,
101+ // Impeller's tessellation library.
102+ libtessellator,
97103}
98104
99105// TODO(knopp): Remove once darwin artifacts are universal and moved out of darwin-x64
@@ -202,8 +208,14 @@ String? _artifactToFileName(Artifact artifact, [ TargetPlatform? platform, Build
202208 }
203209}
204210
205- String _hostArtifactToFileName (HostArtifact artifact, bool windows) {
206- final String exe = windows ? '.exe' : '' ;
211+ String _hostArtifactToFileName (HostArtifact artifact, Platform platform) {
212+ final String exe = platform.isWindows ? '.exe' : '' ;
213+ String dll = '.so' ;
214+ if (platform.isWindows) {
215+ dll = '.dll' ;
216+ } else if (platform.isMacOS) {
217+ dll = '.dylib' ;
218+ }
207219 switch (artifact) {
208220 case HostArtifact .flutterWebSdk:
209221 return '' ;
@@ -247,6 +259,10 @@ String _hostArtifactToFileName(HostArtifact artifact, bool windows) {
247259 case HostArtifact .webPrecompiledCanvaskitSoundSdkSourcemaps:
248260 case HostArtifact .webPrecompiledCanvaskitAndHtmlSoundSdkSourcemaps:
249261 return 'dart_sdk.js.map' ;
262+ case HostArtifact .impellerc:
263+ return 'impellerc$exe ' ;
264+ case HostArtifact .libtessellator:
265+ return 'libtessellator$dll ' ;
250266 }
251267}
252268
@@ -337,63 +353,68 @@ class CachedArtifacts implements Artifacts {
337353 final String path = _dartSdkPath (_cache);
338354 return _fileSystem.directory (path);
339355 case HostArtifact .engineDartBinary:
340- final String path = _fileSystem.path.join (_dartSdkPath (_cache), 'bin' , _hostArtifactToFileName (artifact, _platform.isWindows ));
356+ final String path = _fileSystem.path.join (_dartSdkPath (_cache), 'bin' , _hostArtifactToFileName (artifact, _platform));
341357 return _fileSystem.file (path);
342358 case HostArtifact .flutterWebSdk:
343359 final String path = _getFlutterWebSdkPath ();
344360 return _fileSystem.directory (path);
345361 case HostArtifact .flutterWebLibrariesJson:
346- final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), _hostArtifactToFileName (artifact, _platform.isWindows ));
362+ final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), _hostArtifactToFileName (artifact, _platform));
347363 return _fileSystem.file (path);
348364 case HostArtifact .webPlatformKernelDill:
349- final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , _hostArtifactToFileName (artifact, _platform.isWindows ));
365+ final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , _hostArtifactToFileName (artifact, _platform));
350366 return _fileSystem.file (path);
351367 case HostArtifact .webPlatformSoundKernelDill:
352- final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , _hostArtifactToFileName (artifact, _platform.isWindows ));
368+ final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , _hostArtifactToFileName (artifact, _platform));
353369 return _fileSystem.file (path);
354370 case HostArtifact .webPrecompiledSdk:
355371 case HostArtifact .webPrecompiledSdkSourcemaps:
356- final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd' , _hostArtifactToFileName (artifact, _platform.isWindows ));
372+ final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd' , _hostArtifactToFileName (artifact, _platform));
357373 return _fileSystem.file (path);
358374 case HostArtifact .webPrecompiledCanvaskitSdk:
359375 case HostArtifact .webPrecompiledCanvaskitSdkSourcemaps:
360- final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd-canvaskit' , _hostArtifactToFileName (artifact, _platform.isWindows ));
376+ final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd-canvaskit' , _hostArtifactToFileName (artifact, _platform));
361377 return _fileSystem.file (path);
362378 case HostArtifact .webPrecompiledCanvaskitAndHtmlSdk:
363379 case HostArtifact .webPrecompiledCanvaskitAndHtmlSdkSourcemaps:
364- final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd-canvaskit-html' , _hostArtifactToFileName (artifact, _platform.isWindows ));
380+ final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd-canvaskit-html' , _hostArtifactToFileName (artifact, _platform));
365381 return _fileSystem.file (path);
366382 case HostArtifact .webPrecompiledSoundSdk:
367383 case HostArtifact .webPrecompiledSoundSdkSourcemaps:
368- final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd-sound' , _hostArtifactToFileName (artifact, _platform.isWindows ));
384+ final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd-sound' , _hostArtifactToFileName (artifact, _platform));
369385 return _fileSystem.file (path);
370386 case HostArtifact .webPrecompiledCanvaskitSoundSdk:
371387 case HostArtifact .webPrecompiledCanvaskitSoundSdkSourcemaps:
372- final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd-canvaskit-sound' , _hostArtifactToFileName (artifact, _platform.isWindows ));
388+ final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd-canvaskit-sound' , _hostArtifactToFileName (artifact, _platform));
373389 return _fileSystem.file (path);
374390 case HostArtifact .webPrecompiledCanvaskitAndHtmlSoundSdk:
375391 case HostArtifact .webPrecompiledCanvaskitAndHtmlSoundSdkSourcemaps:
376- final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd-canvaskit-html-sound' , _hostArtifactToFileName (artifact, _platform.isWindows ));
392+ final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd-canvaskit-html-sound' , _hostArtifactToFileName (artifact, _platform));
377393 return _fileSystem.file (path);
378394 case HostArtifact .idevicesyslog:
379395 case HostArtifact .idevicescreenshot:
380- final String artifactFileName = _hostArtifactToFileName (artifact, _platform.isWindows );
396+ final String artifactFileName = _hostArtifactToFileName (artifact, _platform);
381397 return _cache.getArtifactDirectory ('libimobiledevice' ).childFile (artifactFileName);
382398 case HostArtifact .skyEnginePath:
383399 final Directory dartPackageDirectory = _cache.getCacheDir ('pkg' );
384- final String path = _fileSystem.path.join (dartPackageDirectory.path, _hostArtifactToFileName (artifact, _platform.isWindows ));
400+ final String path = _fileSystem.path.join (dartPackageDirectory.path, _hostArtifactToFileName (artifact, _platform));
385401 return _fileSystem.directory (path);
386402 case HostArtifact .dart2jsSnapshot:
387403 case HostArtifact .dartdevcSnapshot:
388404 case HostArtifact .kernelWorkerSnapshot:
389- final String path = _fileSystem.path.join (_dartSdkPath (_cache), 'bin' , 'snapshots' , _hostArtifactToFileName (artifact, _platform.isWindows ));
405+ final String path = _fileSystem.path.join (_dartSdkPath (_cache), 'bin' , 'snapshots' , _hostArtifactToFileName (artifact, _platform));
390406 return _fileSystem.file (path);
391407 case HostArtifact .iosDeploy:
392- final String artifactFileName = _hostArtifactToFileName (artifact, _platform.isWindows );
408+ final String artifactFileName = _hostArtifactToFileName (artifact, _platform);
393409 return _cache.getArtifactDirectory ('ios-deploy' ).childFile (artifactFileName);
394410 case HostArtifact .iproxy:
395- final String artifactFileName = _hostArtifactToFileName (artifact, _platform.isWindows );
411+ final String artifactFileName = _hostArtifactToFileName (artifact, _platform);
396412 return _cache.getArtifactDirectory ('usbmuxd' ).childFile (artifactFileName);
413+ case HostArtifact .impellerc:
414+ case HostArtifact .libtessellator:
415+ final String artifactFileName = _hostArtifactToFileName (artifact, _platform);
416+ final String engineDir = _getEngineArtifactsPath (_currentHostPlatform (_platform, _operatingSystemUtils))! ;
417+ return _fileSystem.file (_fileSystem.path.join (engineDir, artifactFileName));
397418 }
398419 }
399420
@@ -757,67 +778,71 @@ class CachedLocalEngineArtifacts implements LocalEngineArtifacts {
757778 final String path = _fileSystem.path.join (_hostEngineOutPath, 'dart-sdk' );
758779 return _fileSystem.directory (path);
759780 case HostArtifact .engineDartBinary:
760- final String path = _fileSystem.path.join (_hostEngineOutPath, 'dart-sdk' , 'bin' , _hostArtifactToFileName (artifact, _platform.isWindows ));
781+ final String path = _fileSystem.path.join (_hostEngineOutPath, 'dart-sdk' , 'bin' , _hostArtifactToFileName (artifact, _platform));
761782 return _fileSystem.file (path);
762783 case HostArtifact .dart2jsSnapshot:
763- final String path = _fileSystem.path.join (_hostEngineOutPath, 'dart-sdk' , 'bin' , 'snapshots' , _hostArtifactToFileName (artifact, _platform.isWindows ));
784+ final String path = _fileSystem.path.join (_hostEngineOutPath, 'dart-sdk' , 'bin' , 'snapshots' , _hostArtifactToFileName (artifact, _platform));
764785 return _fileSystem.file (path);
765786 case HostArtifact .dartdevcSnapshot:
766- final String path = _fileSystem.path.join (_dartSdkPath (_cache), 'bin' , 'snapshots' , _hostArtifactToFileName (artifact, _platform.isWindows ));
787+ final String path = _fileSystem.path.join (_dartSdkPath (_cache), 'bin' , 'snapshots' , _hostArtifactToFileName (artifact, _platform));
767788 return _fileSystem.file (path);
768789 case HostArtifact .kernelWorkerSnapshot:
769- final String path = _fileSystem.path.join (_hostEngineOutPath, 'dart-sdk' , 'bin' , 'snapshots' , _hostArtifactToFileName (artifact, _platform.isWindows ));
790+ final String path = _fileSystem.path.join (_hostEngineOutPath, 'dart-sdk' , 'bin' , 'snapshots' , _hostArtifactToFileName (artifact, _platform));
770791 return _fileSystem.file (path);
771792 case HostArtifact .flutterWebSdk:
772793 final String path = _getFlutterWebSdkPath ();
773794 return _fileSystem.directory (path);
774795 case HostArtifact .flutterWebLibrariesJson:
775- final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), _hostArtifactToFileName (artifact, _platform.isWindows ));
796+ final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), _hostArtifactToFileName (artifact, _platform));
776797 return _fileSystem.file (path);
777798 case HostArtifact .webPlatformKernelDill:
778- final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , _hostArtifactToFileName (artifact, _platform.isWindows ));
799+ final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , _hostArtifactToFileName (artifact, _platform));
779800 return _fileSystem.file (path);
780801 case HostArtifact .webPlatformSoundKernelDill:
781- final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , _hostArtifactToFileName (artifact, _platform.isWindows ));
802+ final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , _hostArtifactToFileName (artifact, _platform));
782803 return _fileSystem.file (path);
783804 case HostArtifact .webPrecompiledSdk:
784805 case HostArtifact .webPrecompiledSdkSourcemaps:
785- final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd' , _hostArtifactToFileName (artifact, _platform.isWindows ));
806+ final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd' , _hostArtifactToFileName (artifact, _platform));
786807 return _fileSystem.file (path);
787808 case HostArtifact .webPrecompiledCanvaskitSdk:
788809 case HostArtifact .webPrecompiledCanvaskitSdkSourcemaps:
789- final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd-canvaskit' , _hostArtifactToFileName (artifact, _platform.isWindows ));
810+ final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd-canvaskit' , _hostArtifactToFileName (artifact, _platform));
790811 return _fileSystem.file (path);
791812 case HostArtifact .webPrecompiledCanvaskitAndHtmlSdk:
792813 case HostArtifact .webPrecompiledCanvaskitAndHtmlSdkSourcemaps:
793- final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd-canvaskit-html' , _hostArtifactToFileName (artifact, _platform.isWindows ));
814+ final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd-canvaskit-html' , _hostArtifactToFileName (artifact, _platform));
794815 return _fileSystem.file (path);
795816 case HostArtifact .webPrecompiledSoundSdk:
796817 case HostArtifact .webPrecompiledSoundSdkSourcemaps:
797- final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd-sound' , _hostArtifactToFileName (artifact, _platform.isWindows ));
818+ final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd-sound' , _hostArtifactToFileName (artifact, _platform));
798819 return _fileSystem.file (path);
799820 case HostArtifact .webPrecompiledCanvaskitSoundSdk:
800821 case HostArtifact .webPrecompiledCanvaskitSoundSdkSourcemaps:
801- final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd-canvaskit-sound' , _hostArtifactToFileName (artifact, _platform.isWindows ));
822+ final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd-canvaskit-sound' , _hostArtifactToFileName (artifact, _platform));
802823 return _fileSystem.file (path);
803824 case HostArtifact .webPrecompiledCanvaskitAndHtmlSoundSdk:
804825 case HostArtifact .webPrecompiledCanvaskitAndHtmlSoundSdkSourcemaps:
805- final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd-canvaskit-html-sound' , _hostArtifactToFileName (artifact, _platform.isWindows ));
826+ final String path = _fileSystem.path.join (_getFlutterWebSdkPath (), 'kernel' , 'amd-canvaskit-html-sound' , _hostArtifactToFileName (artifact, _platform));
806827 return _fileSystem.file (path);
807828 case HostArtifact .idevicesyslog:
808829 case HostArtifact .idevicescreenshot:
809- final String artifactFileName = _hostArtifactToFileName (artifact, _platform.isWindows );
830+ final String artifactFileName = _hostArtifactToFileName (artifact, _platform);
810831 return _cache.getArtifactDirectory ('libimobiledevice' ).childFile (artifactFileName);
811832 case HostArtifact .skyEnginePath:
812833 final Directory dartPackageDirectory = _cache.getCacheDir ('pkg' );
813- final String path = _fileSystem.path.join (dartPackageDirectory.path, _hostArtifactToFileName (artifact, _platform.isWindows ));
834+ final String path = _fileSystem.path.join (dartPackageDirectory.path, _hostArtifactToFileName (artifact, _platform));
814835 return _fileSystem.directory (path);
815836 case HostArtifact .iosDeploy:
816- final String artifactFileName = _hostArtifactToFileName (artifact, _platform.isWindows );
837+ final String artifactFileName = _hostArtifactToFileName (artifact, _platform);
817838 return _cache.getArtifactDirectory ('ios-deploy' ).childFile (artifactFileName);
818839 case HostArtifact .iproxy:
819- final String artifactFileName = _hostArtifactToFileName (artifact, _platform.isWindows );
840+ final String artifactFileName = _hostArtifactToFileName (artifact, _platform);
820841 return _cache.getArtifactDirectory ('usbmuxd' ).childFile (artifactFileName);
842+ case HostArtifact .impellerc:
843+ case HostArtifact .libtessellator:
844+ final String artifactFileName = _hostArtifactToFileName (artifact, _platform);
845+ return _fileSystem.file (_fileSystem.path.join (_hostEngineOutPath, artifactFileName));
821846 }
822847 }
823848
0 commit comments