Skip to content
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -402,4 +402,6 @@ ASALocalRun/
.mfractor/

# Local History for Visual Studio
.localhistory/
.localhistory/
# tools/refresh-from-master.sh scratch (sibling clones + libmeos prefix).
.meos-chain/
35 changes: 35 additions & 0 deletions tools/refresh-from-master.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
# refresh-from-master.sh — refresh this binding's generated surface against the latest MEOS API,
# end to end, with one command:
#
# tools/refresh-from-master.sh
#
# It runs the shared MobilityDB/MEOS-API refresh-binding.sh over this repo — deriving the catalog
# and libmeos from the latest MobilityDB master and regenerating this binding's surface. The
# per-binding last leg is in tools/refresh.conf.
#
# All of refresh-binding.sh's options pass through, e.g.:
# tools/refresh-from-master.sh --mdb ~/src/MobilityDB # refresh against a local MobilityDB branch
# tools/refresh-from-master.sh --skip-tests # regenerate + build, skip the tests
#
# MEOSAPI=<path> uses an existing MEOS-API checkout (any branch); otherwise MEOS-API master is
# cloned into the work dir. WORK_DIR overrides the scratch location (default <repo>/.meos-chain).
set -euo pipefail

HERE="$(cd "$(dirname "$0")/.." && pwd)"
WORK="${WORK_DIR:-$HERE/.meos-chain}"
MEOSAPI="${MEOSAPI:-}"

if [ -z "$MEOSAPI" ]; then
MEOSAPI="$WORK/MEOS-API"
mkdir -p "$WORK"
if [ -d "$MEOSAPI/.git" ]; then
git -C "$MEOSAPI" fetch --quiet https://github.com/MobilityDB/MEOS-API master
git -C "$MEOSAPI" checkout --quiet FETCH_HEAD
else
git clone --quiet https://github.com/MobilityDB/MEOS-API "$MEOSAPI"
fi
fi

exec "$MEOSAPI/tools/refresh-binding.sh" \
--binding "$HERE" --meos-api "$MEOSAPI" --work-dir "$WORK" "$@"
13 changes: 13 additions & 0 deletions tools/refresh.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# refresh.conf — MEOS.NET's last leg for tools/refresh-binding.sh (in MEOS-API).
# The chain (MobilityDB -> catalog + libmeos) is shared; only these differ per binding.
# tools/codegen.py takes the catalog path as an argument, so CATALOG_DEST is empty and the
# catalog is read from $CATALOG; it regenerates the committed MEOS.NET/Internal/*.cs.
# BUILD_CMD runs from <repo>/<BUILD_DIR> with $PREFIX (libmeos prefix) and $CATALOG exported;
# $SKIP_TESTS is set when --skip-tests is passed.
ENGINE=csharp
BUILD_DIR=.
BUILD_LIBMEOS=true
CATALOG_DEST=
BUILD_CMD='python3 tools/codegen.py "$CATALOG"
dotnet build MEOS.NET.sln -c Release
[ -n "${SKIP_TESTS:-}" ] || LD_LIBRARY_PATH="$PREFIX/lib" dotnet test MEOS.NET.sln -c Release --no-build'
Loading