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
12 changes: 6 additions & 6 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Setup Android SDK
uses: android-actions/setup-android@v3
with:
packages: 'platforms;android-34 build-tools;34.0.0'
packages: 'platforms;android-36 build-tools;36.0.0'

# sdkmanager has no bare "ndk" package — must install "ndk;X.Y.Z". Pick the
# newest side-by-side NDK from the package list.
Expand Down Expand Up @@ -79,13 +79,13 @@ jobs:
python -m tn --language zh --overwrite_cache --cache_dir "$assets"
python -m itn --language zh --overwrite_cache --cache_dir "$assets"

- name: Build APK
- name: Build release APK
working-directory: runtime/android
run: ./gradlew :app:assembleDebug -PabiFilters=arm64-v8a --no-daemon
run: ./gradlew :app:assembleRelease -PabiFilters=arm64-v8a --no-daemon

- name: Upload APK
- name: Upload release APK
uses: actions/upload-artifact@v4
with:
name: app-debug-arm64-v8a
path: runtime/android/app/build/outputs/apk/debug/app-debug.apk
name: app-release-arm64-v8a
path: runtime/android/app/build/outputs/apk/release/app-release.apk
if-no-files-found: error
2 changes: 1 addition & 1 deletion runtime/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"generator": "Ninja",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "$env{ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake",
"ANDROID_PLATFORM": "android-21",
"ANDROID_PLATFORM": "android-30",
"CMAKE_BUILD_TYPE": "Release"
}
},
Expand Down
1 change: 1 addition & 0 deletions runtime/android/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.iml
.gradle
.kotlin/
/local.properties
/.idea/caches
/.idea/libraries
Expand Down
68 changes: 0 additions & 68 deletions runtime/android/app/build.gradle

This file was deleted.

75 changes: 75 additions & 0 deletions runtime/android/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
plugins {
// AGP 9 has built-in Kotlin support (it bundles KGP and enables it by default),
// so the org.jetbrains.kotlin.android plugin must NOT be applied here.
alias(libs.plugins.android.application)
// Compose compiler plugin (required since Kotlin 2.0+).
alias(libs.plugins.compose.compiler)
}

fun nativeAbis(): List<String> =
(project.findProperty("abiFilters") as String? ?: "armeabi-v7a,arm64-v8a,x86,x86_64")
.split(",").map { it.trim() }.filter { it.isNotEmpty() }

android {
namespace = "com.wenet.WeTextProcessing"
lint {
abortOnError = false
}
signingConfigs {
create("release") {
storeFile = file("wenet.keystore")
storePassword = "123456"
keyAlias = "wenet"
keyPassword = "123456"
}
}
compileSdk = 36

defaultConfig {
applicationId = "com.wenet.WeTextProcessing"
minSdk = 30
targetSdk = 36
versionCode = 1
versionName = "1.0"

ndk {
abiFilters.addAll(nativeAbis())
}
}

buildTypes {
release {
isMinifyEnabled = false
signingConfig = signingConfigs.getByName("release")
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
// Built-in Kotlin defaults jvmTarget to compileOptions.targetCompatibility (17).
buildFeatures {
compose = true
}
}

dependencies {
implementation(platform(libs.androidx.compose.bom))

implementation(libs.androidx.activity.compose)
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.graphics)
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.compose.material3)
debugImplementation(libs.androidx.compose.ui.tooling)
}

// Native libs are NOT built by Gradle. Build them beforehand with CMake presets
// (from repo root) so the .so files exist in app/src/main/jniLibs/<abi>/:
// export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/<version>
// cd runtime
// cmake --preset android-arm64-v8a
// cmake --build --preset android-arm64-v8a
// cmake --install build/aarch64-linux-android --component jni
// Gradle only packages whatever is already present under jniLibs.

This file was deleted.

4 changes: 1 addition & 3 deletions runtime/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
tools:replace="android:theme"
android:theme="@style/Theme.Wenet">
<activity
android:name=".MainActivity"
Expand Down
2 changes: 1 addition & 1 deletion runtime/android/app/src/main/assets/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Android model assets

The app loads four FST models at runtime (see `MainActivity.java` and
The app loads four FST models at runtime (see `MainActivity.kt` and
`wetextprocessing.cc`). They are **not** checked into git and must be placed in
this directory before building the APK:

Expand Down

This file was deleted.

Loading
Loading