I read on flutter/flutter repo that Google has Bazel rules for Flutter, but they're internal and they're not interested in open-sourcing them.
I read on flutter/flutter repo that Google has Bazel rules for Flutter, but they're internal and they're not interested in open-sourcing them.
Google has Flutter and Dart rules, yes, but they were started so long ago (for Google AdWords, which uses Dart on the Web), and historically were very tied to internal Google oddities. If we went with Bazel, we'd just write new ones publicly.
It'd be a lot of work, because no good Bazel rules for Dart exist (there is [0] which is old and unmaintained, although it was recently forked [2] by a Google engineer working on Flutter), and of course, no rules for Flutter exist as well. Another problem here is that a lot of flutter_tools [3] code assumes that Android project uses Gradle, and iOS project uses Xcode.
After some investigation, it looks that to change this situation one could either:
(1) reimplement flutter_tools in Bazel, or
(2a) contribute to flutter_tools to work with Bazel, or
(2b) fork flutter_tools to work with Bazel (like you forked the engine)
Each of these is quite a lot of work. I'm curious to hear what you think about this.
[0]: https://github.com/MobileNativeFoundation/rules_xcodeproj
[1]: https://github.com/cbracken/rules_dart
[2]: https://github.com/matanlurey/rules_dart
[3]: https://github.com/flutter/flutter/tree/master/packages/flut...
I think there are still open questions as to what kinds of projects would want to use bazel. And if they do use bazel, what do they do for all the other services flutter_tools currently provides (like running on a device)? Inside Google they have different (bazel-specific) implementations for "run this app on an android device" so they don't use the `flutter` tool internally I don't think. I do think some of the internal bazel rules might call into `flutter` though? I'm not sure. Those are all question's I'd explore after having some working examples that I could stare at and decide if I liked the DX of them before proceeding further.