Skip to content

Commit b9d5af6

Browse files
Merge pull request #152 from LtbLightning/0.31.2-policy-patch
0.31.2 policy patch
2 parents 8d7d89b + cc3e0e2 commit b9d5af6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+697
-678
lines changed

.github/workflows/precompile_binaries.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
uses: android-actions/setup-android@v2
3838
- name: Install Specific NDK
3939
if: (matrix.os == 'ubuntu-20.04')
40-
run: sdkmanager --install "ndk;24.0.8215888"
40+
run: sdkmanager --install "ndk;25.1.8937393"
4141
- name: Precompile (with iOS)
4242
if: (matrix.os == 'macOS-latest')
4343
run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=LtbLightning/bdk-flutter
@@ -47,7 +47,7 @@ jobs:
4747
PRIVATE_KEY: ${{ secrets.CARGOKIT_PRIVATE_KEY }}
4848
- name: Precompile (with Android)
4949
if: (matrix.os == 'ubuntu-20.04')
50-
run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=LtbLightning/bdk-flutter --android-sdk-location=/usr/local/lib/android/sdk --android-ndk-version=24.0.8215888 --android-min-sdk-version=23
50+
run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=LtbLightning/bdk-flutter --android-sdk-location=/usr/local/lib/android/sdk --android-ndk-version=25.1.8937393 --android-min-sdk-version=23
5151
working-directory: cargokit/build_tool
5252
env:
5353
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}

CHANGELOG.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## [0.31.3]
2+
#### Upgrades
3+
- Updated `Flutter` dependencies to the latest version.
4+
- Upgraded `Gradle` to version 8.4 and `Java` to version 17.
5+
- Upgraded `android-ndk` to `25.1.8937393`.
6+
#### Fixed
7+
- Removed unnecessary class exports.
8+
- Resolved the `txBuilder.setRecipients` error.
9+
110
## [0.31.2]
211
Updated `flutter_rust_bridge` to `2.0.0`.
312
#### APIs added
@@ -174,4 +183,4 @@ Updated API to match bdk-ffi
174183
- Create Transaction
175184
- Sign Transaction
176185
- Broadcast Transaction
177-
- Quick Send
186+
- Quick Send

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ To use the `bdk_flutter` package in your project, add it as a dependency in your
3939

4040
```dart
4141
dependencies:
42-
bdk_flutter: ^0.31.2
42+
bdk_flutter: ^0.31.3
4343
```
4444

4545
### Examples

analysis_options.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include: package:lints/recommended.yaml
1+
include: package:lints/core.yaml
22
# Additional information about this file can be found at
33
# https://dart.dev/guides/language/analysis-options
44

android/build.gradle

+8-21
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
group 'io.bdk.f.bdk_flutter'
2-
version '1.0-SNAPSHOT'
2+
version '0.31.3'
33
buildscript {
4-
ext.kotlin_version = '1.6.10'
54
repositories {
65
google()
76
mavenCentral()
87
}
98

109
dependencies {
1110
classpath 'com.android.tools.build:gradle:7.2.1'
12-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1311
}
1412
}
1513

@@ -22,33 +20,22 @@ allprojects {
2220
}
2321

2422
apply plugin: 'com.android.library'
25-
apply plugin: 'kotlin-android'
2623

2724
android {
28-
compileSdkVersion 31
29-
namespace "io.bdk.f.bdk_flutter"
30-
compileOptions {
31-
sourceCompatibility JavaVersion.VERSION_1_8
32-
targetCompatibility JavaVersion.VERSION_1_8
33-
}
34-
35-
kotlinOptions {
36-
jvmTarget = '1.8'
25+
if (project.android.hasProperty("namespace")) {
26+
namespace "io.bdk.f.bdk_flutter"
3727
}
38-
39-
sourceSets {
40-
main.java.srcDirs += 'src/main/kotlin'
28+
compileSdkVersion 33
29+
ndkVersion android.ndkVersion
30+
compileOptions {
31+
sourceCompatibility JavaVersion.VERSION_17
32+
targetCompatibility JavaVersion.VERSION_17
4133
}
4234

4335
defaultConfig {
4436
minSdkVersion 23
4537
}
4638
}
47-
dependencies {
48-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
49-
implementation 'androidx.databinding:databinding-runtime:7.2.1'
50-
testImplementation 'junit:junit:4.13.2'
51-
}
5239
apply from: "../cargokit/gradle/plugin.gradle"
5340

5441
cargokit {
-58.1 KB
Binary file not shown.

android/gradle/wrapper/gradle-wrapper.properties

-5
This file was deleted.

cargokit/.github/workflows/check_and_lint.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jobs:
1010
Flutter:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 #v2.7.0
14-
- uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d #1.6.0
13+
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # 4.1.0
14+
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 # 2.16.0
1515
- name: Pub Get
1616
run: dart pub get --no-precompile
1717
working-directory: build_tool
@@ -22,5 +22,5 @@ jobs:
2222
run: dart analyze
2323
working-directory: build_tool
2424
- name: Test
25-
run: dart test
25+
run: flutter test
2626
working-directory: build_tool

cargokit/.github/workflows/test_example_plugin_build.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
git clone -b advanced https://github.com/irondash/hello_rust_ffi_plugin
4040
cd hello_rust_ffi_plugin
4141
git subtree pull --prefix cargokit https://github.com/${{ github.event.pull_request.head.repo.full_name || github.repository }} ${{ steps.extract_branch.outputs.branch }} --squash
42-
- uses: subosito/flutter-action@cc97e1648fff6ca5cc647fa67f47e70f7895510b # 2.11.0
42+
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 # 2.16.0
4343
with:
4444
channel: "stable"
4545
- name: Install GTK
@@ -77,6 +77,10 @@ jobs:
7777
shell: bash
7878
working-directory: ${{ env.EXAMPLE_DIR }}
7979
run: |
80-
export JAVA_HOME=$JAVA_HOME_11_X64
80+
if [[ $(sysctl hw.optional.arm64) == *"hw.optional.arm64: 1"* ]]; then
81+
export JAVA_HOME=$JAVA_HOME_17_arm64
82+
else
83+
export JAVA_HOME=$JAVA_HOME_11_X64
84+
fi
8185
flutter build apk --${{ matrix.build_mode }} -v
8286

cargokit/gradle/plugin.gradle

+5-1
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,12 @@ class CargoKitPlugin implements Plugin<Project> {
116116
}
117117

118118
def cargoBuildDir = "${project.buildDir}/build"
119+
120+
// Determine if the project is an application or library
121+
def isApplication = plugin.project.plugins.hasPlugin('com.android.application')
122+
def variants = isApplication ? plugin.project.android.applicationVariants : plugin.project.android.libraryVariants
119123

120-
plugin.project.android.applicationVariants.all { variant ->
124+
variants.all { variant ->
121125

122126
final buildType = variant.buildType.name
123127

cargokit/run_build_tool.sh

+5
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ if [ ! -f "$PACKAGE_HASH_FILE" ]; then
7777
echo "$PACKAGE_HASH" > "$PACKAGE_HASH_FILE"
7878
fi
7979

80+
# Rebuild the tool if it was deleted by Android Studio
81+
if [ ! -f "bin/build_tool_runner.dill" ]; then
82+
"$DART" compile kernel bin/build_tool_runner.dart
83+
fi
84+
8085
set +e
8186

8287
"$DART" bin/build_tool_runner.dill "$@"

example/android/app/build.gradle

+16-41
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,35 @@
1-
def localProperties = new Properties()
2-
def localPropertiesFile = rootProject.file('local.properties')
3-
if (localPropertiesFile.exists()) {
4-
localPropertiesFile.withReader('UTF-8') { reader ->
5-
localProperties.load(reader)
6-
}
7-
}
8-
9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
13-
14-
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15-
if (flutterVersionCode == null) {
16-
flutterVersionCode = '1'
17-
}
181

19-
def flutterVersionName = localProperties.getProperty('flutter.versionName')
20-
if (flutterVersionName == null) {
21-
flutterVersionName = '1.0'
2+
plugins {
3+
id "com.android.application"
4+
id "kotlin-android"
5+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
6+
id "dev.flutter.flutter-gradle-plugin"
227
}
238

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
289
android {
29-
compileSdkVersion flutter.compileSdkVersion
30-
ndkVersion flutter.ndkVersion
10+
namespace = "io.bdk.f.bdk_flutter_example"
11+
compileSdk = flutter.compileSdkVersion
12+
ndkVersion "25.1.8937393"
3113

3214
compileOptions {
33-
sourceCompatibility JavaVersion.VERSION_1_8
34-
targetCompatibility JavaVersion.VERSION_1_8
15+
sourceCompatibility JavaVersion.VERSION_17
16+
targetCompatibility JavaVersion.VERSION_17
3517
}
36-
3718
kotlinOptions {
38-
jvmTarget = '1.8'
19+
jvmTarget = JavaVersion.VERSION_17
3920
}
4021

41-
sourceSets {
42-
main.java.srcDirs += 'src/main/kotlin'
43-
}
22+
4423

4524
defaultConfig {
4625
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4726
applicationId "io.bdk.f.bdk_flutter_example"
4827
// You can update the following values to match your application needs.
4928
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
50-
minSdkVersion 23
51-
targetSdkVersion flutter.targetSdkVersion
52-
versionCode flutterVersionCode.toInteger()
53-
versionName flutterVersionName
29+
minSdk = 23
30+
targetSdk = flutter.targetSdkVersion
31+
versionCode = flutter.versionCode
32+
versionName = flutter.versionName
5433
}
5534

5635
buildTypes {
@@ -60,13 +39,9 @@ android {
6039
signingConfig signingConfigs.debug
6140
}
6241
}
63-
namespace 'io.bdk.f.bdk_flutter_example'
6442
}
6543

6644
flutter {
6745
source '../..'
6846
}
6947

70-
dependencies {
71-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
72-
}

example/android/build.gradle

+3-16
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,18 @@
1-
buildscript {
2-
ext.kotlin_version = '1.7.10'
3-
repositories {
4-
google()
5-
mavenCentral()
6-
}
7-
8-
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.2.1'
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-
}
12-
}
13-
141
allprojects {
152
repositories {
163
google()
174
mavenCentral()
185
}
196
}
207

21-
rootProject.buildDir = '../build'
8+
rootProject.buildDir = "../build"
229
subprojects {
2310
project.buildDir = "${rootProject.buildDir}/${project.name}"
2411
}
2512
subprojects {
26-
project.evaluationDependsOn(':app')
13+
project.evaluationDependsOn(":app")
2714
}
2815

2916
tasks.register("clean", Delete) {
3017
delete rootProject.buildDir
31-
}
18+
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Fri Jun 23 08:50:38 CEST 2017
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
43
zipStoreBase=GRADLE_USER_HOME
54
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip

example/android/settings.gradle

+21-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
1-
include ':app'
1+
pluginManagement {
2+
def flutterSdkPath = {
3+
def properties = new Properties()
4+
file("local.properties").withInputStream { properties.load(it) }
5+
def flutterSdkPath = properties.getProperty("flutter.sdk")
6+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7+
return flutterSdkPath
8+
}()
29

3-
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4-
def properties = new Properties()
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
511

6-
assert localPropertiesFile.exists()
7-
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
17+
}
18+
plugins {
19+
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
20+
id "com.android.application" version "8.3.1" apply false
21+
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
22+
}
823

9-
def flutterSdkPath = properties.getProperty("flutter.sdk")
10-
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11-
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
24+
include ":app"

0 commit comments

Comments
 (0)