Fix macOS package build state reset
This commit is contained in:
parent
bd76a91130
commit
1d2c1b67b5
@ -11,6 +11,9 @@ APP_STORE_DEFINE="${APP_STORE_DEFINE:---dart-define=XWORKMATE_APP_STORE=${XWORKM
|
|||||||
PRODUCTS_DIR_NAME="$(tr '[:lower:]' '[:upper:]' <<< "${BUILD_MODE:0:1}")${BUILD_MODE:1}"
|
PRODUCTS_DIR_NAME="$(tr '[:lower:]' '[:upper:]' <<< "${BUILD_MODE:0:1}")${BUILD_MODE:1}"
|
||||||
BRIDGE_BINARY_NAME="${BRIDGE_BINARY_NAME:-xworkmate-go-core}"
|
BRIDGE_BINARY_NAME="${BRIDGE_BINARY_NAME:-xworkmate-go-core}"
|
||||||
BRIDGE_BUILD_PATH="${ROOT_DIR}/build/bin/${BRIDGE_BINARY_NAME}"
|
BRIDGE_BUILD_PATH="${ROOT_DIR}/build/bin/${BRIDGE_BINARY_NAME}"
|
||||||
|
FLUTTER_BUILD_STATE_DIR="${ROOT_DIR}/.dart_tool/flutter_build"
|
||||||
|
MACOS_BUILD_DIR="${ROOT_DIR}/build/macos"
|
||||||
|
NATIVE_ASSETS_DIR="${ROOT_DIR}/build/native_assets"
|
||||||
|
|
||||||
if [[ ! -f "$PUBSPEC_PATH" ]]; then
|
if [[ ! -f "$PUBSPEC_PATH" ]]; then
|
||||||
echo "Missing pubspec: $PUBSPEC_PATH" >&2
|
echo "Missing pubspec: $PUBSPEC_PATH" >&2
|
||||||
@ -41,6 +44,11 @@ echo "Building bundled Go core..."
|
|||||||
bash "$ROOT_DIR/scripts/build-go-core.sh"
|
bash "$ROOT_DIR/scripts/build-go-core.sh"
|
||||||
|
|
||||||
echo "Building $APP_NAME $APP_VERSION ($APP_BUILD) for macOS..."
|
echo "Building $APP_NAME $APP_VERSION ($APP_BUILD) for macOS..."
|
||||||
|
# Flutter caches native-asset installation state under .dart_tool/flutter_build,
|
||||||
|
# but Xcode consumes the copied frameworks from build/native_assets/macos.
|
||||||
|
# Reset both locations so packaging cannot reuse a stale stamp or stale layout.
|
||||||
|
rm -rf "$FLUTTER_BUILD_STATE_DIR" "$MACOS_BUILD_DIR" "$NATIVE_ASSETS_DIR"
|
||||||
|
|
||||||
BUILD_ARGS=(
|
BUILD_ARGS=(
|
||||||
flutter build macos
|
flutter build macos
|
||||||
"--$BUILD_MODE"
|
"--$BUILD_MODE"
|
||||||
@ -51,10 +59,6 @@ BUILD_ARGS=(
|
|||||||
"$APP_STORE_DEFINE"
|
"$APP_STORE_DEFINE"
|
||||||
)
|
)
|
||||||
|
|
||||||
if [[ -f "$APP_DIR/.dart_tool/package_config.json" ]]; then
|
|
||||||
BUILD_ARGS+=(--no-pub)
|
|
||||||
fi
|
|
||||||
|
|
||||||
(
|
(
|
||||||
cd "$APP_DIR"
|
cd "$APP_DIR"
|
||||||
"${BUILD_ARGS[@]}"
|
"${BUILD_ARGS[@]}"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user