Update CI scripts to use either src/flutter/third_party/dart or src/third_party/dart (flutter/engine#51276)
See https://github.com/flutter/flutter/issues/143335
This commit is contained in:
@@ -27,10 +27,18 @@ function follow_links() (
|
||||
echo "$file"
|
||||
)
|
||||
|
||||
function dart_bin() {
|
||||
dart_path="$1/flutter/third_party/dart/tools/sdks/dart-sdk/bin"
|
||||
if [[ ! -e "$dart_path" ]]; then
|
||||
dart_path="$1/third_party/dart/tools/sdks/dart-sdk/bin"
|
||||
fi
|
||||
echo "$dart_path"
|
||||
}
|
||||
|
||||
SCRIPT_DIR=$(follow_links "$(dirname -- "${BASH_SOURCE[0]}")")
|
||||
SRC_DIR="$(cd "$SCRIPT_DIR/../.."; pwd -P)"
|
||||
FLUTTER_DIR="$(cd "$SCRIPT_DIR/.."; pwd -P)"
|
||||
DART_BIN="${SRC_DIR}/third_party/dart/tools/sdks/dart-sdk/bin"
|
||||
DART_BIN=$(dart_bin "$SRC_DIR")
|
||||
DART="${DART_BIN}/dart"
|
||||
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
@@ -27,10 +27,18 @@ function follow_links() (
|
||||
echo "$file"
|
||||
)
|
||||
|
||||
function dart_bin() {
|
||||
dart_path="$1/flutter/third_party/dart/tools/sdks/dart-sdk/bin"
|
||||
if [[ ! -e "$dart_path" ]]; then
|
||||
dart_path="$1/third_party/dart/tools/sdks/dart-sdk/bin"
|
||||
fi
|
||||
echo "$dart_path"
|
||||
}
|
||||
|
||||
SCRIPT_DIR=$(follow_links "$(dirname -- "${BASH_SOURCE[0]}")")
|
||||
SRC_DIR="$(cd "$SCRIPT_DIR/../.."; pwd -P)"
|
||||
FLUTTER_DIR="$(cd "$SCRIPT_DIR/.."; pwd -P)"
|
||||
DART_BIN="${SRC_DIR}/third_party/dart/tools/sdks/dart-sdk/bin"
|
||||
DART_BIN=$(dart_bin "$SRC_DIR")
|
||||
DART="${DART_BIN}/dart"
|
||||
|
||||
# FLUTTER_LINT_PRINT_FIX will make it so that fix is executed and the generated
|
||||
|
||||
@@ -27,10 +27,18 @@ function follow_links() (
|
||||
echo "$file"
|
||||
)
|
||||
|
||||
function dart_bin() {
|
||||
dart_path="$1/flutter/third_party/dart/tools/sdks/dart-sdk/bin"
|
||||
if [[ ! -e "$dart_path" ]]; then
|
||||
dart_path="$1/third_party/dart/tools/sdks/dart-sdk/bin"
|
||||
fi
|
||||
echo "$dart_path"
|
||||
}
|
||||
|
||||
SCRIPT_DIR=$(follow_links "$(dirname -- "${BASH_SOURCE[0]}")")
|
||||
SRC_DIR="$(cd "$SCRIPT_DIR/../.."; pwd -P)"
|
||||
DART_SDK_DIR="${SRC_DIR}/third_party/dart/tools/sdks/dart-sdk"
|
||||
DART="${DART_SDK_DIR}/bin/dart"
|
||||
DART_BIN=$(dart_bin "$SRC_DIR")
|
||||
DART="${DART_BIN}/dart"
|
||||
|
||||
cd "$SCRIPT_DIR"
|
||||
"$DART" \
|
||||
|
||||
@@ -30,12 +30,20 @@ function follow_links() (
|
||||
echo "$file"
|
||||
)
|
||||
|
||||
function dart_bin() {
|
||||
dart_path="$1/flutter/third_party/dart/tools/sdks/dart-sdk/bin"
|
||||
if [[ ! -e "$dart_path" ]]; then
|
||||
dart_path="$1/third_party/dart/tools/sdks/dart-sdk/bin"
|
||||
fi
|
||||
echo "$dart_path"
|
||||
}
|
||||
|
||||
SCRIPT_DIR=$(follow_links "$(dirname -- "${BASH_SOURCE[0]}")")
|
||||
SRC_DIR="$(
|
||||
cd "$SCRIPT_DIR/../.."
|
||||
pwd -P
|
||||
)"
|
||||
DART_BIN="$SRC_DIR/third_party/dart/tools/sdks/dart-sdk/bin"
|
||||
DART_BIN=$(dart_bin "$SRC_DIR")
|
||||
PATH="$DART_BIN:$PATH"
|
||||
|
||||
# Use:
|
||||
|
||||
@@ -30,10 +30,18 @@ function follow_links() (
|
||||
echo "$file"
|
||||
)
|
||||
|
||||
function dart_bin() {
|
||||
dart_path="$1/flutter/third_party/dart/tools/sdks/dart-sdk/bin"
|
||||
if [[ ! -e "$dart_path" ]]; then
|
||||
dart_path="$1/third_party/dart/tools/sdks/dart-sdk/bin"
|
||||
fi
|
||||
echo "$dart_path"
|
||||
}
|
||||
|
||||
SCRIPT_DIR=$(follow_links "$(dirname -- "${BASH_SOURCE[0]}")")
|
||||
SRC_DIR="$(cd "$SCRIPT_DIR/../../.."; pwd -P)"
|
||||
DART_SDK_DIR="${SRC_DIR}/third_party/dart/tools/sdks/dart-sdk"
|
||||
DART="${DART_SDK_DIR}/bin/dart"
|
||||
DART_BIN=$(dart_bin "$SRC_DIR")
|
||||
DART="${DART_BIN}/dart"
|
||||
|
||||
cd "$SCRIPT_DIR"
|
||||
"$DART" --disable-dart-dev bin/parse_and_send.dart \
|
||||
|
||||
@@ -15,14 +15,21 @@ import sys
|
||||
import json
|
||||
|
||||
|
||||
def GetDartPath(buildroot):
|
||||
dart_path = path.join(buildroot, 'flutter', 'third_party', 'dart')
|
||||
if not path.exists(dart_path):
|
||||
dart_path = path.join(buildroot, 'third_party', 'dart')
|
||||
return dart_path
|
||||
|
||||
|
||||
def GetDartSdkGitRevision(buildroot):
|
||||
project_root = path.join(buildroot, 'third_party', 'dart')
|
||||
return subprocess.check_output(['git', '-C', project_root, 'rev-parse', 'HEAD']).strip()
|
||||
return subprocess.check_output(['git', '-C', GetDartPath(buildroot), 'rev-parse', 'HEAD']).strip()
|
||||
|
||||
|
||||
def GetDartSdkSemanticVersion(buildroot):
|
||||
project_root = path.join(buildroot, 'third_party', 'dart')
|
||||
return subprocess.check_output(['git', '-C', project_root, 'describe', '--abbrev=0']).strip()
|
||||
return subprocess.check_output(['git', '-C',
|
||||
GetDartPath(buildroot), 'describe', '--abbrev=0']).strip()
|
||||
|
||||
|
||||
def GetFlutterEngineGitRevision(buildroot):
|
||||
|
||||
@@ -13,7 +13,14 @@ import sys
|
||||
|
||||
SRC_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
|
||||
FLUTTER_DIR = os.path.join(SRC_ROOT, 'flutter')
|
||||
DART_BIN = os.path.join(SRC_ROOT, 'third_party', 'dart', 'tools', 'sdks', 'dart-sdk', 'bin')
|
||||
|
||||
|
||||
def GetDartBin():
|
||||
dart_bin = os.path.join(SRC_ROOT, 'flutter', 'third_party', 'dart', 'tools', 'sdks', 'dart-sdk', 'bin')
|
||||
if not os.path.exists(dart_bin):
|
||||
dart_bin = os.path.join(SRC_ROOT, 'third_party', 'dart', 'tools', 'sdks', 'dart-sdk', 'bin')
|
||||
return dart_bin
|
||||
|
||||
|
||||
def Main(argv):
|
||||
githook_args = [
|
||||
@@ -22,7 +29,7 @@ def Main(argv):
|
||||
]
|
||||
|
||||
result = subprocess.run([
|
||||
os.path.join(DART_BIN, 'dart'),
|
||||
os.path.join(GetDartBin(), 'dart'),
|
||||
'--disable-dart-dev',
|
||||
os.path.join(FLUTTER_DIR, 'tools', 'githooks', 'bin', 'main.dart'),
|
||||
] + githook_args + [
|
||||
|
||||
@@ -13,7 +13,14 @@ import sys
|
||||
|
||||
SRC_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
|
||||
FLUTTER_DIR = os.path.join(SRC_ROOT, 'flutter')
|
||||
DART_BIN = os.path.join(SRC_ROOT, 'third_party', 'dart', 'tools', 'sdks', 'dart-sdk', 'bin')
|
||||
|
||||
|
||||
def GetDartBin():
|
||||
dart_bin = os.path.join(SRC_ROOT, 'flutter', 'third_party', 'dart', 'tools', 'sdks', 'dart-sdk', 'bin')
|
||||
if not os.path.exists(dart_bin):
|
||||
dart_bin = os.path.join(SRC_ROOT, 'third_party', 'dart', 'tools', 'sdks', 'dart-sdk', 'bin')
|
||||
return dart_bin
|
||||
|
||||
|
||||
def Main(argv):
|
||||
githook_args = [
|
||||
@@ -22,7 +29,7 @@ def Main(argv):
|
||||
]
|
||||
|
||||
result = subprocess.run([
|
||||
os.path.join(DART_BIN, 'dart'),
|
||||
os.path.join(GetDartBin(), 'dart'),
|
||||
'--disable-dart-dev',
|
||||
os.path.join(FLUTTER_DIR, 'tools', 'githooks', 'bin', 'main.dart'),
|
||||
] + githook_args + [
|
||||
|
||||
@@ -14,9 +14,16 @@ import sys
|
||||
|
||||
SRC_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
|
||||
FLUTTER_DIR = os.path.join(SRC_ROOT, 'flutter')
|
||||
DART_BIN = os.path.join(SRC_ROOT, 'third_party', 'dart', 'tools', 'sdks', 'dart-sdk', 'bin')
|
||||
ENABLE_CLANG_TIDY = os.environ.get('PRE_PUSH_CLANG_TIDY')
|
||||
|
||||
|
||||
def GetDartBin():
|
||||
dart_bin = os.path.join(SRC_ROOT, 'flutter', 'third_party', 'dart', 'tools', 'sdks', 'dart-sdk', 'bin')
|
||||
if not os.path.exists(dart_bin):
|
||||
dart_bin = os.path.join(SRC_ROOT, 'third_party', 'dart', 'tools', 'sdks', 'dart-sdk', 'bin')
|
||||
return dart_bin
|
||||
|
||||
|
||||
def Main(argv):
|
||||
githook_args = [
|
||||
'--flutter',
|
||||
@@ -29,7 +36,7 @@ def Main(argv):
|
||||
]
|
||||
|
||||
result = subprocess.run([
|
||||
os.path.join(DART_BIN, 'dart'),
|
||||
os.path.join(GetDartBin(), 'dart'),
|
||||
'--disable-dart-dev',
|
||||
os.path.join(FLUTTER_DIR, 'tools', 'githooks', 'bin', 'main.dart'),
|
||||
] + githook_args + [
|
||||
|
||||
@@ -13,7 +13,14 @@ import sys
|
||||
|
||||
SRC_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
|
||||
FLUTTER_DIR = os.path.join(SRC_ROOT, 'flutter')
|
||||
DART_BIN = os.path.join(SRC_ROOT, 'third_party', 'dart', 'tools', 'sdks', 'dart-sdk', 'bin')
|
||||
|
||||
|
||||
def GetDartBin():
|
||||
dart_bin = os.path.join(SRC_ROOT, 'flutter', 'third_party', 'dart', 'tools', 'sdks', 'dart-sdk', 'bin')
|
||||
if not os.path.exists(dart_bin):
|
||||
dart_bin = os.path.join(SRC_ROOT, 'third_party', 'dart', 'tools', 'sdks', 'dart-sdk', 'bin')
|
||||
return dart_bin
|
||||
|
||||
|
||||
def Main(argv):
|
||||
githook_args = [
|
||||
@@ -22,7 +29,7 @@ def Main(argv):
|
||||
]
|
||||
|
||||
result = subprocess.run([
|
||||
os.path.join(DART_BIN, 'dart'),
|
||||
os.path.join(GetDartBin(), 'dart'),
|
||||
'--disable-dart-dev',
|
||||
os.path.join(FLUTTER_DIR, 'tools', 'githooks', 'bin', 'main.dart'),
|
||||
] + githook_args + [
|
||||
|
||||
Reference in New Issue
Block a user