-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from LtbLightning/upgrade-v2.2
Upgrade v2.2
- Loading branch information
Showing
107 changed files
with
40,064 additions
and
14,940 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
on: | ||
push: | ||
branches: [main, v0.2.2-dev] | ||
|
||
name: Precompile Binaries | ||
|
||
jobs: | ||
Precompile: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-20.04 | ||
- macOS-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- name: Configure Cargo.toml optimizations | ||
run: | | ||
mkdir -p .cargo | ||
echo "[profile.release]" >> .cargo/config.toml | ||
echo "opt-level = 'z'" >> .cargo/config.toml | ||
echo "lto = true" >> .cargo/config.toml | ||
echo "codegen-units = 1" >> .cargo/config.toml | ||
echo "panic = 'abort'" >> .cargo/config.toml | ||
- uses: dart-lang/setup-dart@v1 | ||
- uses: subosito/flutter-action@v2 | ||
with: | ||
channel: 'stable' | ||
- name: Precompile (with iOS) | ||
if: (matrix.os == 'macOS-latest') | ||
run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=LtbLightning/ldk-node-flutter | ||
working-directory: cargokit/build_tool | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | ||
PRIVATE_KEY: ${{ secrets.CARGOKIT_PRIVATE_KEY }} | ||
- name: Precompile (with Android) | ||
if: (matrix.os == 'ubuntu-20.04') | ||
run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=LtbLightning/ldk-node-flutter --android-sdk-location=/usr/local/lib/android/sdk --android-ndk-version=24.0.8215888 --android-min-sdk-version=23 | ||
working-directory: cargokit/build_tool | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | ||
PRIVATE_KEY: ${{ secrets.CARGOKIT_PRIVATE_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
35 changes: 0 additions & 35 deletions
35
android/src/main/kotlin/io/ldk/f/ldk_node/LdkNodePlugin.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
name: Check and Lint | ||
|
||
jobs: | ||
Flutter: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 #v2.7.0 | ||
- uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d #1.6.0 | ||
- name: Pub Get | ||
run: dart pub get --no-precompile | ||
working-directory: build_tool | ||
- name: Dart Format | ||
run: dart format . --output=none --set-exit-if-changed | ||
working-directory: build_tool | ||
- name: Analyze | ||
run: dart analyze | ||
working-directory: build_tool | ||
- name: Test | ||
run: dart test | ||
working-directory: build_tool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
name: Test Example Plugin | ||
|
||
jobs: | ||
Build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- macOS-latest | ||
- windows-latest | ||
build_mode: | ||
- debug | ||
- profile | ||
- release | ||
env: | ||
EXAMPLE_DIR: "a b/hello_rust_ffi_plugin/example" | ||
CARGOKIT_VERBOSE: 1 | ||
steps: | ||
- name: Extract branch name | ||
shell: bash | ||
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | ||
id: extract_branch | ||
- name: Setup Repository | ||
shell: bash | ||
run: | | ||
mkdir "a b" # Space is intentional | ||
cd "a b" | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Your Name" | ||
# "advanced" branch has extra iOS flavor and uses rust nightly for release builds | ||
git clone -b advanced https://github.com/irondash/hello_rust_ffi_plugin | ||
cd hello_rust_ffi_plugin | ||
git subtree pull --prefix cargokit https://github.com/${{ github.event.pull_request.head.repo.full_name || github.repository }} ${{ steps.extract_branch.outputs.branch }} --squash | ||
- uses: subosito/flutter-action@cc97e1648fff6ca5cc647fa67f47e70f7895510b # 2.11.0 | ||
with: | ||
channel: "stable" | ||
- name: Install GTK | ||
if: (matrix.os == 'ubuntu-latest') | ||
run: sudo apt-get update && sudo apt-get install libgtk-3-dev | ||
- name: Install ninja-build | ||
if: (matrix.os == 'ubuntu-latest') | ||
run: sudo apt-get update && sudo apt-get install ninja-build | ||
- name: Build Linux (${{ matrix.build_mode }}) | ||
if: matrix.os == 'ubuntu-latest' | ||
shell: bash | ||
working-directory: ${{ env.EXAMPLE_DIR }} | ||
run: flutter build linux --${{ matrix.build_mode }} -v | ||
- name: Build macOS (${{ matrix.build_mode }}) | ||
if: matrix.os == 'macos-latest' | ||
shell: bash | ||
working-directory: ${{ env.EXAMPLE_DIR }} | ||
run: flutter build macos --${{ matrix.build_mode }} -v | ||
- name: Build iOS (${{ matrix.build_mode }}) | ||
if: matrix.os == 'macos-latest' | ||
shell: bash | ||
working-directory: ${{ env.EXAMPLE_DIR }} | ||
run: flutter build ios --${{ matrix.build_mode }} --no-codesign -v | ||
- name: Build iOS (${{ matrix.build_mode }}) - flavor1 | ||
if: matrix.os == 'macos-latest' | ||
shell: bash | ||
working-directory: ${{ env.EXAMPLE_DIR }} | ||
run: flutter build ios --flavor flavor1 --${{ matrix.build_mode }} --no-codesign -v | ||
- name: Build Windows (${{ matrix.build_mode }}) | ||
if: matrix.os == 'windows-latest' | ||
shell: bash | ||
working-directory: ${{ env.EXAMPLE_DIR }} | ||
run: flutter build windows --${{ matrix.build_mode }} -v | ||
- name: Build Android (${{ matrix.build_mode }}) | ||
shell: bash | ||
working-directory: ${{ env.EXAMPLE_DIR }} | ||
run: | | ||
export JAVA_HOME=$JAVA_HOME_11_X64 | ||
flutter build apk --${{ matrix.build_mode }} -v | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
target | ||
.dart_tool | ||
*.iml | ||
!pubspec.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
Copyright 2022 Matej Knopp | ||
|
||
================================================================================ | ||
|
||
MIT LICENSE | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | ||
of the Software, and to permit persons to whom the Software is furnished to do | ||
so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS | ||
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR | ||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
================================================================================ | ||
|
||
APACHE LICENSE, VERSION 2.0 | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Experimental repository to provide glue for seamlessly integrating cargo build | ||
with flutter plugins and packages. | ||
|
||
See https://matejknopp.com/post/flutter_plugin_in_rust_with_no_prebuilt_binaries/ | ||
for a tutorial on how to use Cargokit. | ||
|
||
Example plugin available at https://github.com/irondash/hello_rust_ffi_plugin. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
BASEDIR=$(dirname "$0") | ||
|
||
# Workaround for https://github.com/dart-lang/pub/issues/4010 | ||
BASEDIR=$(cd "$BASEDIR" ; pwd -P) | ||
|
||
# Remove XCode SDK from path. Otherwise this breaks tool compilation when building iOS project | ||
NEW_PATH=`echo $PATH | tr ":" "\n" | grep -v "Contents/Developer/" | tr "\n" ":"` | ||
|
||
export PATH=${NEW_PATH%?} # remove trailing : | ||
|
||
env | ||
|
||
# Platform name (macosx, iphoneos, iphonesimulator) | ||
export CARGOKIT_DARWIN_PLATFORM_NAME=$PLATFORM_NAME | ||
|
||
# Arctive architectures (arm64, armv7, x86_64), space separated. | ||
export CARGOKIT_DARWIN_ARCHS=$ARCHS | ||
|
||
# Current build configuration (Debug, Release) | ||
export CARGOKIT_CONFIGURATION=$CONFIGURATION | ||
|
||
# Path to directory containing Cargo.toml. | ||
export CARGOKIT_MANIFEST_DIR=$PODS_TARGET_SRCROOT/$1 | ||
|
||
# Temporary directory for build artifacts. | ||
export CARGOKIT_TARGET_TEMP_DIR=$TARGET_TEMP_DIR | ||
|
||
# Output directory for final artifacts. | ||
export CARGOKIT_OUTPUT_DIR=$PODS_CONFIGURATION_BUILD_DIR/$PRODUCT_NAME | ||
|
||
# Directory to store built tool artifacts. | ||
export CARGOKIT_TOOL_TEMP_DIR=$TARGET_TEMP_DIR/build_tool | ||
|
||
# Directory inside root project. Not necessarily the top level directory of root project. | ||
export CARGOKIT_ROOT_PROJECT_DIR=$SRCROOT | ||
|
||
FLUTTER_EXPORT_BUILD_ENVIRONMENT=( | ||
"$PODS_ROOT/../Flutter/ephemeral/flutter_export_environment.sh" # macOS | ||
"$PODS_ROOT/../Flutter/flutter_export_environment.sh" # iOS | ||
) | ||
|
||
for path in "${FLUTTER_EXPORT_BUILD_ENVIRONMENT[@]}" | ||
do | ||
if [[ -f "$path" ]]; then | ||
source "$path" | ||
fi | ||
done | ||
|
||
"$BASEDIR/run_build_tool.sh" build-pod "$@" | ||
|
||
# Make a symlink from built framework to phony file, which will be used as input to | ||
# build script. This should force rebuild (podspec currently doesn't support alwaysOutOfDate | ||
# attribute on custom build phase) | ||
ln -fs "$OBJROOT/XCBuildData/build.db" "${BUILT_PRODUCTS_DIR}/cargokit_phony" | ||
ln -fs "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" "${BUILT_PRODUCTS_DIR}/cargokit_phony_out" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
A sample command-line application with an entrypoint in `bin/`, library code | ||
in `lib/`, and example unit test in `test/`. |
Oops, something went wrong.