From b8113fc7575b6c1a278e1bddbdc9c3688741cbed Mon Sep 17 00:00:00 2001 From: QIU Date: Wed, 12 Aug 2026 11:52:47 +0000 Subject: [PATCH] build(cw): add onnxruntime-android 1.28.0 to core:data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DeepCW 模型推理需要 ONNX Runtime。该依赖属 Android 平台依赖 (AAR 内含 各 ABI 原生库), 因此放 core:data 而非 core:domain —— 后者按 AGENTS.md 须保持纯 Kotlin/JVM 以留 KMP 迁移余地。 版本固定为 1.28.0 不使用范围区间: release 构建走 R8, 避免依赖意外升级 引入行为变化。 验证: ./gradlew :core:data:dependencies --configuration releaseRuntimeClasspath => \--- com.microsoft.onnxruntime:onnxruntime-android:1.28.0 => BUILD SUCCESSFUL in 3m 48s --- core/data/build.gradle.kts | 6 ++++++ gradle/libs.versions.toml | 3 +++ 2 files changed, 9 insertions(+) diff --git a/core/data/build.gradle.kts b/core/data/build.gradle.kts index 50e6afee..5bc9719e 100644 --- a/core/data/build.gradle.kts +++ b/core/data/build.gradle.kts @@ -5,3 +5,9 @@ plugins { android { namespace = "com.rtbishop.look4sat.core.data" } + +dependencies { + // DeepCW 神经网络 CW 解码推理。ONNX 推理属 Android 平台依赖, 放此处而非 + // core:domain —— 后者须保持纯 Kotlin/JVM 以留 KMP 迁移余地 (见 AGENTS.md)。 + implementation(libs.other.onnxruntime) +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 140b7b87..1747733f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -34,6 +34,7 @@ kotlin = "2.4.10" kotlin-coroutines = "1.11.0" kotlin-serialization = "1.11.0" +other-onnxruntime = "1.28.0" other-okhttp = "5.4.0" other-osmdroid = "6.1.20" @@ -77,6 +78,8 @@ kotlin-gradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", ve #noinspection UnusedVersionCatalogEntry kotlin-serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlin-serialization" } +#noinspection UnusedVersionCatalogEntry +other-onnxruntime = { module = "com.microsoft.onnxruntime:onnxruntime-android", version.ref = "other-onnxruntime" } #noinspection UnusedVersionCatalogEntry other-okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "other-okhttp" } #noinspection UnusedVersionCatalogEntry