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
8 changes: 5 additions & 3 deletions contrib/lockfile.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail

LOCKFILE="Cargo.lock"
LOCKDIR=".bak"
LOCKFILE_BAK="${LOCKDIR}/${LOCKFILE}"
# Absolute paths so the EXIT trap restores the lockfile even if the sourcing
# script changes directory after calling use_lockfile.
LOCKFILE="${PWD}/Cargo.lock"
LOCKDIR="${PWD}/.bak"
LOCKFILE_BAK="${LOCKDIR}/Cargo.lock"

_cleanup_lockfile() {
if [ -f "$LOCKFILE_BAK" ]; then
Expand Down
10 changes: 9 additions & 1 deletion payjoin-ffi/csharp/contrib/test.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail

cd "$(dirname "$0")/.."
# Build against the maintained lockfile instead of resolving the dependency
# graph fresh on every run. use_lockfile copies Cargo-recent.lock into place
# and restores the previous state when this script exits.
REPO_ROOT="$(cd "$(dirname "$0")/../../.." && pwd)"
cd "$REPO_ROOT"
source contrib/lockfile.sh
use_lockfile Cargo-recent.lock

cd "$REPO_ROOT/payjoin-ffi/csharp"

echo "==> Generating FFI bindings..."
bash ./scripts/generate_bindings.sh
Expand Down
22 changes: 22 additions & 0 deletions payjoin-ffi/csharp/scripts/generate_bindings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ $scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$payjoinFfiDir = Resolve-Path (Join-Path $scriptDir "..\..")
Set-Location $payjoinFfiDir

# Build against the maintained lockfile instead of resolving the dependency
# graph fresh on every run; mirrors contrib/lockfile.sh for this Windows entry
# point. The previous lockfile state is restored before the script exits.
$repoRoot = Resolve-Path (Join-Path $payjoinFfiDir "..")
$lockFile = Join-Path $repoRoot "Cargo.lock"
$lockBackup = $null
if (Test-Path $lockFile) {
$lockBackup = "$lockFile.bak"
Move-Item $lockFile $lockBackup -Force
}
Copy-Item (Join-Path $repoRoot "Cargo-recent.lock") $lockFile -Force

try {

Write-Host "Generating payjoin C#..."
if ($null -ne $env:PAYJOIN_FFI_FEATURES) {
$payjoinFfiFeatures = $env:PAYJOIN_FFI_FEATURES
Expand Down Expand Up @@ -73,4 +87,12 @@ Write-Host "Copying native library..."
New-Item -ItemType Directory -Force -Path "csharp/lib" | Out-Null
Copy-Item "../target/debug/$libName" "csharp/lib/$libName" -Force

}
finally {
Remove-Item $lockFile -Force -ErrorAction SilentlyContinue
if ($null -ne $lockBackup) {
Move-Item $lockBackup $lockFile -Force
}
}

Write-Host "All done!"
10 changes: 9 additions & 1 deletion payjoin-ffi/dart/contrib/test.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail

cd "$(dirname "$0")/.."
# Build against the maintained lockfile instead of resolving the dependency
# graph fresh on every run. use_lockfile copies Cargo-recent.lock into place
# and restores the previous state when this script exits.
REPO_ROOT="$(cd "$(dirname "$0")/../../.." && pwd)"
cd "$REPO_ROOT"
source contrib/lockfile.sh
use_lockfile Cargo-recent.lock

cd "$REPO_ROOT/payjoin-ffi/dart"

echo "==> Cleaning nested Cargo.lock..."
rm -f native/Cargo.lock
Expand Down
10 changes: 9 additions & 1 deletion payjoin-ffi/javascript/contrib/test.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail

cd "$(dirname "$0")/.."
# Build against the maintained lockfile instead of resolving the dependency
# graph fresh on every run. use_lockfile copies Cargo-recent.lock into place
# and restores the previous state when this script exits.
REPO_ROOT="$(cd "$(dirname "$0")/../../.." && pwd)"
cd "$REPO_ROOT"
source contrib/lockfile.sh
use_lockfile Cargo-recent.lock

cd "$REPO_ROOT/payjoin-ffi/javascript"

echo "==> Installing JavaScript dependencies..."
npm ci
Expand Down
10 changes: 9 additions & 1 deletion payjoin-ffi/python/contrib/test.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail

cd "$(dirname "$0")/.."
# Build against the maintained lockfile instead of resolving the dependency
# graph fresh on every run. use_lockfile copies Cargo-recent.lock into place
# and restores the previous state when this script exits.
REPO_ROOT="$(cd "$(dirname "$0")/../../.." && pwd)"
cd "$REPO_ROOT"
source contrib/lockfile.sh
use_lockfile Cargo-recent.lock

cd "$REPO_ROOT/payjoin-ffi/python"

echo "==> Syncing Python dependencies with uv..."
uv sync --all-extras
Expand Down
Loading