mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Cleanup bin/cache (#6247)
This commit is contained in:
parent
2c21d795a4
commit
94a83af5b1
2
bin/.gitignore
vendored
Normal file
2
bin/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
cache
|
||||
|
0
bin/cache/.dartignore
vendored
0
bin/cache/.dartignore
vendored
6
bin/cache/.gitignore
vendored
6
bin/cache/.gitignore
vendored
@ -1,6 +0,0 @@
|
||||
*.snapshot
|
||||
*.stamp
|
||||
artifacts/
|
||||
dart-sdk/
|
||||
pkg/
|
||||
lockfile
|
5
bin/cache/README.md
vendored
5
bin/cache/README.md
vendored
@ -1,5 +0,0 @@
|
||||
# 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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user