-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support for releasing and patching macOS apps #2644
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
packages/shorebird_cli/lib/src/commands/patch/macos_patcher.dart
Outdated
Show resolved
Hide resolved
.sorted( | ||
(a, b) => b.statSync().modified.compareTo(a.statSync().modified), | ||
) | ||
.firstWhereOrNull((directory) => directory.path.endsWith('.app')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought in the iOS case we'd move to reading the path from the logs? But maybe that was a different kind of path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might be thinking of the app.dill?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a bunch of nits, none of which need to be addressed.
I do think there is a ton of copy/paste code that we may wish to try and unify more before soon.
}); | ||
|
||
String get _patchClassTableLinkInfoPath => | ||
p.join(buildDirectory.path, 'macos', 'shorebird', 'App.ct.link'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I probably would have written myself a little _buildPath('macos', 'shorebird','App.ct.link') helper. 🤷
packages/shorebird_cli/lib/src/commands/patch/macos_patcher.dart
Outdated
Show resolved
Hide resolved
outputDirectory: tempDir, | ||
); | ||
releaseClassTableLinkInfoFile = File(p.join(tempDir.path, 'App.ct.link')); | ||
if (!releaseClassTableLinkInfoFile.existsSync()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I probably would have had an _existsOrExit(file, 'class table link debug info') if I'm doing this more often. 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm planning to refactor all this and extract the shared logic in a subsequent PR.
'cache', | ||
'artifacts', | ||
'engine', | ||
'darwin-x64-release', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're using the enum to differentiate based on Target, but we may also need to differentiate based on Host
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, we'll probably want to refactor ShorebirdArtifacts
to accept host and/or target in the future.
@@ -652,6 +714,7 @@ aar artifact already exists, continuing...''', | |||
|
|||
final zippedRunner = await Directory(runnerPath).zipToTempFile(); | |||
try { | |||
logger.detail('[archive] zipped runner.app to ${zippedRunner.path}'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want this log? We don't have an equivalent for other platforms so just wondering if this was left in intentionally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel strongly. Users will only see it when running with the -v
flag, and there's so much other output that I'm not sure it matters much one way or the other.
packages/shorebird_cli/lib/src/commands/patch/macos_patcher.dart
Outdated
Show resolved
Hide resolved
packages/shorebird_cli/lib/src/commands/patch/macos_patcher.dart
Outdated
Show resolved
Hide resolved
), | ||
); | ||
|
||
Future<_LinkResult> _runLinker({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably create a Linker
class that contains this shared logic instead of duplicating on both iOS and MacOS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I have a TODO earlier in this file on line 33 for the _LinkResult
typedef.
Description
Adds
shorebird release macos
andshorebird patch macos
Remaining work
Note: These should probably be moved to issues, as they aren't prereqs for landing this PR, but for announcing beta mac support.
Fixes #2654
Type of Change