Separate Flutter engine & Dart engine cache and pub caches
ilovelinux opened this issue · 2 comments
ilovelinux commented
It could be useful to separate Flutter engine & Dart engine cache and pub and allow to invalidate pub caches as needed.
Actual behavior
- First run with caching.
Cache generated:flutter/*
- Second run, retrieving caches, adding/replacing/updating dependencies.
The cache has not been updated since it already exists and the update has not been enforced. - Third run, no edits.
Needs to download added/replaced/updated dependencies again since the pub cache hasn't been updated.
Expected behavior
- First run with caching.
Two caches were generated:flutter/!.pub-cache
with all except.pub-cache
folder, andflutter/.pub-cache
Optionally, we could allow users to define a custom key for pub caches as we do withcache-key
input. - Second run, retrieving caches and adding/replacing/updating dependencies.
Enforce pub cache update. If the custom key uses${{ hashFiles('pubspec.lock') }}
, create a new minimal (smaller, without older dependencies) cache. - Third run, no edits.
The cache is valid and ready to use. No need to download new dependencies again.