fix #1443 ensure engine is the correct version

This commit is contained in:
Collin Jackson
2016-01-29 12:54:15 -08:00
parent 3abb8c4ec9
commit beaffecb7b
6 changed files with 51 additions and 23 deletions

View File

@@ -7,6 +7,7 @@ set -e
export FLUTTER_ROOT=$(dirname $(dirname "${BASH_SOURCE[0]}"))
FLUTTER_TOOLS_DIR="$FLUTTER_ROOT/packages/flutter_tools"
FLUTTER_DIR="$FLUTTER_ROOT/packages/flutter"
SNAPSHOT_PATH="$FLUTTER_ROOT/bin/cache/flutter_tools.snapshot"
STAMP_PATH="$FLUTTER_ROOT/bin/cache/flutter_tools.stamp"
SCRIPT_PATH="$FLUTTER_TOOLS_DIR/bin/flutter_tools.dart"
@@ -18,6 +19,7 @@ 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
echo Updating flutter tool...
(cd "$FLUTTER_TOOLS_DIR"; pub get > /dev/null)
(cd "$FLUTTER_DIR"; pub get > /dev/null) # Allows us to check if sky_engine's REVISION is correct
$DART --snapshot="$SNAPSHOT_PATH" --package-root="$FLUTTER_TOOLS_DIR/packages" "$SCRIPT_PATH"
echo -n $REVISION > "$STAMP_PATH"
fi

View File

@@ -6,6 +6,7 @@ REM found in the LICENSE file.
SETLOCAL ENABLEDELAYEDEXPANSION
FOR %%i IN ("%~dp0..") DO SET "flutter_root=%%~fi" REM Get the parent directory
SET flutter_tools_dir=%flutter_root%\packages\flutter_tools
SET flutter_dir=%flutter_root%\packages\flutter
SET snapshot_path=%flutter_root%\bin\cache\flutter_tools.snapshot
SET stamp_path=%flutter_root%\bin\cache\flutter_tools.stamp
SET script_path=%flutter_tools_dir%\bin\flutter_tools.dart
@@ -33,6 +34,9 @@ GOTO :after_snapshot
CD "%flutter_tools_dir%"
ECHO Updating flutter tool...
CALL pub.bat get
CD "%flutter_dir"
REM Allows us to check if sky_engine's REVISION is correct
CALL pub.bat get
CD "%flutter_root%"
CALL %dart% --snapshot="%snapshot_path%" --package-root="%flutter_tools_dir%\packages" "%script_path%"
<nul SET /p=%revision%> "%stamp_path%"