Skip to content

Commit

Permalink
fix: allow "Debug" and "Release" configuration for upload symbol script
Browse files Browse the repository at this point in the history
  • Loading branch information
russellwheatley committed Mar 12, 2024
1 parent 008b35a commit 68898ad
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions packages/flutterfire_cli/lib/src/commands/upload_symbols.dart
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,18 @@ class UploadCrashlyticsSymbols extends FlutterFireCommand {
);
final appIdFilePath =
await _findOrCreateAppIdFile(appIdFileDirectory, appId, projectId);

final appFrameworkDsymPath = path.join(
envBuildProductsDir,
'App.framework.dSYM',
);

final buildDirectory = Directory(appFrameworkDsymPath);

// Set configuration to "Release" if "App.framework.dSYM" exists. Otherwise, "Debug". This is to ensure successful upload of symbols
final buildConfiguration =
buildDirectory.existsSync() ? 'Release' : 'Debug';

// Validation script
final validationScript = await Process.run(
uploadSymbolsScriptPath,
Expand All @@ -359,8 +371,7 @@ class UploadCrashlyticsSymbols extends FlutterFireCommand {
],
environment: {
'PLATFORM_NAME': envPlatformName,
// Hard code "Release" to ensure "App.framework.dsym" is uploaded and complies with upload-symbol script
'CONFIGURATION': 'Release',
'CONFIGURATION': buildConfiguration,
'PROJECT_DIR': envProjectDir,
'DWARF_DSYM_FOLDER_PATH': envDwarfDsymFolderPath,
'DWARF_DSYM_FILE_NAME': envDwarfDsymFileName,
Expand All @@ -372,6 +383,7 @@ class UploadCrashlyticsSymbols extends FlutterFireCommand {
if (validationScript.exitCode != 0) {
throw Exception(validationScript.stderr);
}

// Upload script
final uploadScript = await Process.run(
uploadSymbolsScriptPath,
Expand All @@ -381,8 +393,7 @@ class UploadCrashlyticsSymbols extends FlutterFireCommand {
],
environment: {
'PLATFORM_NAME': envPlatformName,
// Hard code "Release" to ensure "App.framework.dsym" is uploaded and complies with upload-symbol script
'CONFIGURATION': 'Release',
'CONFIGURATION': buildConfiguration,
'PROJECT_DIR': envProjectDir,
'DWARF_DSYM_FOLDER_PATH': envDwarfDsymFolderPath,
'DWARF_DSYM_FILE_NAME': envDwarfDsymFileName,
Expand Down

0 comments on commit 68898ad

Please sign in to comment.