Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
run: dart pub get
- name: Run analyzers and linters
run: |
dart format --set-exit-if-changed .
dart format lib/src lib/pact_dart.dart test bin example --set-exit-if-changed .
dart analyze

tests:
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ contracts/

# Coverage
*.lcov
coverage/
coverage/

# Downloaded files
pact.h
libpact_ffi.so
2 changes: 2 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ analyzer:
camel_case_types: ignore
constant_identifier_names: ignore
non_constant_identifier_names: ignore
exclude:
- lib/src/bindings/library.dart
67 changes: 67 additions & 0 deletions doc/contribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Contributing to pact_dart

Thanks for contributing! Here’s how to get started:

---

## Run Tests

1. Clone and create a new branch:

```bash
git clone https://github.com/pact-foundation/pact-dart.git
cd pact-dart
git checkout -b my-change
```

2. Install dependencies:

```bash
dart pub get
dart run pact_dart:install
# Or use custom lib download path
PACT_DART_LIB_DOWNLOAD_PATH=. dart run pact_dart:install
```

3. Run tests:

```bash
dart test
# Or use custom lib download path
PACT_DART_LIB_DOWNLOAD_PATH=. dart test -j 1
```

## Generate Bindings with ffigen

1. Download Pact FFI headers

```bash
# Ubuntu
VERSION=0.4.27
wget "https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v$VERSION/pact.h"
# MacOS
VERSION=0.4.27
curl -O "https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v$VERSION/pact.h"
# Windows
$VERSION = "0.4.27"
Invoke-WebRequest -Uri "https://github.com/pact-foundation/pact-reference/releases/download/libpact_ffi-v$VERSION/pact.h" -OutFile "pact.h"
```

2. Install LLVM

```bash
# Ubuntu
sudo apt-get install libclang-dev
# Windows
winget install -e --id LLVM.LLVM
# MacOS
xcode-select --install
```

3. Regenerate bindings:

```bash
dart run ffigen
```

This will update the generated Dart bindings under `lib/gen/library.dart`.
Loading