mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-02-01 18:02:31 -05:00
Update build scripts (#1404)
This commit is contained in:
17
.github/actions/build-android-app/action.yml
vendored
17
.github/actions/build-android-app/action.yml
vendored
@@ -67,6 +67,23 @@ runs:
|
||||
ls -lh "$JNILIBS_DIR/$abi/libaliasvault_core.so" | awk '{print " " $NF ": " $5}'
|
||||
done
|
||||
|
||||
# Verify Kotlin bindings (UniFFI-generated)
|
||||
KOTLIN_BINDINGS_DIR="apps/mobile-app/android/app/src/main/java/net/aliasvault/app/rustcore/uniffi/aliasvault_core"
|
||||
if [ ! -d "$KOTLIN_BINDINGS_DIR" ]; then
|
||||
echo "❌ Missing Kotlin bindings directory: $KOTLIN_BINDINGS_DIR"
|
||||
echo "Run: cd core/rust && ./build.sh --android"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "$KOTLIN_BINDINGS_DIR/aliasvault_core.kt" ]; then
|
||||
echo "❌ Missing Kotlin bindings file: $KOTLIN_BINDINGS_DIR/aliasvault_core.kt"
|
||||
echo "Run: cd core/rust && ./build.sh --android"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Kotlin bindings verified:"
|
||||
ls -lh "$KOTLIN_BINDINGS_DIR"/*.kt | awk '{print " " $NF ": " $5}'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
shell: bash
|
||||
|
||||
@@ -34,7 +34,6 @@ if command -v rustc &> /dev/null; then
|
||||
echo "📦 Building rust core (Rust toolchain detected)..."
|
||||
./build.sh --android
|
||||
./build.sh --browser
|
||||
./build.sh --mobile
|
||||
# Do not build for iOS here as it will be built via Xcode build phases instead
|
||||
# Adding it here would make the GitHub Actions fail because of Linux runners
|
||||
else
|
||||
|
||||
@@ -79,11 +79,6 @@ while [[ $# -gt 0 ]]; do
|
||||
BUILD_ANDROID=true
|
||||
shift
|
||||
;;
|
||||
--mobile)
|
||||
BUILD_IOS=true
|
||||
BUILD_ANDROID=true
|
||||
shift
|
||||
;;
|
||||
--all)
|
||||
BUILD_BROWSER=true
|
||||
BUILD_DOTNET=true
|
||||
@@ -112,8 +107,7 @@ while [[ $# -gt 0 ]]; do
|
||||
echo " --dotnet Build native library for .NET server-side use (macOS/Linux/Windows)"
|
||||
echo " --ios Build for iOS (device + simulator arm64) with Swift bindings"
|
||||
echo " --android Build for Android (arm64-v8a, armeabi-v7a, x86_64) with Kotlin bindings"
|
||||
echo " --mobile Build for both iOS and Android"
|
||||
echo " --all Build all targets"
|
||||
= echo " --all Build all targets"
|
||||
echo ""
|
||||
echo "Speed options:"
|
||||
echo " --fast, --dev Faster builds (for development)"
|
||||
@@ -141,7 +135,6 @@ if ! $BUILD_BROWSER && ! $BUILD_DOTNET && ! $BUILD_IOS && ! $BUILD_ANDROID; then
|
||||
echo " ./build.sh --dotnet # Build for .NET"
|
||||
echo " ./build.sh --ios # Build for iOS"
|
||||
echo " ./build.sh --android # Build for Android"
|
||||
echo " ./build.sh --mobile # Build for iOS and Android"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -667,11 +660,20 @@ distribute_android() {
|
||||
done
|
||||
|
||||
# Copy Kotlin bindings to app source
|
||||
# UniFFI generates bindings in uniffi/aliasvault_core/ directory structure
|
||||
local kotlin_dist="$SCRIPT_DIR/../../apps/mobile-app/android/app/src/main/java/net/aliasvault/app/rustcore"
|
||||
if [ -d "$ANDROID_DIR/kotlin" ] && [ -n "$(ls -A "$ANDROID_DIR/kotlin" 2>/dev/null)" ]; then
|
||||
if [ -d "$ANDROID_DIR/kotlin/uniffi" ]; then
|
||||
mkdir -p "$kotlin_dist"
|
||||
cp "$ANDROID_DIR/kotlin"/*.kt "$kotlin_dist/" 2>/dev/null || true
|
||||
echo -e " Copied Kotlin bindings to $kotlin_dist"
|
||||
# Copy the entire uniffi directory to preserve package structure
|
||||
cp -r "$ANDROID_DIR/kotlin/uniffi" "$kotlin_dist/"
|
||||
echo -e " Copied Kotlin bindings to $kotlin_dist/uniffi/"
|
||||
|
||||
# List what was copied
|
||||
if [ -d "$kotlin_dist/uniffi/aliasvault_core" ]; then
|
||||
ls -lh "$kotlin_dist/uniffi/aliasvault_core"/*.kt 2>/dev/null || true
|
||||
fi
|
||||
else
|
||||
echo -e "${RED}Warning: Kotlin bindings not found at $ANDROID_DIR/kotlin/uniffi${NC}"
|
||||
fi
|
||||
|
||||
echo -e "${GREEN}Distributed to: $ANDROID_APP_DIST${NC}"
|
||||
|
||||
Reference in New Issue
Block a user