Skip to content

Commit

Permalink
feat: add Linux as a supported release platform (#2810)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanoltman authored Jan 27, 2025
1 parent d926feb commit c82f987
Show file tree
Hide file tree
Showing 15 changed files with 59 additions and 35 deletions.
16 changes: 9 additions & 7 deletions packages/shorebird_cli/lib/src/commands/patch/patch_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,13 @@ NOTE: this is ${styleBold.wrap('not')} recommended. Asset changes cannot be incl
@visibleForTesting
Patcher getPatcher(ReleaseType releaseType) {
switch (releaseType) {
case ReleaseType.aar:
return AarPatcher(
argResults: results,
argParser: argParser,
flavor: flavor,
target: target,
);
case ReleaseType.android:
return AndroidPatcher(
argResults: results,
Expand All @@ -249,20 +256,15 @@ NOTE: this is ${styleBold.wrap('not')} recommended. Asset changes cannot be incl
flavor: flavor,
target: target,
);
case ReleaseType.linux:
throw UnimplementedError();
case ReleaseType.macos:
return MacosPatcher(
argParser: argParser,
argResults: results,
flavor: flavor,
target: target,
);
case ReleaseType.aar:
return AarPatcher(
argResults: results,
argParser: argParser,
flavor: flavor,
target: target,
);
case ReleaseType.windows:
return WindowsPatcher(
argResults: results,
Expand Down
7 changes: 4 additions & 3 deletions packages/shorebird_cli/lib/src/commands/preview_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -285,15 +285,16 @@ This is only applicable when previewing Android releases.''',
deviceId: deviceId,
track: track,
),
ReleasePlatform.macos => installAndLaunchMacos(
ReleasePlatform.ios => installAndLaunchIos(
appId: appId,
release: release,
deviceId: deviceId,
track: track,
),
ReleasePlatform.ios => installAndLaunchIos(
ReleasePlatform.linux => throw UnimplementedError(),
ReleasePlatform.macos => installAndLaunchMacos(
appId: appId,
release: release,
deviceId: deviceId,
track: track,
),
ReleasePlatform.windows => installAndLaunchWindows(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,20 +183,20 @@ of the iOS app that is using this module. (aar and ios-framework only)''',
@visibleForTesting
Releaser getReleaser(ReleaseType releaseType) {
switch (releaseType) {
case ReleaseType.android:
return AndroidReleaser(
case ReleaseType.aar:
return AarReleaser(
argResults: results,
flavor: flavor,
target: target,
);
case ReleaseType.ios:
return IosReleaser(
case ReleaseType.android:
return AndroidReleaser(
argResults: results,
flavor: flavor,
target: target,
);
case ReleaseType.macos:
return MacosReleaser(
case ReleaseType.ios:
return IosReleaser(
argResults: results,
flavor: flavor,
target: target,
Expand All @@ -207,8 +207,10 @@ of the iOS app that is using this module. (aar and ios-framework only)''',
flavor: flavor,
target: target,
);
case ReleaseType.aar:
return AarReleaser(
case ReleaseType.linux:
throw UnimplementedError();
case ReleaseType.macos:
return MacosReleaser(
argResults: results,
flavor: flavor,
target: target,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions packages/shorebird_cli/lib/src/release_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ enum ReleaseType {
/// A full Flutter iOS app.
ios,

linux,

/// A full Flutter macOS app.
macos,

Expand All @@ -25,16 +27,18 @@ enum ReleaseType {
/// The CLI argument used to specify the release type(s).
String get cliName {
switch (this) {
case ReleaseType.aar:
return 'aar';
case ReleaseType.android:
return 'android';
case ReleaseType.ios:
return 'ios';
case ReleaseType.iosFramework:
return 'ios-framework';
case ReleaseType.linux:
return 'linux';
case ReleaseType.macos:
return 'macos';
case ReleaseType.aar:
return 'aar';
case ReleaseType.windows:
return 'windows';
}
Expand All @@ -49,10 +53,12 @@ enum ReleaseType {
return ReleasePlatform.android;
case ReleaseType.ios:
return ReleasePlatform.ios;
case ReleaseType.macos:
return ReleasePlatform.macos;
case ReleaseType.iosFramework:
return ReleasePlatform.ios;
case ReleaseType.linux:
return ReleasePlatform.linux;
case ReleaseType.macos:
return ReleasePlatform.macos;
case ReleaseType.windows:
return ReleasePlatform.windows;
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ enum ReleasePlatform {
/// Android
android('Android'),

/// macOS
macos('macOS'),

/// iOS
ios('iOS'),

/// Linux
linux('Linux'),

/// macOS
macos('macOS'),

/// Windows
windows('Windows');

Expand Down

0 comments on commit c82f987

Please sign in to comment.