Skip to content
Open
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
43 changes: 0 additions & 43 deletions .github/workflows/build-all-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ on:
required: false
default: true
type: boolean
build_intellij_plugin:
description: 'IntelliJ Plugin'
required: false
default: true
type: boolean

permissions:
contents: read
Expand Down Expand Up @@ -469,42 +464,6 @@ jobs:
./gradlew assembleDebug -Prunanywhere.testLocal=false
continue-on-error: true

# ===========================================================================
# IntelliJ Plugin
# ===========================================================================
intellij-plugin:
name: IntelliJ Plugin
if: ${{ inputs.build_intellij_plugin }}
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'

- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Setup local.properties
run: echo "sdk.dir=${ANDROID_SDK_ROOT}" > sdk/runanywhere-kotlin/local.properties

- name: Publish SDK to Maven Local
working-directory: sdk/runanywhere-kotlin
run: |
chmod +x gradlew
./gradlew publishToMavenLocal -Prunanywhere.testLocal=false

- name: Build IntelliJ Plugin
working-directory: examples/intellij-plugin-demo/plugin
run: |
chmod +x gradlew
./gradlew buildPlugin

# ===========================================================================
# Build Summary
# ===========================================================================
Expand All @@ -519,7 +478,6 @@ jobs:
- flutter-sdk
- react-native-sdk
- android-apps
- intellij-plugin
if: always()
runs-on: ubuntu-latest

Expand Down Expand Up @@ -550,7 +508,6 @@ jobs:
echo "| Flutter SDK (Dart) | $(status '${{ needs.flutter-sdk.result }}') |" >> $GITHUB_STEP_SUMMARY
echo "| React Native SDK | $(status '${{ needs.react-native-sdk.result }}') |" >> $GITHUB_STEP_SUMMARY
echo "| Android Example Apps | $(status '${{ needs.android-apps.result }}') |" >> $GITHUB_STEP_SUMMARY
echo "| IntelliJ Plugin | $(status '${{ needs.intellij-plugin.result }}') |" >> $GITHUB_STEP_SUMMARY

echo "" >> $GITHUB_STEP_SUMMARY
echo "---" >> $GITHUB_STEP_SUMMARY
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/commons-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,10 @@ jobs:
ls -la third_party/sherpa-onnx-android/jniLibs/ || echo "jniLibs not found!"
ls -la "third_party/sherpa-onnx-android/jniLibs/${{ matrix.abi }}/" || echo "ABI directory not found!"

# Check for required .so files
for lib in libsherpa-onnx-jni.so libsherpa-onnx-c-api.so libonnxruntime.so; do
# Check for required .so files. libsherpa-onnx-jni.so and
# libsherpa-onnx-cxx-api.so are intentionally stripped by
# download-sherpa-onnx.sh (we use our own JNI + the C API only).
for lib in libsherpa-onnx-c-api.so libonnxruntime.so; do
if [ -f "third_party/sherpa-onnx-android/jniLibs/${{ matrix.abi }}/$lib" ]; then
echo "✅ Found: $lib"
else
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ gradle.properties
!gradle.properties.example

# Also ignore .idea folders in subdirectories
examples/intellij-plugin-demo/plugin/.idea/
sdk/runanywhere-kotlin/.idea/

# Other IDE files
Expand Down
24 changes: 0 additions & 24 deletions .idea/runConfigurations/09_Build_IntelliJ_Plugin.xml

This file was deleted.

24 changes: 0 additions & 24 deletions .idea/runConfigurations/10_Run_IntelliJ_Plugin.xml

This file was deleted.

3 changes: 1 addition & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ This repository contains cross-platform SDKs for the RunAnywhere on-device AI pl
- **Android Demo** (`examples/android/RunAnywhereAI/`) - Sample Android app demonstrating SDK usage
- **iOS Demo** (`examples/ios/RunAnywhereAI/`) - Sample iOS app demonstrating SDK usage
- **Web Demo** (`examples/web/RunAnywhereAI/`) - Sample web app demonstrating SDK usage
- **IntelliJ Plugin Demo** (`examples/intellij-plugin-demo/`) - IntelliJ/Android Studio plugin for voice features

## Common Development Commands

Expand Down Expand Up @@ -225,7 +224,7 @@ cd sdk/runanywhere-web/
./scripts/build-web.sh

# Build WASM with specific backends
./scripts/build-web.sh --build-wasm --llamacpp --onnx
./scripts/build-web.sh --build-wasm --llamacpp
./scripts/build-web.sh --build-wasm --all-backends
./scripts/build-web.sh --build-wasm --llamacpp --vlm --webgpu

Expand Down
56 changes: 50 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,27 @@ import Foundation
//
// =============================================================================

// =============================================================================
// ONNX RUNTIME COEXISTENCE
// =============================================================================
// RABackendONNX.xcframework + onnxruntime-{ios,macos}.xcframework must ship
// TOGETHER because:
//
// 1. RABackendONNX statically embeds sherpa-onnx's C API symbols
// (STT/Zipformer/Whisper decoders, Piper TTS phonemizer, Silero VAD).
// 2. Sherpa-onnx.xcframework leaves ONNX Runtime symbols UNDEFINED —
// they're resolved at final app-link time against the separate
// onnxruntime-{ios,macos}.xcframework.
// 3. Our own rac_backend_onnx code ALSO calls raw Ort::* directly for
// wake-word detection (openWakeWord) and RAG embeddings (BERT), so
// we'd need the ORT xcframework even if sherpa disappeared.
//
// The ORT version (sdk/runanywhere-commons/VERSIONS → ONNX_VERSION_*) is
// pinned to whatever sherpa-onnx was built against. LoadVersions.cmake
// hard-errors if the per-platform pins drift apart. Do not bump the
// onnxruntime-{ios,macos}-v<X>.zip artifacts independently of
// SHERPA_ONNX_VERSION_*.
//
// Combined ONNX Runtime xcframework (local dev) is created by:
// cd sdk/runanywhere-swift && ./scripts/create-onnxruntime-xcframework.sh

Expand All @@ -37,7 +58,7 @@ import Foundation
// ./scripts/build-swift.sh --set-remote (sets useLocalBinaries = false)
//
// =============================================================================
let useLocalBinaries = false // Toggle: true for local dev, false for release
let useLocalBinaries = true // Toggle: true for local dev, false for release

// Version for remote XCFrameworks (used when testLocal = false)
// Updated automatically by CI/CD during releases
Expand All @@ -50,7 +71,21 @@ let sdkVersion = "0.19.7"
// for external consumers due to a placeholder checksum.
let metalrtRemoteBinaryAvailable = false

let includeMetalRT = useLocalBinaries || metalrtRemoteBinaryAvailable
// In local-mode we additionally probe the filesystem. MetalRT is an optional
// backend and many local dev flows skip it (build-ios.sh --backend onnx, etc.)
// without producing the xcframework. Without this existence check, SPM
// resolution would fatal-error on "local binary target ... does not contain a
// binary artifact" — breaking the package graph whenever a dev builds fewer
// backends than the full set.
let metalrtLocalBinaryExists: Bool = {
let packageDir = URL(fileURLWithPath: #filePath).deletingLastPathComponent()
let frameworkPath = packageDir.appendingPathComponent(
"sdk/runanywhere-swift/Binaries/RABackendMetalRT.xcframework"
).path
return FileManager.default.fileExists(atPath: frameworkPath)
}()

let includeMetalRT = (useLocalBinaries && metalrtLocalBinaryExists) || metalrtRemoteBinaryAvailable

let package = Package(
name: "runanywhere-sdks",
Expand Down Expand Up @@ -314,12 +349,21 @@ func binaryTargets() -> [Target] {
name: "RABackendONNXBinary",
path: "sdk/runanywhere-swift/Binaries/RABackendONNX.xcframework"
),
.binaryTarget(
name: "RABackendMetalRTBinary",
path: "sdk/runanywhere-swift/Binaries/RABackendMetalRT.xcframework"
),
]

// MetalRT is optional. Only declare its binary target when the
// xcframework is actually present locally — otherwise SPM resolution
// fatal-errors with "does not contain a binary artifact" on any dev
// flow that skipped metalrt (e.g. build-ios.sh --backend onnx).
if metalrtLocalBinaryExists {
targets.append(
.binaryTarget(
name: "RABackendMetalRTBinary",
path: "sdk/runanywhere-swift/Binaries/RABackendMetalRT.xcframework"
)
)
}

// ONNX Runtime xcframeworks - split by platform
// iOS: static library format (not embedded in app bundle)
// macOS: dynamic framework format (embedded in app bundle)
Expand Down
50 changes: 1 addition & 49 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
// ./gradlew buildAndroidApp - Build Android example app
// ./gradlew runAndroidApp - Build, install, and launch Android app
//
// IntelliJ Plugin:
// ./gradlew buildIntellijPlugin - Build IntelliJ plugin
// ./gradlew runIntellijPlugin - Run IntelliJ plugin in sandbox
//
// Utility:
// ./gradlew buildAll - Build everything
// ./gradlew cleanAll - Clean everything
Expand Down Expand Up @@ -262,41 +258,6 @@ tasks.register("runAndroidApp") {
}
}

// IntelliJ plugin tasks (SDK consumed via Maven Local)

tasks.register("buildIntellijPlugin") {
group = "intellij"
description = "Publish SDK + build IntelliJ plugin"

doLast {
exec {
workingDir = projectDir
commandLine("./gradlew", ":runanywhere-kotlin:publishToMavenLocal")
}
exec {
workingDir = file("examples/intellij-plugin-demo/plugin")
commandLine("./gradlew", "buildPlugin")
}
println("IntelliJ plugin built: examples/intellij-plugin-demo/plugin/build/distributions/")
}
}

tasks.register("runIntellijPlugin") {
group = "intellij"
description = "Publish SDK + run IntelliJ plugin in sandbox"

doLast {
exec {
workingDir = projectDir
commandLine("./gradlew", ":runanywhere-kotlin:publishToMavenLocal")
}
exec {
workingDir = file("examples/intellij-plugin-demo/plugin")
commandLine("./gradlew", "runIde")
}
}
}

// Convenience tasks

tasks.register("buildAll") {
Expand All @@ -317,22 +278,17 @@ tasks.register("buildAll") {
commandLine("./gradlew", "assembleDebug")
}

// Publish SDK to Maven Local + build IntelliJ plugin
// Publish SDK to Maven Local (for downstream consumers)
exec {
workingDir = projectDir
commandLine("./gradlew", ":runanywhere-kotlin:publishToMavenLocal")
}
exec {
workingDir = file("examples/intellij-plugin-demo/plugin")
commandLine("./gradlew", "buildPlugin")
}

println()
println("Build complete:")
println(" SDK AAR: sdk/runanywhere-kotlin/build/outputs/aar/")
println(" Maven Local: ~/.m2/repository/com/runanywhere/runanywhere-sdk/")
println(" Android APK: examples/android/RunAnywhereAI/app/build/outputs/apk/")
println(" IntelliJ Plugin: examples/intellij-plugin-demo/plugin/build/distributions/")
}
}

Expand All @@ -348,10 +304,6 @@ tasks.register("cleanAll") {
workingDir = file("examples/android/RunAnywhereAI")
commandLine("./gradlew", "clean")
}
exec {
workingDir = file("examples/intellij-plugin-demo/plugin")
commandLine("./gradlew", "clean")
}
println("All projects cleaned")
}
}
8 changes: 0 additions & 8 deletions docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ RunAnywhere (root)
./gradlew runAndroidApp # Build, install, and launch on device
```

### IntelliJ Plugin

```bash
./gradlew buildIntellijPlugin # Publish SDK + build plugin
./gradlew runIntellijPlugin # Publish SDK + run plugin in sandbox
```

### Everything

```bash
Expand Down Expand Up @@ -114,7 +107,6 @@ To rebuild after C++ changes:
| SDK AAR | `sdk/runanywhere-kotlin/build/outputs/aar/` |
| SDK JVM JAR | `sdk/runanywhere-kotlin/build/libs/` |
| Android APK | `examples/android/RunAnywhereAI/app/build/outputs/apk/` |
| IntelliJ Plugin | `examples/intellij-plugin-demo/plugin/build/distributions/` |
| Maven Local | `~/.m2/repository/com/runanywhere/runanywhere-sdk/` |

## Troubleshooting
Expand Down
Loading
Loading