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
214 changes: 0 additions & 214 deletions .github/workflows/release.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,3 @@ migrate_working_dir/
.dart_tool/
.packages
build/
rust/src/bin
android/src/main/jniLibs/
rust/default/
ios/include/
ios/libs/
macos/framework/
rust/libepic_cash_wallet.h
lib/git_versions.dart

scripts/windows/vcpkg/
scripts/linux/flutter_libmwc_bins/
scripts/ios/flutter_libmwc_bins/
scripts/android/flutter_libmwc_bins/
scripts/windows/flutter_libmwc_bins/
scripts/macos/flutter_libmwc_bins/
scripts/android/cache/
scripts/android/build/openssl/

linux/bin/

42 changes: 0 additions & 42 deletions .metadata

This file was deleted.

88 changes: 19 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,78 +1,28 @@
# `flutter_libmwc`
## Dependencies
### Rust
Install Rust: https://www.rust-lang.org/tools/install

### `cargo-ndk`
```sh
cargo install cargo-ndk
```

# Android
## Add targets to rust
```sh
rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android
```
Requires Dart 3.13+, Flutter 3.47+, and Rust 1.90.0 (pinned in
`rust/rust-toolchain.toml`). Install Rust with [rustup](https://rustup.rs/)
and make sure `rustup`, `cargo`, and `rustc` are on `PATH`.

## Install dependencies
```sh
# https://github.com/mwcproject/mwc-node/blob/master/doc/build.md#requirements
sudo apt install build-essential \
cmake \
git \
libgit2-dev \
clang \
debhelper \
libclang-dev \
libncurses5-dev \
libncursesw5-dev \
zlib1g-dev \
pkg-config \
llvm \
cargo \
rustc \
opencl-headers \
libssl-dev \
ocl-icd-opencl-dev \
libc6-dev-i386
```
The [build hook](https://dart.dev/tools/hooks) compiles `rust/` with
[native_toolchain_rust](https://pub.dev/packages/native_toolchain_rust).
Flutter bundles the resulting native asset, and `lib/mwc.dart` resolves its
symbols using `@Native`. No manual library copying or build scripts are needed.

## Build
```sh
cd scripts/android
./install_ndk.sh
./build_all.sh
```
Install the native build tools required by the Rust dependencies: a C/C++
compiler, CMake, libclang, pkg-config, Perl (for vendored OpenSSL), and `protoc`.
Use Xcode for Apple targets, Android SDK/NDK r27+ for Android, and Visual Studio's
Desktop development with C++ workload for Windows (MSVC).

# iOS
## Add targets to rust
```sh
rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim
flutter pub get
cd example
flutter run
```

## Install dependencies
```sh
cargo install cargo-lipo
cargo install cbindgen
```

## Build
```sh
cd scripts/ios
./build_all
```

# Windows
## Dependencies
Run `scripts/windows/deps.sh` (may need to alter permissions like with `chmod +x *.sh`) to install x86_64-w64-mingw32-gcc and clang or run
```sh
sudo apt-get install clang gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64
```

## Building for Windows
Run `scripts/windows/build_all.sh`

Libraries will be output to `scripts/windows/build`
The first build downloads Rust targets and Cargo dependencies. Later builds
reuse the build cache. `flutter test` also runs the hook and needs the native
build tools.

## Building on Windows
`build_all.ps1` is not confirmed working and may need work eg. may need some missing dependencies added but has been included as a starting point or example for Windows users
Wallet APIs remain in `lib/lib.dart` and `lib/mwc.dart`. The generated
`FlutterLibmwc.getPlatformVersion()` API and platform plugin scaffolding are removed.
3 changes: 3 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
analyzer:
exclude:
- build/**
include: package:flutter_lints/flutter.yaml

# Additional information about this file can be found at
Expand Down
9 changes: 0 additions & 9 deletions android/.gitignore

This file was deleted.

Loading