Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Features

- Support flavors in macOS symbol upload ([#308](https://github.com/getsentry/sentry-dart-plugin/pull/308))

## 2.4.1

### Fixes
Expand Down
28 changes: 20 additions & 8 deletions lib/sentry_dart_plugin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ class SentryDartPlugin {
}

// macOS
yield '$buildDir/macos/Build/Products/Release';
yield* _enumerateDirectoryWithFlavors(fs, basePath: '$buildDir/macos/Build/Products');

// macOS (macOS-framework)
yield '$buildDir/macos/framework/Release';
yield* _enumerateDirectoryWithFlavors(fs, basePath: '$buildDir/macos/framework');

// iOS
yield '$buildDir/ios/iphoneos/Runner.app';
Expand All @@ -136,7 +136,20 @@ class SentryDartPlugin {
yield '$buildDir/ios/archive';

// iOS (ios-framework)
yield '$buildDir/ios/framework/Release';
yield* _enumerateDirectoryWithFlavors(fs, basePath: '$buildDir/ios/framework');
}

Stream<String> _enumerateDirectoryWithFlavors(FileSystem fs, {
required String basePath,
String targetDirectoryName = "Release"
}) async* {
if (await fs.directory(basePath).exists()) {
yield* fs
.directory(basePath)
.list()
.where((v) => v.basename.startsWith(targetDirectoryName))
.map((e) => e.path);
}
}

Future<Set<String>> _enumerateSymbolFiles() async {
Expand Down Expand Up @@ -282,9 +295,8 @@ class SentryDartPlugin {
int? exitCode;

try {
final process = await injector
.get<ProcessManager>()
.start([_configuration.cliPath!, ...params]);
final process =
await injector.get<ProcessManager>().start([_configuration.cliPath!, ...params]);

process.stdout.transform(utf8.decoder).listen((data) {
Log.info(data.trim());
Expand All @@ -303,8 +315,8 @@ class SentryDartPlugin {
}
}

void _addExtensionToParams(List<String> exts, List<String> params,
String release, String folder, String? urlPrefix) {
void _addExtensionToParams(
List<String> exts, List<String> params, String release, String folder, String? urlPrefix) {
params.add('files');
params.add(release);
params.add('upload-sourcemaps');
Expand Down
2 changes: 2 additions & 0 deletions test/plugin_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@ void main() {
'linux/x64/release/bundle',
'linux/arm64/release/bundle',
'macos/Build/Products/Release',
'macos/Build/Products/Release-demo',
'macos/framework/Release',
'macos/framework/Release-demo',
'ios/iphoneos/Runner.app',
'ios/Release-iphoneos',
'ios/Release-anyrandomflavor-iphoneos',
Expand Down