Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_foundation","path":"/home/icota/.pub-cache/hosted/pub.dev/path_provider_foundation-2.5.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"rust_lib_tor","path":"/home/icota/Code/tor/rust_builder/","native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"path_provider_android","path":"/home/icota/.pub-cache/hosted/pub.dev/path_provider_android-2.2.22/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"rust_lib_tor","path":"/home/icota/Code/tor/rust_builder/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[{"name":"path_provider_foundation","path":"/home/icota/.pub-cache/hosted/pub.dev/path_provider_foundation-2.5.1/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false},{"name":"rust_lib_tor","path":"/home/icota/Code/tor/rust_builder/","native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[{"name":"path_provider_linux","path":"/home/icota/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"rust_lib_tor","path":"/home/icota/Code/tor/rust_builder/","native_build":true,"dependencies":[],"dev_dependency":false}],"windows":[{"name":"path_provider_windows","path":"/home/icota/.pub-cache/hosted/pub.dev/path_provider_windows-2.3.0/","native_build":false,"dependencies":[],"dev_dependency":false},{"name":"rust_lib_tor","path":"/home/icota/Code/tor/rust_builder/","native_build":true,"dependencies":[],"dev_dependency":false}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"rust_lib_tor","dependencies":[]}],"date_created":"2026-02-19 09:24:05.451601","version":"3.35.7","swift_package_manager_enabled":{"ios":false,"macos":false}}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@ migrate_working_dir/
build/

rust/target/.rustc_info.json
rust/target/debug
rust/target/debug

# direnv
.direnv/
16 changes: 16 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ Files: lib/generated*
Copyright: 2024 Foundation Devices Inc.
License: MIT

Files: lib/src/rust/*
Copyright: 2024 Foundation Devices Inc.
License: MIT

Files: rust/src/frb_generated.rs
Copyright: 2024 Foundation Devices Inc.
License: MIT

Files: .flutter-plugins-dependencies
Copyright: 2024 Foundation Devices Inc.
License: MIT

Files: example/linux/flutter/generated*
Copyright: 2024 Foundation Devices Inc.
License: MIT
Expand Down Expand Up @@ -38,3 +50,7 @@ License: MIT
Files: flake.lock
Copyright: 2024 Foundation Devices Inc.
License: MIT

Files: android/.gradle/*
Copyright: 2024 Foundation Devices Inc.
License: MIT
3 changes: 2 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ include: package:flutter_lints/flutter.yaml
analyzer:
exclude:
- 'lib/generated*'
- 'cargokit'
- 'lib/src/rust/**'
- 'cargokit/**'
2 changes: 1 addition & 1 deletion android/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2024 Foundation Devices Inc.
# SPDX-FileCopyrightText: 2024 Foundation Devices Inc
#
# SPDX-License-Identifier: MIT

Expand Down
22 changes: 14 additions & 8 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// The Android Gradle Plugin builds the native code with the Android NDK.

group 'com.foundationdevices.tor'
group 'com.flutter_rust_bridge.rust_lib_tor'
version '1.0'

buildscript {
Expand All @@ -15,7 +15,7 @@ buildscript {

dependencies {
// The Android Gradle Plugin knows how to build native code with the NDK.
classpath 'com.android.tools.build:gradle:8.12.1'
classpath 'com.android.tools.build:gradle:7.3.0'
}
}

Expand All @@ -30,25 +30,31 @@ apply plugin: 'com.android.library'

android {
if (project.android.hasProperty("namespace")) {
namespace 'com.foundationdevices.tor'
namespace 'com.flutter_rust_bridge.rust_lib_tor'
}

// Bumping the plugin compileSdkVersion requires all clients of this plugin
// to bump the version in their app.
compileSdkVersion 36
compileSdkVersion 33

// Use the NDK version
// declared in /android/app/build.gradle file of the Flutter project.
// Replace it with a version number if this plugin requires a specfic NDK version.
// (e.g. ndkVersion "23.1.7779620")
ndkVersion android.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
minSdkVersion 16
minSdkVersion 19
}
}

apply from: "../cargokit/gradle/plugin.gradle"

cargokit {
manifestDir = "../rust"
libname = "tor"
}
libname = "rust_lib_tor"
}
4 changes: 2 additions & 2 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-FileCopyrightText: 2024 Foundation Devices Inc.
// SPDX-FileCopyrightText: 2024 Foundation Devices Inc
//
// SPDX-License-Identifier: MIT

rootProject.name = 'tor'
rootProject.name = 'rust_lib_backup'
4 changes: 2 additions & 2 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!--
SPDX-FileCopyrightText: 2024 Foundation Devices Inc.
SPDX-FileCopyrightText: 2024 Foundation Devices Inc

SPDX-License-Identifier: MIT
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.foundationdevices.tor">
package="com.flutter_rust_bridge.rust_lib_backup">
</manifest>
30 changes: 0 additions & 30 deletions cargokit/.github/workflows/check_and_lint.yml

This file was deleted.

86 changes: 0 additions & 86 deletions cargokit/.github/workflows/test_example_plugin_build.yml

This file was deleted.

4 changes: 0 additions & 4 deletions cargokit/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# SPDX-FileCopyrightText: 2024 Foundation Devices Inc.
#
# SPDX-License-Identifier: MIT

target
.dart_tool
*.iml
Expand Down
3 changes: 3 additions & 0 deletions cargokit/LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/// This is copied from Cargokit (which is the official way to use it currently)
/// Details: https://fzyzcjy.github.io/flutter_rust_bridge/manual/integrate/builtin

Copyright 2022 Matej Knopp

================================================================================
Expand Down
3 changes: 3 additions & 0 deletions cargokit/README
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/// This is copied from Cargokit (which is the official way to use it currently)
/// Details: https://fzyzcjy.github.io/flutter_rust_bridge/manual/integrate/builtin

Experimental repository to provide glue for seamlessly integrating cargo build
with flutter plugins and packages.

Expand Down
3 changes: 0 additions & 3 deletions cargokit/README.license

This file was deleted.

11 changes: 3 additions & 8 deletions cargokit/build_pod.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#!/bin/sh

# SPDX-FileCopyrightText: 2024 Foundation Devices Inc.
#
# SPDX-License-Identifier: MIT

set -e

BASEDIR=$(dirname "$0")
Expand Down Expand Up @@ -54,10 +49,10 @@ do
fi
done

"$BASEDIR/run_build_tool.sh" build-pod "$@"
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"
ln -fs "$OBJROOT/XCBuildData/build.db" "${BUILT_PRODUCTS_DIR}/cargokit_phony"
ln -fs "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" "${BUILT_PRODUCTS_DIR}/cargokit_phony_out"
7 changes: 2 additions & 5 deletions cargokit/build_tool/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<!--
SPDX-FileCopyrightText: 2024 Foundation Devices Inc.

SPDX-License-Identifier: MIT
-->
/// This is copied from Cargokit (which is the official way to use it currently)
/// Details: https://fzyzcjy.github.io/flutter_rust_bridge/manual/integrate/builtin

A sample command-line application with an entrypoint in `bin/`, library code
in `lib/`, and example unit test in `test/`.
5 changes: 2 additions & 3 deletions cargokit/build_tool/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# SPDX-FileCopyrightText: 2024 Foundation Devices Inc.
#
# SPDX-License-Identifier: MIT
# This is copied from Cargokit (which is the official way to use it currently)
# Details: https://fzyzcjy.github.io/flutter_rust_bridge/manual/integrate/builtin

# This file configures the static analysis results for your project (errors,
# warnings, and lints).
Expand Down
5 changes: 2 additions & 3 deletions cargokit/build_tool/bin/build_tool.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-FileCopyrightText: 2024 Foundation Devices Inc.
//
// SPDX-License-Identifier: MIT
/// This is copied from Cargokit (which is the official way to use it currently)
/// Details: https://fzyzcjy.github.io/flutter_rust_bridge/manual/integrate/builtin

import 'package:build_tool/build_tool.dart' as build_tool;

Expand Down
5 changes: 2 additions & 3 deletions cargokit/build_tool/lib/build_tool.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-FileCopyrightText: 2024 Foundation Devices Inc.
//
// SPDX-License-Identifier: MIT
/// This is copied from Cargokit (which is the official way to use it currently)
/// Details: https://fzyzcjy.github.io/flutter_rust_bridge/manual/integrate/builtin

import 'src/build_tool.dart' as build_tool;

Expand Down
21 changes: 5 additions & 16 deletions cargokit/build_tool/lib/src/android_environment.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-FileCopyrightText: 2024 Foundation Devices Inc.
//
// SPDX-License-Identifier: MIT
/// This is copied from Cargokit (which is the official way to use it currently)
/// Details: https://fzyzcjy.github.io/flutter_rust_bridge/manual/integrate/builtin

import 'dart:io';
import 'dart:isolate';
Expand Down Expand Up @@ -119,7 +118,7 @@ class AndroidEnvironment {

final cxxKey = 'CXX_${target.rust}';
final cxxValue = path.join(toolchainPath, 'clang++$exe');
final cxxfFlagsKey = 'CXXFLAGS_${target.rust}';
final cxxFlagsKey = 'CXXFLAGS_${target.rust}';
final cxxFlagsValue = targetArg;

final linkerKey =
Expand Down Expand Up @@ -156,7 +155,7 @@ class AndroidEnvironment {
ccKey: ccValue,
cfFlagsKey: cFlagsValue,
cxxKey: cxxValue,
cxxfFlagsKey: cxxFlagsValue,
cxxFlagsKey: cxxFlagsValue,
ranlibKey: ranlibValue,
rustFlagsKey: rustFlagsValue,
linkerKey: selfPath,
Expand Down Expand Up @@ -190,17 +189,7 @@ class AndroidEnvironment {
if (rustFlags.isNotEmpty) {
rustFlags = '$rustFlags\x1f';
}
rustFlags = '$rustFlags-L\x1f$workaroundDir\x1f';

const pageSizeArgs = [
"-C",
"link-arg=-Wl,--hash-style=both",
"-C",
"link-arg=-Wl,-z,max-page-size=16384"
];
final pageSizeArgsString = pageSizeArgs.join("\x1f");

rustFlags = '$rustFlags$pageSizeArgsString';
rustFlags = '$rustFlags-L\x1f$workaroundDir';
return rustFlags;
}
}
Loading
Loading