add daemon command to enumerate supported platforms#33472
add daemon command to enumerate supported platforms#33472jonahwilliams merged 3 commits intoflutter:masterfrom
Conversation
stuartmorgan-g
left a comment
There was a problem hiding this comment.
One comment; I'll leave the real review to people who will actually be using the API :)
| if (flutterProject.linux.existsSync()) { | ||
| result.add('linux'); | ||
| } | ||
| if (flutterProject.macos.existsSync()) { |
There was a problem hiding this comment.
Should we also check the platform we're running on, so if someone commits a macos folder it doesn't cause it to show up as a target if you clone and try to run on Windows?
There was a problem hiding this comment.
In that case the project supports macos, but no device would support windows, so the filtering would happen on the device side.
There was a problem hiding this comment.
Ah yeah, that makes sense (and would match if we have metadata - you might load a project that claims it can target macOS but you're running on Windows) 👍
| return <String, Object>{ | ||
| 'platforms': result, | ||
| }; | ||
| } catch (err, stackTrace) { |
There was a problem hiding this comment.
Can we target a specific exception here? We should avoid generalized catches....
There was a problem hiding this comment.
I see now - we want the consumer get the exception and not crash. Ok.
Description
Based on discussion from last week, returns a list of strings containing each possible platform supported, independent of current devices or workflows.