Skip to content

Commit

Permalink
feat: support flavors on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanoltman committed Jan 17, 2025
1 parent 93c56fb commit caed3ba
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/shorebird_cli/lib/src/artifact_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ class ArtifactManager {
}

/// The directory containing the compiled macOS .app file, if it exists.
Directory? getMacOSAppDirectory() {
Directory? getMacOSAppDirectory({String? flavor}) {
final projectRoot = shorebirdEnv.getShorebirdProjectRoot()!;

final appDirectory = Directory(
Expand All @@ -275,7 +275,7 @@ class ArtifactManager {
'macos',
'Build',
'Products',
'Release',
flavor != null ? 'Release-$flavor' : 'Release',

Check warning on line 278 in packages/shorebird_cli/lib/src/artifact_manager.dart

View check run for this annotation

Codecov / codecov/patch

packages/shorebird_cli/lib/src/artifact_manager.dart#L278

Added line #L278 was not covered by tests
),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ For more information see: ${supportedFlutterVersionsUrl.toLink()}''',
throw ProcessExit(ExitCode.software.code);
}

final appPath = artifactManager.getMacOSAppDirectory()!.path;
final appPath = artifactManager.getMacOSAppDirectory(flavor: flavor)!.path;
final tempDir = await Directory.systemTemp.createTemp();
final zippedApp = File(p.join(tempDir.path, '${p.basename(appPath)}.zip'));
await ditto.archive(
Expand All @@ -258,7 +258,7 @@ For more information see: ${supportedFlutterVersionsUrl.toLink()}''',
}

// Verify that we have built a patch .app
if (artifactManager.getMacOSAppDirectory()?.path == null) {
if (artifactManager.getMacOSAppDirectory(flavor: flavor)?.path == null) {
logger.err('Unable to find .app directory');
throw ProcessExit(ExitCode.software.code);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ For more information see: ${supportedFlutterVersionsUrl.toLink()}''',
throw ProcessExit(ExitCode.software.code);
}

final appDirectory = artifactManager.getMacOSAppDirectory();
final appDirectory = artifactManager.getMacOSAppDirectory(flavor: flavor);
if (appDirectory == null) {
logger.err('Unable to find .app directory');
throw ProcessExit(ExitCode.software.code);
Expand Down Expand Up @@ -161,7 +161,7 @@ For more information see: ${supportedFlutterVersionsUrl.toLink()}''',
required Release release,
required String appId,
}) async {
final appDirectory = artifactManager.getMacOSAppDirectory();
final appDirectory = artifactManager.getMacOSAppDirectory(flavor: flavor);
if (appDirectory == null) {
logger.err('Unable to find .app directory');
throw ProcessExit(ExitCode.software.code);
Expand Down Expand Up @@ -204,6 +204,6 @@ For more information see: ${supportedFlutterVersionsUrl.toLink()}''',
@override
String get postReleaseInstructions => '''
macOS app created at ${artifactManager.getMacOSAppDirectory()!.path}.
macOS app created at ${artifactManager.getMacOSAppDirectory(flavor: flavor)!.path}.
''';
}

0 comments on commit caed3ba

Please sign in to comment.