Publish Dart and Flutter packages (#356)

* Publish flutter artifacts and package

* Publish dart package

* Add LICENCE

* Force rm

* Don't copy lock files

* Fix output directory

* Fix podspec name

* Pass SWIFT_RELEASE_TOKEN

* Fix overrides indentation

* Update package version on CMake script

Update example dependencies

* Depend on dart & flutter packages from git on pubspec files

* Correct repository links & add publish_to: 'none'
* run just clean && just init

* Update README.md

* Download framework as part of prepare_command

* Use wget, then fallback to curl
* Remove redundant .zip suffix on the url

* Fix release tag

* Add v to tag replacement

* Fix podspec version

* Copy header file

* Downgrade vm_service

---------

Co-authored-by: Erdem Yerebasmaz <erdem@yerebasmaz.com>
This commit is contained in:
Ross Savage
2024-07-03 17:21:47 +02:00
committed by GitHub
parent 08b2e5a6e2
commit 3ea6b1a9dc
16 changed files with 368 additions and 91 deletions

View File

@@ -0,0 +1,110 @@
name: Build bindings for Flutter
on:
workflow_dispatch:
inputs:
ref:
description: 'commit/tag/branch reference'
required: true
type: string
workflow_call:
inputs:
repository:
description: 'sdk repository, defaults to current repository'
required: false
type: string
ref:
description: 'commit/tag/branch reference'
required: true
type: string
use-dummy-binaries:
description: 'If true, creates dummy binaries rather than real binaries'
required: false
type: boolean
default: false
jobs:
build:
if: ${{ !inputs.use-dummy-binaries }}
runs-on: macOS-latest
name: Build Flutter bindings
steps:
- name: checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
repository: ${{ inputs.repository || github.repository }}
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
version: "27.2"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Zig
uses: goto-bus-stop/setup-zig@v2
- uses: Swatinem/rust-cache@v2
with:
workspaces: lib
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
- run: flutter --version
- name: Set up just
uses: extractions/setup-just@v2
- name: Set up Melos
uses: bluefireteam/melos-action@v3
with:
run-bootstrap: false
- name: Initialize the workspace
working-directory: lib/bindings/langs/flutter/
run: |
just clean
just init
- name: Install flutter_rust_bridge_codegen dependencies
working-directory: lib/bindings/langs/flutter/
run: just frb
- name: Build bindings
working-directory: lib/bindings/langs/flutter/
run: just build
- name: Build language packages
working-directory: lib/bindings/langs/flutter/
run: melos build
- name: Copy build output
run: |
mkdir -p dist
cp lib/bindings/langs/flutter/platform-build/android.tar.gz dist
cp lib/bindings/langs/flutter/platform-build/breez_liquid_sdk.xcframework.zip dist
cp lib/bindings/langs/flutter/platform-build/other.tar.gz dist
- name: Archive Flutter bindings
uses: actions/upload-artifact@v3
with:
name: bindings-flutter
path: dist/*
build-dummies:
if: ${{ inputs.use-dummy-binaries }}
runs-on: macOS-latest
name: Build Flutter dummy bindings
steps:
- name: Create dummy files
run: |
touch android.tar.gz
touch breez_liquid_sdk.xcframework.zip
touch other.tar.gz
- name: Archive Flutter dummy bindings
uses: actions/upload-artifact@v3
with:
name: bindings-flutter
path: ./*

View File

@@ -98,6 +98,7 @@ 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 || !!needs.pre-setup.outputs.flutter-package-version }}
@@ -151,6 +152,15 @@ 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' }}
@@ -198,6 +208,19 @@ jobs:
# skip-tests: true
# secrets:
# NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
publish-dart:
needs:
- setup
if: ${{ needs.setup.outputs.flutter == 'true' }}
uses: ./.github/workflows/publish-dart.yml
with:
repository: ${{ needs.setup.outputs.repository }}
ref: ${{ needs.setup.outputs.ref }}
package-version: ${{ needs.setup.outputs.flutter-package-version }}
publish: ${{ needs.setup.outputs.publish == 'true' }}
secrets:
REPO_SSH_KEY: ${{ secrets.REPO_SSH_KEY }}
#
# publish-golang:
# needs:
@@ -248,20 +271,22 @@ jobs:
secrets:
BREEZ_MVN_USERNAME: ${{ secrets.BREEZ_MVN_USERNAME }}
BREEZ_MVN_PASSWORD: ${{ secrets.BREEZ_MVN_PASSWORD }}
# publish-flutter:
# needs:
# - setup
# - build-language-bindings
# if: ${{ needs.setup.outputs.flutter == 'true' }}
# uses: ./.github/workflows/publish-flutter.yml
# with:
# repository: ${{ needs.setup.outputs.repository }}
# ref: ${{ needs.setup.outputs.ref }}
# package-version: ${{ needs.setup.outputs.flutter-package-version }}
# publish: ${{ needs.setup.outputs.publish == 'true' }}
# secrets:
# REPO_SSH_KEY: ${{ secrets.REPO_SSH_KEY }}
publish-flutter:
needs:
- setup
- build-bindings-flutter
- publish-dart
if: ${{ needs.setup.outputs.flutter == 'true' }}
uses: ./.github/workflows/publish-flutter.yml
with:
repository: ${{ needs.setup.outputs.repository }}
ref: ${{ needs.setup.outputs.ref }}
package-version: ${{ needs.setup.outputs.flutter-package-version }}
publish: ${{ needs.setup.outputs.publish == 'true' }}
secrets:
REPO_SSH_KEY: ${{ secrets.REPO_SSH_KEY }}
SWIFT_RELEASE_TOKEN: ${{ secrets.SWIFT_RELEASE_TOKEN }}
# react native version x.y.z will at runtime require
# ios and android packages x.y.z being published already.

85
.github/workflows/publish-dart.yml vendored Normal file
View File

@@ -0,0 +1,85 @@
name: Publish Dart Package
on:
workflow_call:
inputs:
repository:
description: 'sdk repository, defaults to current repository'
required: false
type: string
ref:
description: 'commit/tag/branch reference'
required: true
type: string
package-version:
description: 'version for the dart package (MAJOR.MINOR.BUILD) (no v prefix)'
required: true
type: string
publish:
description: 'value indicating whether to commit/tag a release.'
required: true
type: boolean
default: true
secrets:
REPO_SSH_KEY:
description: 'ssh key to commit to the breez-liquid-sdk-dart repository'
required: true
jobs:
build-tag-release:
runs-on: ubuntu-latest
steps:
- name: Checkout breez-liquid-sdk-dart repo
uses: actions/checkout@v3
with:
repository: breez/breez-liquid-sdk-dart
ssh-key: ${{ secrets.REPO_SSH_KEY }}
fetch-depth: 0
path: dist
- name: Checkout breez-liquid-sdk repo
uses: actions/checkout@v3
with:
repository: ${{ inputs.repository || github.repository }}
ref: ${{ inputs.ref || github.sha }}
path: build
- name: Copy package files
working-directory: dist
run: |
rm -rf lib
cp -r ../build/packages/dart/lib .
cp ../build/packages/dart/analysis_options.yaml .
cp ../build/packages/dart/pubspec.yaml .
- name: Copy docs
working-directory: dist
run: |
cp ../build/packages/dart/CHANGELOG.md . || true
cp ../build/packages/dart/LICENSE . || true
cp ../build/packages/dart/README.md . || true
- name: Set package version
working-directory: dist
run: |
sed -i.bak -e 's/version:.*/version: ${{ inputs.package-version }}/' pubspec.yaml
rm pubspec.yaml.bak
- name: Archive Dart release
uses: actions/upload-artifact@v3
with:
name: breez-liquid-sdk-dart-${{ inputs.package-version || github.sha }}
path: |
dist/*
!dist/.git
- name: Tag the Dart package
working-directory: dist
if: ${{ inputs.publish }}
run: |
git config --global user.email github-actions@github.com
git config --global user.name github-actions
git add .
git commit -m "Update Dart package to version v${{ inputs.package-version }}"
git push
git tag v${{ inputs.package-version }} -m "v${{ inputs.package-version }}"
git push --tags

View File

@@ -23,6 +23,9 @@ on:
REPO_SSH_KEY:
description: 'ssh key to commit to the breez-liquid-sdk-flutter repository'
required: true
SWIFT_RELEASE_TOKEN:
description: 'github token to release to the breez-liquid-sdk-flutter repository'
required: true
jobs:
build-tag-release:
@@ -50,37 +53,42 @@ jobs:
- name: Copy package files
working-directory: dist
run: |
rm -r ios
rm -r android
rm -r lib
cp -r ../build/lib/bindings/langs/flutter/ios .
mv ios/breez_liquid_sdk.podspec.production ios/breez_liquid_sdk.podspec
cp -r ../build/lib/bindings/langs/flutter/android .
mv langs/android/build.gradle.production langs/android/build.gradle
cp -r ../build/lib/bindings/langs/flutter/lib .
cp ../build/lib/bindings/langs/flutter/pubspec.yaml .
cp ../build/lib/bindings/langs/flutter/pubspec.lock .
rm -rf android
rm -rf ios
rm -rf lib
cp -r ../build/packages/flutter/android .
cp -r ../build/packages/flutter/ios .
cp -r ../build/packages/flutter/lib .
cp -r ../build/lib/bindings/langs/flutter/breez_liquid_sdk/include/breez_liquid_sdk.h ios/Classes
cp ../build/packages/flutter/analysis_options.yaml .
cp ../build/packages/flutter/pubspec.yaml .
cp ../build/packages/flutter/pubspec_overrides.yaml .
- name: Copy docs
working-directory: dist
run: |
cp ../build/lib/bindings/langs/flutter/README.pub.md README.md || true
cp ../build/lib/bindings/langs/flutter/CHANGELOG.md . || true
cp ../build/packages/flutter/CHANGELOG.md . || true
cp ../build/packages/flutter/LICENSE . || true
cp ../build/packages/flutter/README.md . || true
- uses: actions/download-artifact@v3
with:
name: bindings-swift
path: dist/ios/bindings-swift/Sources/BreezLiquidSDK/
name: bindings-flutter
path: bindings/
- 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/^version .*/version '${{ inputs.package-version }}'/" langs/android/build.gradle
sed -i.bak -e "s/^tag_version = .*/tag_version = '${{ inputs.package-version }}'/" ios/breez_liquid_sdk.podspec
sed -i.bak -e 's/path:.*/git:\n url: git@github.com:breez\/breez-liquid-sdk-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
rm pubspec.yaml.bak
rm langs/android/build.gradle.bak
rm ios/breez_liquid_sdk.podspec.bak
rm pubspec_overrides.yaml.bak
rm android/build.gradle.bak
rm android/CMakeLists.txt.bak
rm ios/flutter_breez_liquid.podspec.bak
- name: Archive flutter release
uses: actions/upload-artifact@v3
@@ -97,7 +105,21 @@ jobs:
git config --global user.email github-actions@github.com
git config --global user.name github-actions
git add .
git commit -m "Update Breez SDK Flutter package to version v${{ inputs.package-version }}"
git commit -m "Update Flutter package to version v${{ inputs.package-version }}"
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-liquid-sdk-flutter
files: |
bindings/android.tar.gz
bindings/breez_liquid_sdk.xcframework.zip
bindings/other.tar.gz
tag_name: v${{ inputs.package-version || '0.0.1' }}
generate_release_notes: false
token: ${{ secrets.SWIFT_RELEASE_TOKEN }}
prerelease: true

View File

@@ -1,4 +1,4 @@
curr_version := "breez_liquid-v" + `awk '/^version: /{print $2}' ../../../../packages/dart/pubspec.yaml`
curr_version := "breez_liquid-v" + `awk '/^version: /{print $2}' ../../../../packages/flutter/pubspec.yaml`
frb_bin := "flutter_rust_bridge_codegen generate"
export CARGO_TERM_COLOR := "always"

View File

@@ -61,10 +61,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
url: "https://pub.dev"
source: hosted
version: "1.18.0"
version: "1.19.0"
conventional_commit:
dependency: transitive
description:
@@ -109,10 +109,10 @@ packages:
dependency: transitive
description:
name: http_parser
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
sha256: "40f592dd352890c3b60fec1b68e786cefb9603e05ff303dbc4dda49b304ecdf4"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "4.1.0"
io:
dependency: transitive
description:
@@ -181,10 +181,10 @@ packages:
dependency: transitive
description:
name: platform
sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec"
sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65"
url: "https://pub.dev"
source: hosted
version: "3.1.4"
version: "3.1.5"
pool:
dependency: transitive
description:
@@ -285,10 +285,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "2419f20b0c8677b2d67c8ac4d1ac7372d862dc6c460cdbb052b40155408cd794"
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
url: "https://pub.dev"
source: hosted
version: "0.7.1"
version: "0.7.2"
typed_data:
dependency: transitive
description:

View File

@@ -1,19 +1,19 @@
#!/bin/bash
CURR_VERSION=breez_liquid-v`awk '/^version: /{print $2}' ../../../packages/dart/pubspec.yaml`
ROOT="../../../.."
TAG_NAME=`awk '/^version: /{print $2}' $ROOT/packages/flutter/pubspec.yaml`
# iOS & macOS
APPLE_HEADER="release_tag_name = '$CURR_VERSION' # generated; do not edit"
sed -i.bak "1 s/.*/$APPLE_HEADER/" ../../../packages/flutter/ios/flutter_breez_liquid.podspec
sed -i.bak "1 s/.*/$APPLE_HEADER/" ../../../packages/flutter/macos/flutter_breez_liquid.podspec
rm ../../../packages/flutter/macos/*.bak ../../../packages/flutter/ios/*.bak
APPLE_HEADER="version = '$TAG_NAME' # generated; do not edit"
sed -i.bak "1 s/.*/$APPLE_HEADER/" $ROOT/packages/flutter/ios/flutter_breez_liquid.podspec
sed -i.bak "1 s/.*/$APPLE_HEADER/" $ROOT/packages/flutter/macos/flutter_breez_liquid.podspec
rm $ROOT/packages/flutter/macos/*.bak $ROOT/packages/flutter/ios/*.bak
# CMake platforms (Linux, Windows, and Android)
CMAKE_HEADER="set(LibraryVersion \"$CURR_VERSION\") # generated; do not edit"
CMAKE_HEADER="set(TagName \"v$TAG_NAME\") # generated; do not edit"
for CMAKE_PLATFORM in android linux windows
do
sed -i.bak "1 s/.*/$CMAKE_HEADER/" ../../../packages/flutter/$CMAKE_PLATFORM/CMakeLists.txt
rm ../../../packages/flutter/$CMAKE_PLATFORM/*.bak
sed -i.bak "1 s/.*/$CMAKE_HEADER/" $ROOT/packages/flutter/$CMAKE_PLATFORM/CMakeLists.txt
rm $ROOT/packages/flutter/$CMAKE_PLATFORM/*.bak
done
git add ../../../packages/flutter/
git add $ROOT/packages/flutter/

View File

@@ -2,7 +2,8 @@ name: breez_liquid
description: Dart bindings for the Breez Liquid SDK
version: 0.1.0
homepage: https://breez.technology
repository: https://github.com/breez/breez-liquid-sdk
repository: https://github.com/breez/breez-liquid-sdk-dart
publish_to: 'none'
platforms:
macos:

View File

@@ -3,11 +3,30 @@
[![pub package](https://img.shields.io/pub/v/breez_liquid_sdk.svg)](https://pub.dev/packages/breez_liquid_sdk)
## Table of contents
- [Platform Support](#platform-support)
- [Requirements](#requirements)
- [Description](#description)
- [Installation](#installation)
- [Usage](#usage)
- [Documentation](#documentation)
## Platform Support
| Android | iOS | MacOS | Web | Linux | Windows |
| :-----: | :-: | :---: | :-: | :---: | :----: |
| ✅ | ❎ | ❎ | ❎ | ❎ | ❎ |
## Requirements
- Flutter >=3.10.0
- Dart >=3.4.0 <4.0.0
- iOS >=12.0
- MacOS >=10.11
- Android `compileSDK` 31
- Java 1.8
- Android Gradle Plugin >=7.1.2
- Gradle wrapper >=7.4
## Description
This is a Flutter package that wraps the Dart bindings of [Breez Liquid SDK](https://github.com/breez/breez-liquid-sdk?tab=readme-ov-file#readme).

View File

@@ -1,4 +1,5 @@
set(LibraryVersion "breez_liquid-v0.1.0") # generated; do not edit
set(TagName "v0.1.0") # generated; do not edit
set(LibraryVersion "breez_liquid-${TagName}")
# Unlike the Windows & Linux CMakeLists.txt, this Android equivalent is just here
# to download the Android binaries into src/main/jniLibs/ and does not build anything.
@@ -15,7 +16,7 @@ set(LibRoot "${CMAKE_CURRENT_SOURCE_DIR}/src/main/jniLibs")
set(ArchivePath "${CMAKE_CURRENT_SOURCE_DIR}/${LibraryVersion}.tar.gz")
if(NOT EXISTS ${ArchivePath})
file(DOWNLOAD
"https://github.com/breez/breez-liquid-sdk/releases/download/${LibraryVersion}/android.tar.gz"
"https://github.com/breez/breez-liquid-sdk-flutter/releases/download/${TagName}/android.tar.gz"
${ArchivePath}
TLS_VERIFY ON
)

View File

@@ -12,7 +12,9 @@ dependencies:
sdk: flutter
flutter_rust_bridge: ^2.0.0
flutter_breez_liquid: ^0.1.0
flutter_breez_liquid:
git:
url: https://github.com/breez/breez-liquid-sdk-flutter
# When depending on this package from a real application you should use:
# flutter_breez_liquid: ^x.y.z
# See https://dart.dev/tools/pub/dependencies#version-constraints

View File

@@ -1,27 +1,17 @@
release_tag_name = 'breez_liquid-v0.1.0' # generated; do not edit
version = '0.1.0' # generated; do not edit
tag_name = "v#{version}"
release_tag_name = "breez_liquid-#{tag_name}"
# We cannot distribute the XCFramework alongside the library directly,
# so we have to fetch the correct version here.
framework_name = 'breez_liquid_sdk.xcframework'
remote_zip_name = "#{framework_name}.zip"
url = "https://github.com/breez/breez-liquid-sdk/releases/download/#{release_tag_name}/#{remote_zip_name}"
url = "https://github.com/breez/breez-liquid-sdk-flutter/releases/download/#{tag_name}/#{remote_zip_name}"
local_zip_name = "#{release_tag_name}.zip"
`
cd Frameworks
rm -rf #{framework_name}
if [ ! -f #{local_zip_name} ]
then
curl -L #{url} -o #{local_zip_name}
fi
unzip #{local_zip_name}
cd -
`
Pod::Spec.new do |spec|
spec.name = 'flutter_breez_liquid'
spec.version = '0.1.0'
spec.version = "#{version}"
spec.license = { :file => '../LICENSE' }
spec.homepage = 'https://breez.technology'
spec.authors = { 'Breez' => 'contact@breez.technology' }
@@ -32,6 +22,19 @@ Pod::Spec.new do |spec|
spec.public_header_files = 'Classes/**/*.h'
spec.vendored_frameworks = "Frameworks/#{framework_name}"
spec.prepare_command = <<-CMD
cd Frameworks
rm -rf #{framework_name}
if [ ! -f #{local_zip_name} ]
then
wget #{url} -O #{local_zip_name} || curl -L #{url} -o #{local_zip_name}
fi
unzip #{local_zip_name}
cd -
CMD
spec.ios.deployment_target = '12.0'
spec.osx.deployment_target = '10.11'
end

View File

@@ -1,4 +1,5 @@
set(LibraryVersion "breez_liquid-v0.1.0") # generated; do not edit
set(TagName "v0.1.0") # generated; do not edit
set(LibraryVersion "breez_liquid-${TagName}")
# The Flutter tooling requires that developers have CMake 3.10 or later
# installed. You should not increase this version, as doing so will cause
@@ -14,7 +15,7 @@ set(LibRoot "${CMAKE_CURRENT_SOURCE_DIR}/${LibraryVersion}")
set(ArchivePath "${LibRoot}.tar.gz")
if(NOT EXISTS ${ArchivePath})
file(DOWNLOAD
"https://github.com/breez/breez-liquid-sdk/releases/download/${LibraryVersion}/other.tar.gz"
"https://github.com/breez/breez-liquid-sdk-flutter/releases/download/${TagName}/other.tar.gz"
${ArchivePath}
TLS_VERIFY ON
)

View File

@@ -1,27 +1,17 @@
release_tag_name = 'breez_liquid-v0.1.0' # generated; do not edit
version = '0.1.0' # generated; do not edit
tag_name = "v#{version}"
release_tag_name = "breez_liquid-#{tag_name}"
# We cannot distribute the XCFramework alongside the library directly,
# so we have to fetch the correct version here.
framework_name = 'breez_liquid_sdk.xcframework'
remote_zip_name = "#{framework_name}.zip"
url = "https://github.com/breez/breez-liquid-sdk/releases/download/#{release_tag_name}/#{remote_zip_name}"
url = "https://github.com/breez/breez-liquid-sdk-flutter/releases/download/#{tag_name}/#{remote_zip_name}"
local_zip_name = "#{release_tag_name}.zip"
`
cd Frameworks
rm -rf #{framework_name}
if [ ! -f #{local_zip_name} ]
then
curl -L #{url} -o #{local_zip_name}
fi
unzip #{local_zip_name}
cd -
`
Pod::Spec.new do |spec|
spec.name = 'flutter_breez_liquid'
spec.version = '0.1.0'
spec.version = "#{version}"
spec.license = { :file => '../LICENSE' }
spec.homepage = 'https://breez.technology'
spec.authors = { 'Breez' => 'contact@breez.technology' }
@@ -32,6 +22,19 @@ Pod::Spec.new do |spec|
spec.public_header_files = 'Classes/**/*.h'
spec.vendored_frameworks = "Frameworks/#{framework_name}"
spec.prepare_command = <<-CMD
cd Frameworks
rm -rf #{framework_name}
if [ ! -f #{local_zip_name} ]
then
wget #{url} -O #{local_zip_name} || curl -L #{url} -o #{local_zip_name}
fi
unzip #{local_zip_name}
cd -
CMD
spec.ios.deployment_target = '12.0'
spec.osx.deployment_target = '10.11'
end

View File

@@ -2,6 +2,8 @@ name: flutter_breez_liquid
description: Flutter wrapper around Dart bindings for the Breez Liquid SDK
version: 0.1.0
homepage: https://breez.technology
repository: https://github.com/breez/breez-liquid-sdk-flutter
publish_to: 'none'
environment:
sdk: '>=3.4.0 <4.0.0'
@@ -10,7 +12,9 @@ environment:
dependencies:
flutter:
sdk: flutter
breez_liquid: ^0.1.0
breez_liquid:
git:
url: https://github.com/breez/breez-liquid-sdk-dart
ffigen: ">=8.0.0 <=11.0.0"
dev_dependencies:

View File

@@ -1,4 +1,5 @@
set(LibraryVersion "breez_liquid-v0.1.0") # generated; do not edit
set(TagName "v0.1.0") # generated; do not edit
set(LibraryVersion "breez_liquid-${TagName}")
# TODO Remove this workaround once Flutter supports Windows ARM.
# https://github.com/flutter/flutter/issues/116196
@@ -19,7 +20,7 @@ set(LibRoot "${CMAKE_CURRENT_SOURCE_DIR}/${LibraryVersion}")
set(ArchivePath "${LibRoot}.tar.gz")
if(NOT EXISTS ${ArchivePath})
file(DOWNLOAD
"https://github.com/breez/breez-liquid-sdk/releases/download/${LibraryVersion}/other.tar.gz"
"https://github.com/breez/breez-liquid-sdk-flutter/releases/download/${TagName}/other.tar.gz"
${ArchivePath}
TLS_VERIFY ON
)