Skip to content

Commit f47ad69

Browse files
committed
Prepare dart package for publishing to pub.dev
1 parent dda19a2 commit f47ad69

8 files changed

Lines changed: 80 additions & 16 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[patch."https://github.com/payjoin/rust-payjoin.git"]
2+
payjoin-ffi = { path = ".." }
3+
payjoin = { path = "../../payjoin" }
4+
5+
[patch.crates-io]
6+
payjoin = { path = "../../payjoin" }
7+
payjoin-mailroom = { path = "../../payjoin-mailroom" }
8+
payjoin-test-utils = { path = "../../payjoin-test-utils" }

payjoin-ffi/dart/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ doc/api/
1212

1313
# Auto-generated bindings
1414
lib/payjoin.dart
15-
lib/bitcoin.dart
15+
16+
# Local Cargo overlay for monorepo dev
17+
!.cargo/config.toml

payjoin-ffi/dart/.pubignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.dart_tool/
2+
build/
3+
pubspec.lock
4+
doc/api/
5+
.cargo/
6+
contrib/
7+
scripts/
8+
9+
.DS_Store
10+
11+
# Native libraries are platform specific and built per consumer
12+
*.dylib
13+
*.so
14+
*.dll
15+
16+
# Cargo build output
17+
native/target/
18+
19+
# Local-only test helper re-export
20+
lib/test_utils.dart
21+
22+
# Tests require the broader Rust workspace + bitcoind to run
23+
test/

payjoin-ffi/dart/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## [0.1.1]
2+
3+
- Initial functional release published to pub.dev.
4+
- Bindings for payjoin-0.25.0
5+
6+
## [0.1.0]
7+
8+
- Internal release published to pub.dev to reserve the `payjoin` name.

payjoin-ffi/dart/LICENSE

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Permission is hereby granted, free of charge, to any person obtaining a copy
2+
of this software and associated documentation files (the "Software"), to deal
3+
in the Software without restriction, including without limitation the rights
4+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5+
copies of the Software, and to permit persons to whom the Software is
6+
furnished to do so, subject to the following conditions:
7+
8+
The above copyright notice and this permission notice shall be included in
9+
all copies or substantial portions of the Software.
10+
11+
Distributions of all or part of the Software intended to be used by the
12+
recipients as they would use the unmodified Software, containing modifications
13+
that substantially alter, remove, or disable functionality of the Software,
14+
outside of the documented configuration mechanisms provided by the Software,
15+
shall be modified such that the Original Author's bug reporting email
16+
addresses and urls are either replaced with the contact information of the
17+
parties responsible for the changes, or removed entirely.
18+
19+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25+
SOFTWARE.

payjoin-ffi/dart/hook/build.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1+
import 'dart:io';
2+
13
import 'package:hooks/hooks.dart';
24
import 'package:native_toolchain_rust/native_toolchain_rust.dart';
35

46
void main(List<String> args) async {
57
await build(args, (input, output) async {
8+
final localCargoConfig = File.fromUri(
9+
input.packageRoot.resolve('.cargo/config.toml'),
10+
);
11+
612
await RustBuilder(
713
assetName: 'uniffi:payjoin_ffi',
8-
features: ['_test-utils'],
14+
features: localCargoConfig.existsSync() ? ['_test-utils'] : [],
915
).run(input: input, output: output);
1016
});
1117
}

payjoin-ffi/dart/native/Cargo.toml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,4 @@ name = "payjoin_ffi_wrapper"
1616
crate-type = ["staticlib", "cdylib"]
1717

1818
[dependencies]
19-
payjoin-ffi = { git = "https://github.com/payjoin/rust-payjoin.git", branch = "master", features = [
20-
"dart",
21-
] }
22-
23-
[patch."https://github.com/payjoin/rust-payjoin.git"]
24-
payjoin-ffi = { path = "../.." }
25-
26-
[patch.crates-io]
27-
payjoin = { path = "../../../payjoin" }
28-
payjoin-mailroom = { path = "../../../payjoin-mailroom" }
29-
payjoin-test-utils = { path = "../../../payjoin-test-utils" }
19+
payjoin-ffi = { git = "https://github.com/payjoin/rust-payjoin.git", rev = "dda19a2945947b53b23a431b9303cb724dcca68d", features = ["dart"] }

payjoin-ffi/dart/pubspec.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
name: payjoin
22
description: Dart bindings for payjoin (EXPERIMENTAL)
3-
version: 0.1.0
3+
version: 0.1.1
4+
homepage: https://github.com/payjoin/rust-payjoin
5+
repository: https://github.com/payjoin/rust-payjoin
46

57
environment:
68
sdk: "^3.10.0"
79

810
dependencies:
911
ffi: ^2.1.4
10-
hooks: any
11-
code_assets: any
12+
hooks: ^1.0.0
13+
code_assets: ^1.0.0
1214
native_toolchain_rust: ^1.0.0
1315
dev_dependencies:
1416
test: ^1.26.2

0 commit comments

Comments
 (0)