Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update CI scripts to use either src/flutter/third_party/dart or src/t…
…hird_party/dart

See flutter/flutter#143335
  • Loading branch information
jason-simmons committed Mar 8, 2024
commit 4f46602d45c2f94601b0e90fc4b6a180d9301f4a
10 changes: 9 additions & 1 deletion ci/check_build_configs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 9 additions & 1 deletion ci/clang_tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions ci/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
10 changes: 9 additions & 1 deletion ci/licenses.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 10 additions & 2 deletions testing/benchmark/upload_metrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
13 changes: 10 additions & 3 deletions tools/fuchsia/make_build_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,21 @@
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):
Expand Down
11 changes: 9 additions & 2 deletions tools/githooks/post-checkout
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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 + [
Expand Down
11 changes: 9 additions & 2 deletions tools/githooks/post-merge
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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 + [
Expand Down
11 changes: 9 additions & 2 deletions tools/githooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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 + [
Expand Down
11 changes: 9 additions & 2 deletions tools/githooks/pre-rebase
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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 + [
Expand Down