Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter uniFFI #510

Merged
merged 64 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
67c8ca7
Flutter uniffi
dangeross Sep 20, 2024
a0021bf
Set on-demand resources
dangeross Sep 23, 2024
ab4de85
Do not build non-uniffi libraries
erdemyerebasmaz Sep 23, 2024
2a6694d
Change iosLibName
dangeross Sep 24, 2024
97f559c
Add BreezSDKLiquid as on demand resources
erdemyerebasmaz Sep 19, 2024
951528a
Use downloaded framework
dangeross Sep 25, 2024
1aa880f
Add Sources to published flutter package
dangeross Sep 25, 2024
fa6b04a
Set OTHER_LDFLAGS
dangeross Sep 25, 2024
e35b3ea
Add logging
dangeross Sep 26, 2024
ab4e42f
Refactor library initialization logic and throw an error if initializ…
erdemyerebasmaz Sep 26, 2024
c79343d
Do not statically link framework on production
erdemyerebasmaz Sep 26, 2024
d9d10eb
Use uniFFI headers to generate FlutterBreezLiquidBindings
erdemyerebasmaz Sep 26, 2024
407ad1d
Re add frb header
erdemyerebasmaz Sep 26, 2024
0f0278b
Correct the library name
erdemyerebasmaz Sep 26, 2024
76f34cd
Remove static_framework
dangeross Sep 27, 2024
0966c94
Move source header files
dangeross Sep 27, 2024
8352d7b
Copy iOS podspecs to macOS folder
erdemyerebasmaz Sep 29, 2024
c0224c1
Update version of macOS podspecs
erdemyerebasmaz Sep 29, 2024
8393861
Remove Windows & Linux support
erdemyerebasmaz Sep 29, 2024
111089c
Remove CMake scripts
erdemyerebasmaz Sep 29, 2024
dbdcbdd
Remove breez_sdk_liquid.podspec from version script
erdemyerebasmaz Sep 29, 2024
58725ae
Cleanup older build scripts used by melos & just recipes
erdemyerebasmaz Sep 29, 2024
c14e001
Remove softlink & copy recipes
erdemyerebasmaz Sep 29, 2024
5c22e6c
Rename link-uniffi recipe to link-headers
erdemyerebasmaz Sep 29, 2024
b59015e
Set package versions on production files as well when publishing
erdemyerebasmaz Sep 29, 2024
9fd7631
Include bindings project on melos script hooks
erdemyerebasmaz Sep 29, 2024
69979a1
Flutter uniffi
dangeross Sep 20, 2024
86d9be5
Set on-demand resources
dangeross Sep 23, 2024
555d8e5
Do not build non-uniffi libraries
erdemyerebasmaz Sep 23, 2024
41789ff
Change iosLibName
dangeross Sep 24, 2024
3c27363
Add BreezSDKLiquid as on demand resources
erdemyerebasmaz Sep 19, 2024
bda473f
Use downloaded framework
dangeross Sep 25, 2024
c557496
Add Sources to published flutter package
dangeross Sep 25, 2024
6cb5f53
Set OTHER_LDFLAGS
dangeross Sep 25, 2024
81fb4d2
Add logging
dangeross Sep 26, 2024
91c9b46
Refactor library initialization logic and throw an error if initializ…
erdemyerebasmaz Sep 26, 2024
98e7c9b
Do not statically link framework on production
erdemyerebasmaz Sep 26, 2024
e9783d6
Use uniFFI headers to generate FlutterBreezLiquidBindings
erdemyerebasmaz Sep 26, 2024
961ba6e
Re add frb header
erdemyerebasmaz Sep 26, 2024
c816ee2
Correct the library name
erdemyerebasmaz Sep 26, 2024
f49cf7e
Remove static_framework
dangeross Sep 27, 2024
1727b13
Move source header files
dangeross Sep 27, 2024
929686f
Copy iOS podspecs to macOS folder
erdemyerebasmaz Sep 29, 2024
1cf7496
Update version of macOS podspecs
erdemyerebasmaz Sep 29, 2024
e4083ad
Remove Windows & Linux support
erdemyerebasmaz Sep 29, 2024
97070f5
Remove CMake scripts
erdemyerebasmaz Sep 29, 2024
ad25d0e
Remove breez_sdk_liquid.podspec from version script
erdemyerebasmaz Sep 29, 2024
653f2bb
Cleanup older build scripts used by melos & just recipes
erdemyerebasmaz Sep 29, 2024
a622d79
Remove softlink & copy recipes
erdemyerebasmaz Sep 29, 2024
f4f34ef
Rename link-uniffi recipe to link-headers
erdemyerebasmaz Sep 29, 2024
22c800a
Set package versions on production files as well when publishing
erdemyerebasmaz Sep 29, 2024
0a7a3e4
Include bindings project on melos script hooks
erdemyerebasmaz Sep 29, 2024
932ec72
chore: just version
erdemyerebasmaz Sep 30, 2024
ba9d673
Merge branch 'cleanup' of https://github.com/breez/breez-sdk-liquid i…
erdemyerebasmaz Sep 30, 2024
8e33596
fix: remove unused files on "Set package version" step
erdemyerebasmaz Sep 30, 2024
8e9b0b8
copy FFI header files
erdemyerebasmaz Sep 30, 2024
471fd73
[WIP] Add macOS support
erdemyerebasmaz Sep 30, 2024
01135ce
remove example app on Flutter plugin
erdemyerebasmaz Sep 30, 2024
4fac0c9
Link headers before running ffigen on CI workflow
erdemyerebasmaz Sep 30, 2024
6e205f6
macOS: add macos/Sources folder to .gitignore
erdemyerebasmaz Sep 30, 2024
ff228f6
macOS: Copy iOS sources to macOS sources after downloading bindings
erdemyerebasmaz Sep 30, 2024
2941c3e
macOS: copy sources & framework file to macos folder on build-uniffi-…
erdemyerebasmaz Sep 30, 2024
2969136
import breez_sdk_liquidFFI header on plugin file
erdemyerebasmaz Sep 30, 2024
dcd9254
cleanup header file artifacts
erdemyerebasmaz Sep 30, 2024
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
133 changes: 0 additions & 133 deletions .github/workflows/build-bindings-flutter.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ jobs:
working-directory: lib/bindings/langs/flutter/
run: just codegen

- name: Link C Headers
working-directory: lib/bindings/langs/flutter/
if: ${{ success() || failure() }}
run: just link-headers

- name: Generate FFI bindings
working-directory: lib/bindings/langs/flutter/
if: ${{ success() || failure() }}
Expand Down
14 changes: 2 additions & 12 deletions .github/workflows/publish-all-platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,10 @@ jobs:
bindings-windows: ${{ !!needs.pre-setup.outputs.csharp-package-version || !!needs.pre-setup.outputs.golang-package-version || !!needs.pre-setup.outputs.python-package-version }}
bindings-darwin: ${{ !!needs.pre-setup.outputs.csharp-package-version || !!needs.pre-setup.outputs.golang-package-version || !!needs.pre-setup.outputs.python-package-version || !!needs.pre-setup.outputs.swift-package-version }}
bindings-linux: ${{ !!needs.pre-setup.outputs.csharp-package-version || !!needs.pre-setup.outputs.golang-package-version || !!needs.pre-setup.outputs.python-package-version }}
bindings-flutter: ${{ !!needs.pre-setup.outputs.flutter-package-version }}
bindings-android: ${{ !!needs.pre-setup.outputs.kotlin-multiplatform-package-version || !!needs.pre-setup.outputs.maven-package-version || !!needs.pre-setup.outputs.golang-package-version }}
bindings-ios: ${{ !!needs.pre-setup.outputs.kotlin-multiplatform-package-version || !!needs.pre-setup.outputs.maven-package-version || !!needs.pre-setup.outputs.swift-package-version }}
kotlin: ${{ !!needs.pre-setup.outputs.kotlin-multiplatform-package-version || !!needs.pre-setup.outputs.maven-package-version }}
swift: ${{ !!needs.pre-setup.outputs.swift-package-version }}
swift: ${{ !!needs.pre-setup.outputs.swift-package-version || !!needs.pre-setup.outputs.flutter-package-version }}
python: ${{ !!needs.pre-setup.outputs.python-package-version }}
csharp: ${{ !!needs.pre-setup.outputs.csharp-package-version }}
golang: ${{ !!needs.pre-setup.outputs.golang-package-version }}
Expand Down Expand Up @@ -152,15 +151,6 @@ jobs:
ref: ${{ needs.setup.outputs.ref }}
use-dummy-binaries: ${{ needs.setup.outputs.use-dummy-binaries == 'true' }}

build-bindings-flutter:
needs: setup
if: ${{ needs.setup.outputs.bindings-flutter == 'true' }}
uses: ./.github/workflows/build-bindings-flutter.yml
with:
repository: ${{ needs.setup.outputs.repository }}
ref: ${{ needs.setup.outputs.ref }}
use-dummy-binaries: ${{ needs.setup.outputs.use-dummy-binaries == 'true' }}

build-bindings-android:
needs: setup
if: ${{ needs.setup.outputs.bindings-android == 'true' }}
Expand Down Expand Up @@ -275,7 +265,7 @@ jobs:
publish-flutter:
needs:
- setup
- build-bindings-flutter
- build-language-bindings
- publish-dart
if: ${{ needs.setup.outputs.flutter == 'true' }}
uses: ./.github/workflows/publish-flutter.yml
Expand Down
41 changes: 22 additions & 19 deletions .github/workflows/publish-flutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,19 @@ jobs:
run: |
rm -rf android
rm -rf ios
rm -rf macos
rm -rf lib
cp -r ../build/packages/flutter/android .
cp -r ../build/packages/flutter/ios .
cp -r ../build/packages/flutter/macos .
mv android/build.gradle.production android/build.gradle
mv ios/flutter_breez_liquid.podspec.production ios/flutter_breez_liquid.podspec
rm ios/breez_sdk_liquid.podspec
mv macos/flutter_breez_liquid.podspec.production macos/flutter_breez_liquid.podspec
cp -r ../build/packages/flutter/lib .
cp -r ../build/lib/bindings/langs/flutter/breez_sdk_liquid/include/breez_sdk_liquid.h ios/Classes
cp -r ../build/lib/bindings/langs/flutter/breez_sdk_liquid/include/breez_sdk_liquid.h macos/Classes
cp -r ../build/lib/bindings/langs/flutter/breez_sdk_liquidFFI/include/breez_sdk_liquidFFI.h ios/Classes
cp -r ../build/lib/bindings/langs/flutter/breez_sdk_liquidFFI/include/breez_sdk_liquidFFI.h macos/Classes
cp ../build/packages/flutter/analysis_options.yaml .
cp ../build/packages/flutter/pubspec.yaml .
cp ../build/packages/flutter/pubspec_overrides.yaml .
Expand All @@ -78,24 +83,35 @@ jobs:

- uses: actions/download-artifact@v4
with:
name: bindings-flutter
path: bindings/
name: bindings-swift
path: dist/ios/Sources/BreezSDKLiquid/

- name: Cleanup header file artifacts
working-directory: dist/ios/Sources/BreezSDKLiquid/
run: |
rm breez_sdk_liquidFFI.h
rm breez_sdk_liquidFFI.modulemap

- name: Copy iOS sources to macOS sources
working-directory: dist
run: |
cp -r ios/Sources/ macos/Sources/

- name: Set package version
working-directory: dist
run: |
sed -i.bak -e 's/version:.*/version: ${{ inputs.package-version }}/' pubspec.yaml
sed -i.bak -e 's/path:.*/git:\n url: git@github.com:breez\/breez-sdk-liquid-dart.git\n ref: ${{ inputs.package-version }}/' pubspec_overrides.yaml
sed -i.bak -e "s/^version .*/version '${{ inputs.package-version }}'/" android/build.gradle
sed -i.bak -e 's/set(TagName.*/set(TagName "v${{ inputs.package-version }}")/' android/CMakeLists.txt
sed -i.bak -e "s/^version = .*/version = '${{ inputs.package-version }}'/" ios/flutter_breez_liquid.podspec
sed -i.bak -e "s/^version = .*/version = '${{ inputs.package-version }}'/" macos/flutter_breez_liquid.podspec
rm pubspec.yaml.bak
rm pubspec_overrides.yaml.bak
rm android/build.gradle.bak
rm android/CMakeLists.txt.bak
rm ios/flutter_breez_liquid.podspec.bak
rm macos/flutter_breez_liquid.podspec.bak

- name: Update version number on podspec files & CMake scripts
- name: Update version number on podspec & gradle files
working-directory: build/lib/bindings/langs/flutter/
run: bash scripts/version.sh

Expand All @@ -118,16 +134,3 @@ jobs:
git push
git tag v${{ inputs.package-version }} -m "v${{ inputs.package-version }}"
git push --tags

- name: Release and attach binary artifacts
if: ${{ inputs.publish }}
uses: softprops/action-gh-release@v2
with:
repository: breez/breez-sdk-liquid-flutter
files: |
bindings/android.tar.gz
bindings/breez_sdk_liquid.xcframework.zip
tag_name: v${{ inputs.package-version || '0.0.1' }}
generate_release_notes: false
token: ${{ secrets.SWIFT_RELEASE_TOKEN }}
prerelease: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# symlink headers
packages/flutter/ios/Classes/breez_sdk_liquid.h
packages/flutter/macos/Classes/breez_sdk_liquid.h
packages/flutter/ios/Classes/breez_sdk_liquidFFI.h
packages/flutter/macos/Classes/breez_sdk_liquidFFI.h
# Miscellaneous
.DS_Store
.idea/
Expand Down
4 changes: 2 additions & 2 deletions cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ abstract class ForegroundService : SdkForegroundService, EventListener, Service(
}

@Suppress("unused")
fun setLogger(logger: Logger) {
fun setServiceLogger(logger: Logger) {
this.logger = ServiceLogger(logger)
}
}
Empty file.
Loading
Loading