Open dcharkes opened 2 months ago
To be had in a separate discussion probably:
If fetchOnly is false, it's a single process invocation for fetch and build, instead of two.
That we do many process invocations for hooks is a problem in itself, which I believe should be addressed at some point (Maybe collect all hooks into a single Dart file?).
In your use cases, do you wrap existing native build systems / native package managers that need internet access to fetch dependencies? (To produce dylibs/jars/...) And if yes, do those have a separate fetch step and an offline mode?
Not in any use case that I've encountered so far.
@reidbaker Suggested we should have
fetch
hook/flag, and anoffline
flag.I've spend some thought on what would be a good way of doing this.
One design goal should be that a build hook can wrap an existing native build system or native package manager. This leads to the following design constraints:
fetch
andbuild
should be shared. Otherwise the fetch step invoking the fetch step in the native tool would download dependencies to a place where the build step cannot access them.Another design goal should be that after the fetch step, the build step wouldn't need any internet access. In other words, it would succeed offline. This leads to the following design constraints:
flutter run
doesn't have target architectures available for example, onlyflutter assemble
does.)I'm not sure if the best design would be to have a
hook/fetch.dart
which would get aFetchConfig
(most likely no output, just exitCode of the process for success or not). Or ifBuildConfig
should get abool fetchOnly
.Pros for fetch as flag on
hook/build.dart
fetchOnly
is false, it's a single process invocation for fetch and build, instead of two.package:gradle
), fetch on fetch, build on build, offline on offline. If we have ahook/fetch.dart
and ahook/build.dart
there'd be two hooks which forward with the same configuration.fetch
andbuild
hooks have access to the same configuration, and the same output directory.Cons for
fetch
as flag onhook/build.dart
For
offline
, I think abool
onBuildConfig
is the right place.And
offline
andfetch
are related in the sense that afterfetch
the build hook should not need any internet access. Which passing the offline flag would enforce.@HosseinYousefi @mosuem @liamappelbe @brianquinlan In your use cases, do you wrap existing native build systems / native package managers that need internet access to fetch dependencies? (To produce dylibs/jars/...) And if yes, do those have a separate fetch step and an offline mode?
Any other concerns we should take into account for a fetch step/flag and offline flag?
cc @mkustermann @stuartmorgan