Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.16.3'
flutter-version: '3.35.1'

- name: Install dependencies
run: flutter pub get
Expand Down
4 changes: 4 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ Files: example/windows/flutter/generated*
Copyright: 2024 Foundation Devices Inc.
License: MIT

Files: example/android/*
Copyright: 2024 Foundation Devices Inc.
License: MIT

Files: rust/target/*
Copyright: 2024 Foundation Devices Inc.
License: MIT
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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:7.3.0'
classpath 'com.android.tools.build:gradle:8.12.1'
}
}

Expand All @@ -34,7 +34,7 @@ android {
}
// Bumping the plugin compileSdkVersion requires all clients of this plugin
// to bump the version in their app.
compileSdkVersion 33
compileSdkVersion 36

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down
12 changes: 11 additions & 1 deletion cargokit/build_tool/lib/src/android_environment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,17 @@ class AndroidEnvironment {
if (rustFlags.isNotEmpty) {
rustFlags = '$rustFlags\x1f';
}
rustFlags = '$rustFlags-L\x1f$workaroundDir';
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';
return rustFlags;
}
}
14 changes: 5 additions & 9 deletions cargokit/gradle/plugin.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// SPDX-FileCopyrightText: 2024 Foundation Devices Inc.
//
// SPDX-License-Identifier: MIT

import java.nio.file.Paths
import org.apache.tools.ant.taskdefs.condition.Os

Expand Down Expand Up @@ -87,10 +83,10 @@ class CargoKitPlugin implements Plugin<Project> {
_findFlutterPlugin(rootProject.childProjects)
}

private Plugin _findFlutterPlugin(Map projects) {
private Plugin _findFlutterPlugin(Map projects) {
for (project in projects) {
for (plugin in project.value.getPlugins()) {
if (plugin.class.name == "FlutterPlugin") {
if (plugin.class.name == "com.flutter.gradle.FlutterPlugin") {
return plugin;
}
}
Expand Down Expand Up @@ -123,7 +119,7 @@ class CargoKitPlugin implements Plugin<Project> {
def jniLibs = project.android.sourceSets.maybeCreate(buildType).jniLibs;
jniLibs.srcDir(new File(cargoOutputDir))

def platforms = plugin.getTargetPlatforms().collect()
def platforms = com.flutter.gradle.FlutterPluginUtils.getTargetPlatforms(project).collect()

// Same thing addFlutterDependencies does in flutter.gradle
if (buildType == "debug") {
Expand All @@ -145,7 +141,7 @@ class CargoKitPlugin implements Plugin<Project> {
}

def task = project.tasks.create(taskName, CargoKitBuildTask.class) {
buildMode = variant.name
buildMode = variant.buildType.name
buildDir = cargoBuildDir
outputDir = cargoOutputDir
ndkVersion = plugin.project.android.ndkVersion
Expand All @@ -167,4 +163,4 @@ class CargoKitPlugin implements Plugin<Project> {
}
}
}
}
}
2 changes: 2 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/

# IntelliJ related
Expand Down
15 changes: 5 additions & 10 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
// SPDX-FileCopyrightText: 2024 Foundation Devices Inc.
//
// SPDX-License-Identifier: MIT

plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand All @@ -10,10 +14,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
Expand All @@ -25,10 +25,6 @@ if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
namespace "com.foundationdevices.tor_example"
compileSdkVersion flutter.compileSdkVersion
Expand Down Expand Up @@ -72,5 +68,4 @@ flutter {
}

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

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

19 changes: 1 addition & 18 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
// SPDX-FileCopyrightText: 2024 Foundation Devices Inc.
//
// SPDX-License-Identifier: MIT

buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
Expand All @@ -32,4 +15,4 @@ subprojects {

tasks.register("clean", Delete) {
delete rootProject.buildDir
}
}
7 changes: 3 additions & 4 deletions example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# SPDX-FileCopyrightText: 2024 Foundation Devices Inc.
#
#SPDX-FileCopyrightText: 2024 Foundation Devices Inc.
# SPDX-License-Identifier: MIT

#Tue Aug 19 17:05:17 CEST 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0-milestone-1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
30 changes: 22 additions & 8 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,28 @@
//
// SPDX-License-Identifier: MIT

include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version '8.12.1' apply false
id "org.jetbrains.kotlin.android" version "2.2.10" apply false
}

include ":app"
6 changes: 3 additions & 3 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/tor/ios"

SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
tor: 662a9f5b980b5c86decb8ba611de9bcd4c8286eb

PODFILE CHECKSUM: 70d9d25280d0dd177a5f637cdb0f0b0b12c6a189

COCOAPODS: 1.12.1
COCOAPODS: 1.16.2
Loading
Loading