Create open Shorebird workspace meta-repo
This commit is contained in:
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
exec "$ROOT/scripts/platform_test_common.sh" linux
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
exec "$ROOT/scripts/platform_test_common.sh" macos
|
||||
Executable
+69
@@ -0,0 +1,69 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
PLATFORM="${1:?platform is required}"
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
DART_BIN="${DART_BIN:-dart}"
|
||||
FLUTTER_BIN="${FLUTTER_BIN:-flutter}"
|
||||
GO_BIN="${GO_BIN:-go}"
|
||||
|
||||
run() {
|
||||
echo
|
||||
echo "==> $*"
|
||||
"$@"
|
||||
}
|
||||
|
||||
require_command() {
|
||||
if ! command -v "$1" >/dev/null 2>&1; then
|
||||
echo "missing required command: $1" >&2
|
||||
exit 127
|
||||
fi
|
||||
}
|
||||
|
||||
require_command git
|
||||
require_command "$DART_BIN"
|
||||
require_command "$GO_BIN"
|
||||
|
||||
if [[ "$PLATFORM" == "macos" ]]; then
|
||||
if command -v xcodebuild >/dev/null 2>&1; then
|
||||
xcodebuild -version
|
||||
else
|
||||
echo "warning: xcodebuild not found; iOS follow-up checks will be unavailable." >&2
|
||||
fi
|
||||
fi
|
||||
|
||||
run git -C "$ROOT" submodule update --init --recursive
|
||||
run "$ROOT/scripts/write_gclient.sh" "$PLATFORM"
|
||||
run "$ROOT/scripts/sync_open_sources.sh"
|
||||
|
||||
export PATH="$ROOT/depot_tools:$PATH"
|
||||
if [[ "${SKIP_GCLIENT_SYNC:-0}" != "1" ]]; then
|
||||
require_command gclient
|
||||
run gclient sync --no-history
|
||||
else
|
||||
echo
|
||||
echo "==> skipping gclient sync because SKIP_GCLIENT_SYNC=1"
|
||||
fi
|
||||
|
||||
if [[ "${SKIP_TESTS:-0}" == "1" ]]; then
|
||||
echo
|
||||
echo "==> skipping tests because SKIP_TESTS=1"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
run bash -lc "cd '$ROOT/shorebird/packages/shorebird_cli' && '$DART_BIN' pub get && '$DART_BIN' test test/src/user_config_test.dart test/src/shorebird_env_test.dart test/src/shorebird_cli_command_runner_test.dart test/src/commands/init_command_test.dart"
|
||||
run bash -lc "cd '$ROOT/shorebird/packages/open_aot_patch_tools' && '$DART_BIN' pub get && '$DART_BIN' test"
|
||||
run bash -lc "cd '$ROOT/shorebird-server' && '$GO_BIN' test ./..."
|
||||
|
||||
AOT_ARGS="$ROOT/dart-sdk-new/out/ReleaseX64AotPatch/args.gn"
|
||||
if [[ -f "$AOT_ARGS" ]]; then
|
||||
run bash -lc "cd '$ROOT/testapps/license_flavor_patch_test' && '$FLUTTER_BIN' pub get && '$DART_BIN' run tool/verify_aot_patch.dart"
|
||||
else
|
||||
echo
|
||||
echo "==> skipping license/flavor AOT verification; missing $AOT_ARGS"
|
||||
fi
|
||||
|
||||
if [[ "$PLATFORM" == "macos" && "${RUN_IOS_SMOKE:-0}" == "1" ]]; then
|
||||
require_command "$FLUTTER_BIN"
|
||||
run bash -lc "cd '$ROOT/testapps/license_flavor_patch_test' && '$FLUTTER_BIN' build ios --debug --no-codesign"
|
||||
fi
|
||||
Executable
+49
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
UPDATER_SRC="${UPDATER_SRC:-$ROOT/updater}"
|
||||
UPDATER_URL="${UPDATER_URL:-https://github.com/shorebirdtech/updater.git}"
|
||||
TARGET="$ROOT/flutter/engine/src/flutter/third_party/updater"
|
||||
|
||||
echo "[open-source-sync] updater source: $UPDATER_SRC"
|
||||
echo "[open-source-sync] target: $TARGET"
|
||||
|
||||
mkdir -p "$(dirname "$TARGET")"
|
||||
|
||||
if [[ -L "$TARGET" ]]; then
|
||||
echo "[open-source-sync] updater target is already a symlink."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ -d "$TARGET/.git" ]]; then
|
||||
echo "[open-source-sync] updating existing updater checkout."
|
||||
git -C "$TARGET" fetch --tags origin
|
||||
git -C "$TARGET" checkout "${UPDATER_REVISION:-main}"
|
||||
if [[ "${UPDATER_REVISION:-main}" == "main" ]]; then
|
||||
git -C "$TARGET" pull --ff-only
|
||||
fi
|
||||
elif [[ -e "$TARGET" ]]; then
|
||||
echo "target exists but is not a symlink or git checkout: $TARGET" >&2
|
||||
exit 1
|
||||
elif [[ -d "$UPDATER_SRC/.git" ]]; then
|
||||
rel_target="$(python3 - "$TARGET" "$UPDATER_SRC" <<'PY'
|
||||
import os
|
||||
import sys
|
||||
print(os.path.relpath(sys.argv[2], os.path.dirname(sys.argv[1])))
|
||||
PY
|
||||
)"
|
||||
ln -s "$rel_target" "$TARGET"
|
||||
echo "[open-source-sync] linked updater submodule into Flutter engine."
|
||||
else
|
||||
echo "[open-source-sync] cloning public updater checkout."
|
||||
git clone "$UPDATER_URL" "$TARGET"
|
||||
git -C "$TARGET" checkout "${UPDATER_REVISION:-main}"
|
||||
fi
|
||||
|
||||
if [[ ! -f "$TARGET/library/include/updater_engine.h" ]]; then
|
||||
echo "updater checkout is missing library/include/updater_engine.h" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[open-source-sync] public Shorebird updater is available."
|
||||
Executable
+40
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
PLATFORM="${1:-}"
|
||||
|
||||
case "$PLATFORM" in
|
||||
linux)
|
||||
TARGET_OS='["linux"]'
|
||||
;;
|
||||
macos)
|
||||
TARGET_OS='["mac", "ios"]'
|
||||
;;
|
||||
*)
|
||||
echo "usage: $0 <linux|macos>" >&2
|
||||
exit 64
|
||||
;;
|
||||
esac
|
||||
|
||||
cat > "$ROOT/.gclient" <<EOF
|
||||
solutions = [
|
||||
{
|
||||
"name": "dart-sdk-new",
|
||||
"url": "https://git.tonycloud.org/dart-lang/sdk.git",
|
||||
"deps_file": "DEPS",
|
||||
"managed": False,
|
||||
"custom_deps": {},
|
||||
"custom_vars": {
|
||||
"dart_root": "dart-sdk-new",
|
||||
"download_android_deps": False,
|
||||
"checkout_javascript_engines": False,
|
||||
"checkout_benchmarks_internal": False,
|
||||
"checkout_flute": False,
|
||||
},
|
||||
},
|
||||
]
|
||||
target_os = $TARGET_OS
|
||||
EOF
|
||||
|
||||
echo "Wrote $ROOT/.gclient for $PLATFORM with target_os = $TARGET_OS"
|
||||
Reference in New Issue
Block a user