We use a couple of different artifacts in shorebird, like aot_tools, bundletool, etc. Most of them (if not all?) are platform specific, and those artifacts are cached to avoid the constant fetching of them from the internet.
Right now, our caching code is the most smart, and in many instances we are caching artifacts that are not necessary.
For example, on the release command we call cache.updateAll in the beginning of its createReleasemethod. We update all the artifacts cached, even if we are running just an android build, which will make shorebird to potentially download artifacts not needed.
These updateAll calls should not make much difference on the developers workstation day to day, since most of the times everything will be cached anyway, but it can waste CI time where everything is a "cold installation".
A simple solution that could fix that would be to get rid of the updateAll method, and make the artifacts executable classes handle their own cache, for example, on the BundleTool class, it would call cache.update<BundleTool> (or similar), making the cache of the artifact contained in the context that they belong to.
Requirements
[ ] Refactor caching to avoid downloading unnecessary artifacts.
Description
We use a couple of different artifacts in shorebird, like
aot_tools
,bundletool
, etc. Most of them (if not all?) are platform specific, and those artifacts are cached to avoid the constant fetching of them from the internet.Right now, our caching code is the most smart, and in many instances we are caching artifacts that are not necessary.
For example, on the release command we call
cache.updateAll
in the beginning of itscreateRelease
method. We update all the artifacts cached, even if we are running just an android build, which will make shorebird to potentially download artifacts not needed.These
updateAll
calls should not make much difference on the developers workstation day to day, since most of the times everything will be cached anyway, but it can waste CI time where everything is a "cold installation".A simple solution that could fix that would be to get rid of the
updateAll
method, and make the artifacts executable classes handle their own cache, for example, on theBundleTool
class, it would callcache.update<BundleTool>
(or similar), making the cache of the artifact contained in the context that they belong to.Requirements
Related to: https://github.com/shorebirdtech/shorebird/issues/2211