Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / library / avatar / build.gradle.kts
build.gradle.kts37 lines · 1.1 KiBRaw
| 1 | plugins { |
| 2 | id("common-conventions-library") |
| 3 | } |
| 4 | |
| 5 | android { |
| 6 | // Detached-fd asset handoff (YuuAvatarAssets): the .glb must stay stored |
| 7 | // uncompressed so openFd() maps it. Same arrangement as :library:ml. |
| 8 | aaptOptions { |
| 9 | noCompress += ".glb" |
| 10 | } |
| 11 | } |
| 12 | |
| 13 | androidComponents { |
| 14 | onVariants { variant -> |
| 15 | variant.sources.jniLibs?.addStaticSourceDirectory( |
| 16 | layout.buildDirectory.dir("rustJniLibs").get().asFile.absolutePath |
| 17 | ) |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | dependencies { |
| 22 | implementation(project(":library:ui")) |
| 23 | implementation(libs.androidx.lifecycle.runtime.compose) |
| 24 | } |
| 25 | |
| 26 | // Yuu 3D avatar engine: `library/avatar/src/main/rust`, glTF upper-body base |
| 27 | // mesh, skeletal skinning, preset poses, Vulkan-first + GLES fallback. |
| 28 | // |
| 29 | // Same arrangement as :library:map: the crate builds into rustJniLibs and |
| 30 | // YuuAvatarNative.isAvailable gates every call, so devices without the .so |
| 31 | // keep the 2D YuuFace preview. arm64 only (map precedent). |
| 32 | rustNativeLib( |
| 33 | "yuu_avatar", |
| 34 | "avatar", |
| 35 | // yuu_avatar_gles.* are GLSL ES, compiled at run time by the GLES path. |
| 36 | shaders = listOf("yuu_avatar.vert", "yuu_avatar.frag"), |
| 37 | ) |