| 1 | // litehtml renderer prototype: the C++ core in renderer-litehtml/ (repo root, shared with the iOS/macOS demo) built |
| 2 | // by the NDK's CMake through externalNativeBuild, plus the Kotlin Renderer (fonts, text metrics and the display-list |
| 3 | // painter on android.graphics) that WidgetHost plugs in. Not part of the product library; see docs/litehtml-renderer.md. |
| 4 | import org.jetbrains.kotlin.gradle.dsl.JvmTarget |
| 5 | |
| 6 | plugins { |
| 7 | alias(libs.plugins.android.library) |
| 8 | alias(libs.plugins.kotlin.android) |
| 9 | } |
| 10 | |
| 11 | android { |
| 12 | namespace = "org.telegram.widgetsandbox.litehtml" |
| 13 | compileSdk = 35 |
| 14 | ndkVersion = "28.2.13676358" |
| 15 | |
| 16 | defaultConfig { |
| 17 | minSdk = 26 |
| 18 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" |
| 19 | externalNativeBuild { |
| 20 | cmake { |
| 21 | arguments += listOf("-DANDROID_STL=c++_static") |
| 22 | } |
| 23 | } |
| 24 | ndk { |
| 25 | abiFilters += listOf("arm64-v8a") |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | externalNativeBuild { |
| 30 | cmake { |
| 31 | path = file("src/main/cpp/CMakeLists.txt") |
| 32 | version = "3.31.6" |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | buildFeatures { |
| 37 | buildConfig = false |
| 38 | } |
| 39 | |
| 40 | compileOptions { |
| 41 | sourceCompatibility = JavaVersion.VERSION_17 |
| 42 | targetCompatibility = JavaVersion.VERSION_17 |
| 43 | } |
| 44 | |
| 45 | packaging { |
| 46 | jniLibs.useLegacyPackaging = false |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | kotlin { |
| 51 | compilerOptions { |
| 52 | jvmTarget.set(JvmTarget.JVM_17) |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | dependencies { |
| 57 | implementation("org.telegram.widgetsandbox:widget-sandbox") |
| 58 | implementation(libs.androidx.core.ktx) |
| 59 | implementation(libs.androidx.annotation) |
| 60 | } |
| 61 | |