@@ -22,6 +22,7 @@ enum Artifact {
22
22
/// The flutter tester binary.
23
23
flutterTester,
24
24
flutterFramework,
25
+ flutterFrameworkDsym,
25
26
flutterXcframework,
26
27
/// The framework directory of the macOS desktop.
27
28
flutterMacOSFramework,
@@ -181,6 +182,8 @@ String? _artifactToFileName(Artifact artifact, Platform hostPlatform, [ BuildMod
181
182
return 'flutter_tester$exe ' ;
182
183
case Artifact .flutterFramework:
183
184
return 'Flutter.framework' ;
185
+ case Artifact .flutterFrameworkDsym:
186
+ return 'Flutter.framework.dSYM' ;
184
187
case Artifact .flutterXcframework:
185
188
return 'Flutter.xcframework' ;
186
189
case Artifact .flutterMacOSFramework:
@@ -623,6 +626,7 @@ class CachedArtifacts implements Artifacts {
623
626
case Artifact .frontendServerSnapshotForEngineDartSdk:
624
627
case Artifact .constFinder:
625
628
case Artifact .flutterFramework:
629
+ case Artifact .flutterFrameworkDsym:
626
630
case Artifact .flutterMacOSFramework:
627
631
case Artifact .flutterMacOSXcframework:
628
632
case Artifact .flutterPatchedSdkPath:
@@ -656,7 +660,10 @@ class CachedArtifacts implements Artifacts {
656
660
return _fileSystem.path.join (engineDir, artifactFileName);
657
661
case Artifact .flutterFramework:
658
662
final String engineDir = _getEngineArtifactsPath (platform, mode)! ;
659
- return _getIosEngineArtifactPath (engineDir, environmentType, _fileSystem, _platform);
663
+ return _getIosFrameworkPath (engineDir, environmentType, _fileSystem, _platform);
664
+ case Artifact .flutterFrameworkDsym:
665
+ final String engineDir = _getEngineArtifactsPath (platform, mode)! ;
666
+ return _getIosFrameworkDsymPath (engineDir, environmentType, _fileSystem, _platform);
660
667
case Artifact .engineDartSdkPath:
661
668
case Artifact .engineDartBinary:
662
669
case Artifact .engineDartAotRuntime:
@@ -713,6 +720,7 @@ class CachedArtifacts implements Artifacts {
713
720
return _fileSystem.path.join (root, runtime, artifactFileName);
714
721
case Artifact .constFinder:
715
722
case Artifact .flutterFramework:
723
+ case Artifact .flutterFrameworkDsym:
716
724
case Artifact .flutterMacOSFramework:
717
725
case Artifact .flutterMacOSXcframework:
718
726
case Artifact .flutterTester:
@@ -814,6 +822,7 @@ class CachedArtifacts implements Artifacts {
814
822
.childFile (_artifactToFileName (artifact, _platform, mode)! )
815
823
.path;
816
824
case Artifact .flutterFramework:
825
+ case Artifact .flutterFrameworkDsym:
817
826
case Artifact .flutterXcframework:
818
827
case Artifact .fuchsiaFlutterRunner:
819
828
case Artifact .fuchsiaKernelCompiler:
@@ -882,37 +891,72 @@ TargetPlatform _currentHostPlatform(Platform platform, OperatingSystemUtils oper
882
891
throw UnimplementedError ('Host OS not supported.' );
883
892
}
884
893
885
- String _getIosEngineArtifactPath (String engineDirectory,
886
- EnvironmentType ? environmentType, FileSystem fileSystem, Platform hostPlatform) {
894
+ /// Returns the Flutter.xcframework platform directory for the specified environment type.
895
+ ///
896
+ /// `Flutter.xcframework` contains target environment/architecture-specific
897
+ /// subdirectories containing the appropriate `Flutter.framework` and
898
+ /// `dSYMs/Flutter.framework.dSYMs` bundles for that target architecture.
899
+ Directory _getIosFlutterFrameworkPlatformDirectory (
900
+ String engineDirectory,
901
+ EnvironmentType ? environmentType,
902
+ FileSystem fileSystem,
903
+ Platform hostPlatform) {
887
904
final Directory xcframeworkDirectory = fileSystem
888
905
.directory (engineDirectory)
889
906
.childDirectory (_artifactToFileName (Artifact .flutterXcframework, hostPlatform)! );
890
907
891
908
if (! xcframeworkDirectory.existsSync ()) {
892
909
throwToolExit ('No xcframework found at ${xcframeworkDirectory .path }. Try running "flutter precache --ios".' );
893
910
}
894
- Directory ? flutterFrameworkSource;
895
- for (final Directory platformDirectory
896
- in xcframeworkDirectory.listSync ().whereType <Directory >()) {
911
+ for (final Directory platformDirectory in xcframeworkDirectory.listSync ().whereType <Directory >()) {
897
912
if (! platformDirectory.basename.startsWith ('ios-' )) {
898
913
continue ;
899
914
}
900
915
// ios-x86_64-simulator, ios-arm64_x86_64-simulator, or ios-arm64.
901
916
final bool simulatorDirectory = platformDirectory.basename.endsWith ('-simulator' );
902
917
if ((environmentType == EnvironmentType .simulator && simulatorDirectory) ||
903
918
(environmentType == EnvironmentType .physical && ! simulatorDirectory)) {
904
- flutterFrameworkSource = platformDirectory;
919
+ return platformDirectory;
905
920
}
906
921
}
907
- if (flutterFrameworkSource == null ) {
908
- throwToolExit ('No iOS frameworks found in ${xcframeworkDirectory .path }' );
909
- }
922
+ throwToolExit ('No iOS frameworks found in ${xcframeworkDirectory .path }' );
923
+ }
910
924
911
- return flutterFrameworkSource
925
+ /// Returns the path to Flutter.framework.
926
+ String _getIosFrameworkPath (
927
+ String engineDirectory,
928
+ EnvironmentType ? environmentType,
929
+ FileSystem fileSystem,
930
+ Platform hostPlatform) {
931
+ final Directory platformDir = _getIosFlutterFrameworkPlatformDirectory (
932
+ engineDirectory,
933
+ environmentType,
934
+ fileSystem,
935
+ hostPlatform,
936
+ );
937
+ return platformDir
912
938
.childDirectory (_artifactToFileName (Artifact .flutterFramework, hostPlatform)! )
913
939
.path;
914
940
}
915
941
942
+ /// Returns the path to Flutter.framework.dSYM.
943
+ String _getIosFrameworkDsymPath (
944
+ String engineDirectory,
945
+ EnvironmentType ? environmentType,
946
+ FileSystem fileSystem,
947
+ Platform hostPlatform) {
948
+ final Directory platformDir = _getIosFlutterFrameworkPlatformDirectory (
949
+ engineDirectory,
950
+ environmentType,
951
+ fileSystem,
952
+ hostPlatform,
953
+ );
954
+ return platformDir
955
+ .childDirectory ('dSYMs' )
956
+ .childDirectory (_artifactToFileName (Artifact .flutterFrameworkDsym, hostPlatform)! )
957
+ .path;
958
+ }
959
+
916
960
String _getMacOSEngineArtifactPath (
917
961
String engineDirectory,
918
962
FileSystem fileSystem,
@@ -1108,7 +1152,10 @@ class CachedLocalEngineArtifacts implements Artifacts {
1108
1152
case Artifact .platformLibrariesJson:
1109
1153
return _fileSystem.path.join (_getFlutterPatchedSdkPath (mode), 'lib' , artifactFileName);
1110
1154
case Artifact .flutterFramework:
1111
- return _getIosEngineArtifactPath (
1155
+ return _getIosFrameworkPath (
1156
+ localEngineInfo.targetOutPath, environmentType, _fileSystem, _platform);
1157
+ case Artifact .flutterFrameworkDsym:
1158
+ return _getIosFrameworkDsymPath (
1112
1159
localEngineInfo.targetOutPath, environmentType, _fileSystem, _platform);
1113
1160
case Artifact .flutterMacOSFramework:
1114
1161
return _getMacOSEngineArtifactPath (
@@ -1291,6 +1338,7 @@ class CachedLocalWebSdkArtifacts implements Artifacts {
1291
1338
case Artifact .genSnapshot:
1292
1339
case Artifact .flutterTester:
1293
1340
case Artifact .flutterFramework:
1341
+ case Artifact .flutterFrameworkDsym:
1294
1342
case Artifact .flutterXcframework:
1295
1343
case Artifact .flutterMacOSFramework:
1296
1344
case Artifact .flutterMacOSXcframework:
0 commit comments