diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 927ea24..90db335 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,223 +1,26 @@
-name: Build and Release
+name: Test native assets
on:
push:
- tags:
- - 'v[0-9]+.[0-9]+.[0-9]+'
+ pull_request:
workflow_dispatch:
jobs:
-
test:
- runs-on: ubuntu-24.04
- container:
- image: stackwallet/stackwallet-ci:latest
- steps:
- - uses: actions/checkout@v6
- with:
- submodules: recursive
-
- - uses: Swatinem/rust-cache@v2
- with:
- workspaces: src/serai
- key: test
-
- - name: Run tests
- run: |
- cd src/serai
- cargo +1.71.0 test --workspace --exclude bitcoin-serai
-
- build-linux:
- needs: test
- runs-on: ubuntu-24.04
- container:
- image: stackwallet/stackwallet-ci:latest
strategy:
matrix:
- include:
- - target: x86_64-unknown-linux-gnu
- asset: frostdart-linux-x86_64.so
- - target: aarch64-unknown-linux-gnu
- asset: frostdart-linux-aarch64.so
+ os: [ubuntu-24.04, ubuntu-24.04-arm, macos-latest, windows-latest]
+ runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- with:
- submodules: recursive
-
- - name: Add Rust target
- run: rustup +1.71.0 target add ${{ matrix.target }}
-
- - uses: Swatinem/rust-cache@v2
- with:
- workspaces: src/serai
- key: linux-${{ matrix.target }}
-
- - name: Build
- env:
- CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
- run: |
- cd src/serai/hrf
- cargo +1.71.0 build --target ${{ matrix.target }} --release --lib
- cp ../target/${{ matrix.target }}/release/libhrf_api.so \
- ../../../${{ matrix.asset }}
-
- - uses: actions/upload-artifact@v4
- with:
- name: ${{ matrix.asset }}
- path: ${{ matrix.asset }}
-
- build-android:
- needs: test
- runs-on: ubuntu-24.04
- container:
- image: stackwallet/stackwallet-ci:latest
- strategy:
- matrix:
- include:
- - target: aarch64-linux-android
- abi: arm64-v8a
- - target: armv7-linux-androideabi
- abi: armeabi-v7a
- - target: x86_64-linux-android
- abi: x86_64
- steps:
- - uses: actions/checkout@v6
- with:
- submodules: recursive
-
- - name: Add Rust target
- run: rustup +1.71.0 target add ${{ matrix.target }}
-
- - uses: Swatinem/rust-cache@v2
- with:
- workspaces: src/serai
- key: android-${{ matrix.abi }}
-
- - name: Build
- env:
- ANDROID_NDK_ROOT: /opt/android-ndk-r28
- run: |
- cd src/serai/hrf
- sed -i 's/\[dependencies\]/[dependencies]\nopenssl = { version = "<=0.10.78", features = ["vendored"] }\nopenssl-sys = "<=0.9.114"/' Cargo.toml
- cargo +1.71.0 ndk --target ${{ matrix.target }} --platform 21 build --release
- cp ../target/${{ matrix.target }}/release/libhrf_api.so \
- ../../../frostdart-android-${{ matrix.abi }}.so
-
- - uses: actions/upload-artifact@v4
- with:
- name: frostdart-android-${{ matrix.abi }}.so
- path: frostdart-android-${{ matrix.abi }}.so
-
- build-windows:
- needs: test
- runs-on: ubuntu-24.04
- container:
- image: stackwallet/stackwallet-ci:latest
- steps:
- - uses: actions/checkout@v6
- with:
- submodules: recursive
-
- - name: Add Rust target
- run: rustup +1.71.0 target add x86_64-pc-windows-gnu
-
- - uses: Swatinem/rust-cache@v2
- with:
- workspaces: src/serai
-
- - name: Build
- run: |
- cd src/serai/hrf
- cargo +1.71.0 build --target x86_64-pc-windows-gnu --release --lib
- cp ../target/x86_64-pc-windows-gnu/release/hrf_api.dll \
- ../../../frostdart-windows-x86_64.dll
-
- - uses: actions/upload-artifact@v4
- with:
- name: frostdart-windows-x86_64.dll
- path: frostdart-windows-x86_64.dll
-
- build-ios:
- needs: test
- runs-on: macos-latest
- steps:
- - uses: actions/checkout@v6
- with:
- submodules: recursive
-
- - uses: dtolnay/rust-toolchain@master
- with:
- toolchain: '1.71.0'
- targets: aarch64-apple-ios
-
- - uses: Swatinem/rust-cache@v2
- with:
- workspaces: src/serai
-
- - name: Build
- run: |
- cd src/serai/hrf
- sed -i '' 's/name = "hrf-api"/name = "frostdart"/' Cargo.toml
- export IPHONEOS_DEPLOYMENT_TARGET=15.0
- export RUSTFLAGS="-C link-arg=-mios-version-min=15.0"
- cargo build --target aarch64-apple-ios --release --lib
- cp ../target/aarch64-apple-ios/release/libfrostdart.a \
- ../../../frostdart-ios-aarch64.a
-
- - uses: actions/upload-artifact@v4
- with:
- name: frostdart-ios-aarch64.a
- path: frostdart-ios-aarch64.a
-
- build-macos:
- needs: test
- runs-on: macos-latest
- steps:
- - uses: actions/checkout@v6
- with:
- submodules: recursive
-
- - uses: dtolnay/rust-toolchain@master
- with:
- toolchain: '1.71.0'
- targets: aarch64-apple-darwin
-
- - uses: Swatinem/rust-cache@v2
- with:
- workspaces: src/serai
-
- - name: Build
- run: |
- cd src/serai/hrf
- cargo build --target aarch64-apple-darwin --release --lib
- xcodebuild -create-xcframework \
- -library ../target/aarch64-apple-darwin/release/libhrf_api.dylib \
- -output ../../../frostdart.xcframework
- cd ../../..
- zip -r frostdart.xcframework.zip frostdart.xcframework
-
- - uses: actions/upload-artifact@v4
- with:
- name: frostdart.xcframework.zip
- path: frostdart.xcframework.zip
-
- release:
- needs: [build-linux, build-android, build-ios, build-macos, build-windows]
- runs-on: ubuntu-latest
- permissions:
- contents: write
- steps:
- - uses: actions/download-artifact@v4
- with:
- path: artifacts
- merge-multiple: true
-
- - name: Generate checksums
- run: |
- cd artifacts
- sha256sum * > checksums.txt
-
- - uses: softprops/action-gh-release@v2
- with:
- generate_release_notes: true
- files: artifacts/*
+ - uses: dart-lang/setup-dart@v1
+ with:
+ sdk: '3.13.0'
+ - uses: dtolnay/rust-toolchain@1.90.0
+ - run: dart pub get --no-example
+ - run: dart analyze lib test hook
+ - run: dart test
+ - name: Rust tests
+ if: matrix.os == 'ubuntu-24.04'
+ working-directory: src/serai/hrf
+ run: cargo test --locked --workspace --exclude bitcoin-serai
diff --git a/.gitignore b/.gitignore
index 7474eca..37e1713 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,8 +31,3 @@ build/
.flutter-plugins
.flutter-plugins-dependencies
-
-android/src/main/jniLibs/
-
-/macos/frostdart.xcframework/
-/ios/libfrostdart.a
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index 01500a7..0000000
--- a/.gitmodules
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "src/serai"]
- path = src/serai
- url = https://github.com/kayabaNerve/serai
diff --git a/.metadata b/.metadata
index 75415e5..cdfc2c1 100644
--- a/.metadata
+++ b/.metadata
@@ -7,36 +7,4 @@ version:
revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
channel: stable
-project_type: plugin_ffi
-
-# Tracks metadata for the flutter migrate command
-migration:
- platforms:
- - platform: root
- create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
- base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
- - platform: android
- create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
- base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
- - platform: ios
- create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
- base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
- - platform: linux
- create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
- base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
- - platform: macos
- create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
- base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
- - platform: windows
- create_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
- base_revision: f468f3366c26a5092eb964a230ce7892fda8f2f8
-
- # User provided section
-
- # List of Local paths (relative to this file) that should be
- # ignored by the migrate tool.
- #
- # Files that are not part of the templates will be ignored by default.
- unmanaged_files:
- - 'lib/main.dart'
- - 'ios/Runner.xcodeproj/project.pbxproj'
+project_type: package_ffi
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 41cc7d8..8262515 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+## 0.3.0
+
+* Build Rust automatically with native assets (Dart 3.13+, Rust 1.90.0).
+* Replace `FrostdartBindings` with generated `@Native` functions; public wrappers remain available.
+
## 0.0.1
* TODO: Describe initial release.
diff --git a/README.md b/README.md
index 842e6ce..a78864f 100644
--- a/README.md
+++ b/README.md
@@ -1,17 +1,19 @@
# frostdart
-Dart interface to the Serai FROST multisig implementation
+Dart bindings for the Serai FROST multisig implementation. Rust sources live in
+`src/serai`; native assets build and bundle them automatically.
-## Building
+Requires Dart 3.13+ (or a Flutter SDK containing it), Rust installed with rustup,
+and the platform's C build tools: Xcode for Apple, the Android NDK, a Linux C
+compiler, or Visual Studio's C++ build tools on Windows. Put `rustup` on PATH.
+The hook locates the pinned Rust 1.90.0 tools and installs the target as needed.
-```
-git clone https://www.github.com/cypherstack/frostdart
-cd frostdart
-git submodule update --init --recursive
-cd scripts/[platform]
-./build_all.sh
+```sh
+dart pub get --no-example
+dart test
```
-or `build_all.bat` for Windows.
+Consuming Flutter apps use normal `flutter run` / `flutter build` commands.
+The example requires iOS 15+ or macOS 13+ for Apple builds.
-Rust 1.71.0 or newer is required. `[rustup](https://rustup.rs/) toolchain install 1.71.0-x86_64-pc-windows-msvc` for Windows.
+Regenerate bindings with `dart run ffigen --config ffigen.yaml` (requires libclang).
diff --git a/android/.gitignore b/android/.gitignore
deleted file mode 100644
index 161bdcd..0000000
--- a/android/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-*.iml
-.gradle
-/local.properties
-/.idea/workspace.xml
-/.idea/libraries
-.DS_Store
-/build
-/captures
-.cxx
diff --git a/android/build.gradle b/android/build.gradle
deleted file mode 100644
index 6409a9e..0000000
--- a/android/build.gradle
+++ /dev/null
@@ -1,70 +0,0 @@
-// The Android Gradle Plugin builds the native code with the Android NDK.
-
-group 'com.example.frostdart'
-version '1.0'
-
-buildscript {
- ext.kotlin_version = "2.2.20"
- repositories {
- google()
- mavenCentral()
- }
-
- dependencies {
- classpath("com.android.tools.build:gradle:8.7.0")
- classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
- }
-}
-
-allprojects {
- repositories {
- google()
- mavenCentral()
- }
-}
-
-apply plugin: "com.android.library"
-apply plugin: "kotlin-android"
-
-android {
- if (project.android.hasProperty("namespace")) {
- namespace = "com.example.frostdart"
- }
-
- compileSdk = 34
-
- compileOptions {
- sourceCompatibility = JavaVersion.VERSION_17
- targetCompatibility = JavaVersion.VERSION_17
- }
-
- kotlinOptions {
- jvmTarget = JavaVersion.VERSION_17
- }
-
- sourceSets {
- main.java.srcDirs += "src/main/kotlin"
- test.java.srcDirs += "src/test/kotlin"
- }
-
- defaultConfig {
- minSdk = 21
- }
-
- dependencies {
- testImplementation("org.jetbrains.kotlin:kotlin-test")
- testImplementation("org.mockito:mockito-core:5.0.0")
- }
-
- testOptions {
- unitTests.all {
- useJUnitPlatform()
-
- testLogging {
- events "passed", "skipped", "failed", "standardOut", "standardError"
- outputs.upToDateWhen {false}
- showStandardStreams = true
- }
- }
- }
-}
\ No newline at end of file
diff --git a/android/settings.gradle b/android/settings.gradle
deleted file mode 100644
index e69ec59..0000000
--- a/android/settings.gradle
+++ /dev/null
@@ -1 +0,0 @@
-rootProject.name = 'frostdart'
diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml
deleted file mode 100644
index f5b72dd..0000000
--- a/android/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
diff --git a/android/src/main/kotlin/com/example/frostdart/FrostdartPlugin.kt b/android/src/main/kotlin/com/example/frostdart/FrostdartPlugin.kt
deleted file mode 100644
index cf19261..0000000
--- a/android/src/main/kotlin/com/example/frostdart/FrostdartPlugin.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.example.flutter_libepiccash
-
-import androidx.annotation.NonNull
-
-import io.flutter.embedding.engine.plugins.FlutterPlugin
-import io.flutter.plugin.common.MethodCall
-import io.flutter.plugin.common.MethodChannel
-import io.flutter.plugin.common.MethodChannel.MethodCallHandler
-import io.flutter.plugin.common.MethodChannel.Result
-
-/** FlutterLibepiccashPlugin */
-class FrostdartPlugin: FlutterPlugin, MethodCallHandler {
- /// The MethodChannel that will the communication between Flutter and native Android
- ///
- /// This local reference serves to register the plugin with the Flutter Engine and unregister it
- /// when the Flutter Engine is detached from the Activity
- private lateinit var channel : MethodChannel
-
- override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
- channel = MethodChannel(flutterPluginBinding.binaryMessenger, "frostdart")
- channel.setMethodCallHandler(this)
- }
-
- override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {
- if (call.method == "getPlatformVersion") {
- result.success("Android ${android.os.Build.VERSION.RELEASE}")
- } else {
- result.notImplemented()
- }
- }
-
- override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) {
- channel.setMethodCallHandler(null)
- }
-}
diff --git a/cargokit/.github/workflows/check_and_lint.yml b/cargokit/.github/workflows/check_and_lint.yml
deleted file mode 100644
index d8979f0..0000000
--- a/cargokit/.github/workflows/check_and_lint.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-on:
- pull_request:
- push:
- branches:
- - main
-
-name: Check and Lint
-
-jobs:
- Flutter:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # 4.1.0
- - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 # 2.16.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: flutter test
- working-directory: build_tool
diff --git a/cargokit/.github/workflows/test_example_plugin_build.yml b/cargokit/.github/workflows/test_example_plugin_build.yml
deleted file mode 100644
index 698ea7e..0000000
--- a/cargokit/.github/workflows/test_example_plugin_build.yml
+++ /dev/null
@@ -1,86 +0,0 @@
-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 "you@example.com"
- 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@44ac965b96f18d999802d4b807e3256d5a3f9fa1 # 2.16.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: |
- if [[ $(sysctl hw.optional.arm64) == *"hw.optional.arm64: 1"* ]]; then
- export JAVA_HOME=$JAVA_HOME_17_arm64
- else
- export JAVA_HOME=$JAVA_HOME_11_X64
- fi
- flutter build apk --${{ matrix.build_mode }} -v
-
diff --git a/cargokit/.gitignore b/cargokit/.gitignore
deleted file mode 100644
index cf7bb86..0000000
--- a/cargokit/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-target
-.dart_tool
-*.iml
-!pubspec.lock
diff --git a/cargokit/LICENSE b/cargokit/LICENSE
deleted file mode 100644
index 54a7d58..0000000
--- a/cargokit/LICENSE
+++ /dev/null
@@ -1,39 +0,0 @@
-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.
-
diff --git a/cargokit/README b/cargokit/README
deleted file mode 100644
index 8ae4a07..0000000
--- a/cargokit/README
+++ /dev/null
@@ -1,8 +0,0 @@
-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.
-
diff --git a/cargokit/build_pod.sh b/cargokit/build_pod.sh
deleted file mode 100755
index ed0e0d9..0000000
--- a/cargokit/build_pod.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/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
-
-sh "$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"
diff --git a/cargokit/build_tool/README.md b/cargokit/build_tool/README.md
deleted file mode 100644
index 3816eca..0000000
--- a/cargokit/build_tool/README.md
+++ /dev/null
@@ -1,2 +0,0 @@
-A sample command-line application with an entrypoint in `bin/`, library code
-in `lib/`, and example unit test in `test/`.
diff --git a/cargokit/build_tool/analysis_options.yaml b/cargokit/build_tool/analysis_options.yaml
deleted file mode 100644
index a1aad5b..0000000
--- a/cargokit/build_tool/analysis_options.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-# This file configures the static analysis results for your project (errors,
-# warnings, and lints).
-#
-# This enables the 'recommended' set of lints from `package:lints`.
-# This set helps identify many issues that may lead to problems when running
-# or consuming Dart code, and enforces writing Dart using a single, idiomatic
-# style and format.
-#
-# If you want a smaller set of lints you can change this to specify
-# 'package:lints/core.yaml'. These are just the most critical lints
-# (the recommended set includes the core lints).
-# The core lints are also what is used by pub.dev for scoring packages.
-
-include: package:lints/recommended.yaml
-
-# Uncomment the following section to specify additional rules.
-
-linter:
- rules:
- - prefer_relative_imports
- - directives_ordering
-
-# analyzer:
-# exclude:
-# - path/to/excluded/files/**
-
-# For more information about the core and recommended set of lints, see
-# https://dart.dev/go/core-lints
-
-# For additional information about configuring this file, see
-# https://dart.dev/guides/language/analysis-options
diff --git a/cargokit/build_tool/bin/build_tool.dart b/cargokit/build_tool/bin/build_tool.dart
deleted file mode 100644
index f27ec75..0000000
--- a/cargokit/build_tool/bin/build_tool.dart
+++ /dev/null
@@ -1,5 +0,0 @@
-import 'package:build_tool/build_tool.dart' as build_tool;
-
-void main(List arguments) {
- build_tool.runMain(arguments);
-}
diff --git a/cargokit/build_tool/lib/build_tool.dart b/cargokit/build_tool/lib/build_tool.dart
deleted file mode 100644
index b329c01..0000000
--- a/cargokit/build_tool/lib/build_tool.dart
+++ /dev/null
@@ -1,5 +0,0 @@
-import 'src/build_tool.dart' as build_tool;
-
-Future runMain(List args) async {
- return build_tool.runMain(args);
-}
diff --git a/cargokit/build_tool/lib/src/android_environment.dart b/cargokit/build_tool/lib/src/android_environment.dart
deleted file mode 100644
index 9342964..0000000
--- a/cargokit/build_tool/lib/src/android_environment.dart
+++ /dev/null
@@ -1,192 +0,0 @@
-import 'dart:io';
-import 'dart:isolate';
-import 'dart:math' as math;
-
-import 'package:collection/collection.dart';
-import 'package:path/path.dart' as path;
-import 'package:version/version.dart';
-
-import 'target.dart';
-import 'util.dart';
-
-class AndroidEnvironment {
- AndroidEnvironment({
- required this.sdkPath,
- required this.ndkVersion,
- required this.minSdkVersion,
- required this.targetTempDir,
- required this.target,
- });
-
- static void clangLinkerWrapper(List args) {
- final clang = Platform.environment['_CARGOKIT_NDK_LINK_CLANG'];
- if (clang == null) {
- throw Exception(
- "cargo-ndk rustc linker: didn't find _CARGOKIT_NDK_LINK_CLANG env var");
- }
- final target = Platform.environment['_CARGOKIT_NDK_LINK_TARGET'];
- if (target == null) {
- throw Exception(
- "cargo-ndk rustc linker: didn't find _CARGOKIT_NDK_LINK_TARGET env var");
- }
-
- runCommand(clang, [
- target,
- ...args,
- ]);
- }
-
- /// Full path to Android SDK.
- final String sdkPath;
-
- /// Full version of Android NDK.
- final String ndkVersion;
-
- /// Minimum supported SDK version.
- final int minSdkVersion;
-
- /// Target directory for build artifacts.
- final String targetTempDir;
-
- /// Target being built.
- final Target target;
-
- bool ndkIsInstalled() {
- final ndkPath = path.join(sdkPath, 'ndk', ndkVersion);
- final ndkPackageXml = File(path.join(ndkPath, 'package.xml'));
- return ndkPackageXml.existsSync();
- }
-
- void installNdk({
- required String javaHome,
- }) {
- final sdkManagerExtension = Platform.isWindows ? '.bat' : '';
- final sdkManager = path.join(
- sdkPath,
- 'cmdline-tools',
- 'latest',
- 'bin',
- 'sdkmanager$sdkManagerExtension',
- );
-
- log.info('Installing NDK $ndkVersion');
- runCommand(sdkManager, [
- '--install',
- 'ndk;$ndkVersion',
- ], environment: {
- 'JAVA_HOME': javaHome,
- });
- }
-
- Future