Skip to content

Commit 692b7ce

Browse files
committed
chore: reorganize project structure for clarity and scalability
- Moved iOS and Android application projects from 'crates/' to 'apps/'. - Moved Telegram, Discord, and WhatsApp bridge projects from 'crates/' to 'bridges/'. - Renamed 'crates/mobile' to 'crates/mobile-ffi' to clarify its role as a library interface. - Removed legacy 'mobile/' root directory. - Updated root 'Cargo.toml' workspace members and all internal package relative paths. - Updated mobile build scripts with robust relative path resolution. - Verified workspace integrity with 'cargo check'.
1 parent 878d1af commit 692b7ce

29 files changed

Lines changed: 24 additions & 142 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ members = [
44
"crates/cli",
55
"crates/server",
66
"crates/sandbox",
7-
"crates/mobile",
8-
"crates/gen", "crates/bridge", "crates/bridge-telegram", "crates/bridge-discord", "crates/bridge-whatsapp",
7+
"crates/mobile-ffi",
8+
"crates/gen",
9+
"crates/bridge",
10+
"bridges/telegram",
11+
"bridges/discord",
12+
"bridges/whatsapp",
913
]
1014
default-members = ["crates/cli"]
1115
resolver = "3"

crates/mobile/android/LocalGPTApp/src/main/java/com/localgpt/app/ChatViewModel.kt renamed to apps/android/LocalGPTApp/src/main/java/com/localgpt/app/ChatViewModel.kt

File renamed without changes.

crates/mobile/android/LocalGPTApp/src/main/java/com/localgpt/app/LocalGPTApplication.kt renamed to apps/android/LocalGPTApp/src/main/java/com/localgpt/app/LocalGPTApplication.kt

File renamed without changes.

crates/mobile/android/LocalGPTApp/src/main/java/com/localgpt/app/MainActivity.kt renamed to apps/android/LocalGPTApp/src/main/java/com/localgpt/app/MainActivity.kt

File renamed without changes.
File renamed without changes.

crates/mobile/android/scripts/build_android.sh renamed to apps/android/scripts/build_android.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ set -e
33

44
# Get the directory where the script is located
55
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
6-
ROOT_DIR="$SCRIPT_DIR/../../../../"
6+
# Root of the repo (one level deeper now)
7+
ROOT_DIR="$SCRIPT_DIR/../../../"
78

89
# Configuration
910
CRATE_NAME="localgpt_mobile"
@@ -16,10 +17,10 @@ ARM64_TARGET="aarch64-linux-android"
1617
X86_64_TARGET="x86_64-linux-android"
1718

1819
echo "Building for Android ARM64 ($ARM64_TARGET)..."
19-
cargo ndk -t arm64-v8a build -p localgpt-mobile $RELEASE_MODE
20+
cargo ndk -t arm64-v8a build -p localgpt-mobile-ffi $RELEASE_MODE
2021

2122
echo "Building for Android x86_64 ($X86_64_TARGET)..."
22-
cargo ndk -t x86_64 build -p localgpt-mobile $RELEASE_MODE
23+
cargo ndk -t x86_64 build -p localgpt-mobile-ffi $RELEASE_MODE
2324

2425
# Output directories
2526
mkdir -p "$ANDROID_LIB_DIR/src/main/jniLibs/arm64-v8a"
@@ -32,11 +33,9 @@ cp "$TARGET_DIR/$X86_64_TARGET/release/lib$CRATE_NAME.so" "$ANDROID_LIB_DIR/src/
3233

3334
# Generate Kotlin Bindings
3435
echo "Generating UniFFI Bindings for Kotlin..."
35-
# Use the compiled Android library to generate bindings
36-
# Note: UniFFI needs a library path to find the metadata
3736
LIBRARY_PATH="$TARGET_DIR/$ARM64_TARGET/release/lib$CRATE_NAME.so"
3837

39-
cargo run --bin uniffi-bindgen -p localgpt-mobile -- generate \
38+
cargo run --bin uniffi-bindgen -p localgpt-mobile-ffi -- generate \
4039
--library "$LIBRARY_PATH" \
4140
--language kotlin \
4241
--out-dir "$ANDROID_LIB_DIR/src/main/java"
File renamed without changes.

0 commit comments

Comments
 (0)