Commit 94a83af5 authored by Dan Rubel's avatar Dan Rubel Committed by GitHub

Cleanup bin/cache (#6247)

parent 2c21d795
*.snapshot
*.stamp
artifacts/
dart-sdk/
pkg/
lockfile
# Binary cache
This directory contains a cache of binary artifacts used by the Flutter tools.
Warning: Flutter tools will sometimes automatically delete files in this directory.
......@@ -37,7 +37,9 @@ DART="$DART_SDK_PATH/bin/dart"
fi
REVISION=`(cd "$FLUTTER_ROOT"; git rev-parse HEAD)`
if [ ! -f "$SNAPSHOT_PATH" ] || [ ! -f "$STAMP_PATH" ] || [ `cat "$STAMP_PATH"` != "$REVISION" ] || [ "$FLUTTER_TOOLS_DIR/pubspec.yaml" -nt "$FLUTTER_TOOLS_DIR/pubspec.lock" ]; then
"$FLUTTER_ROOT/bin/cache/update_dart_sdk.sh"
mkdir -p "$FLUTTER_ROOT/bin/cache"
touch "$FLUTTER_ROOT/bin/cache/.dartignore"
"$FLUTTER_ROOT/bin/internal/update_dart_sdk.sh"
echo Building flutter tool...
FLUTTER_DIR="$FLUTTER_ROOT/packages/flutter"
......
......@@ -9,7 +9,7 @@ FLUTTER_ROOT=$(dirname $(dirname $(dirname "${BASH_SOURCE[0]}")))
DART_SDK_PATH="$FLUTTER_ROOT/bin/cache/dart-sdk"
DART_SDK_STAMP_PATH="$FLUTTER_ROOT/bin/cache/dart-sdk.stamp"
DART_SDK_VERSION=`cat "$FLUTTER_ROOT/bin/cache/dart-sdk.version"`
DART_SDK_VERSION=`cat "$FLUTTER_ROOT/bin/internal/dart-sdk.version"`
if [ ! -f "$DART_SDK_STAMP_PATH" ] || [ "$DART_SDK_VERSION" != `cat "$DART_SDK_STAMP_PATH"` ]; then
echo "Downloading Dart SDK $DART_SDK_VERSION..."
......
......@@ -92,7 +92,7 @@ class Cache {
static String get engineRevision {
if (_engineRevision == null) {
File revisionFile = new File(path.join(flutterRoot, 'bin', 'cache', 'engine.version'));
File revisionFile = new File(path.join(flutterRoot, 'bin', 'internal', 'engine.version'));
if (revisionFile.existsSync())
_engineRevision = revisionFile.readAsStringSync().trim();
}
......@@ -127,7 +127,7 @@ class Cache {
}
String getVersionFor(String artifactName) {
File versionFile = new File(path.join(getRoot().path, '$artifactName.version'));
File versionFile = new File(path.join(_rootOverride?.path ?? flutterRoot, 'bin', 'internal', '$artifactName.version'));
return versionFile.existsSync() ? versionFile.readAsStringSync().trim() : null;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment