Viewing is open to everyone. Downloading and starring need a GitHub sign-in. Sign in with GitHub

build.gradle.kts

v0.1.0-build.85 Latest Commit ede38f5

Size
2.2 KB
Lines
79
Language
kotlin
SHA-256
402583ad3d27…
View on GitHub

Sign in with GitHub to download. Each download is recorded with your GitHub username.

1// org.openckey:ckey — the headless core AAR: Kotlin API + libckey_jni.so.
2// No library dependencies (only the Kotlin standard library).
3plugins {
4 alias(libs.plugins.android.library)
5 alias(libs.plugins.kotlin.android)
6 `maven-publish`
7}
8
9description = "CKey optical code for Android: encoding, native rendering, scanning and opt-out aggregate telemetry."
10
11fun flag(name: String): String =
12 if ((findProperty(name) as String? ?: "true").toBoolean()) "ON" else "OFF"
13
14android {
15 namespace = "org.openckey.ckey"
16 compileSdk = 34
17 ndkVersion = "27.2.12479018"
18
19 defaultConfig {
20 minSdk = 24
21 consumerProguardFiles("consumer-rules.pro")
22 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
23 externalNativeBuild {
24 cmake {
25 arguments += listOf(
26 "-DANDROID_STL=c++_static",
27 "-DCKEY_ANDROID_SCAN=${flag("ckey.native.scan")}",
28 "-DCKEY_ANDROID_RENDER=${flag("ckey.native.render")}",
29 "-DCKEY_ANDROID_TELEMETRY=${flag("ckey.native.telemetry")}",
30 )
31 }
32 }
33 ndk {
34 abiFilters += listOf("arm64-v8a", "armeabi-v7a", "x86_64", "x86")
35 }
36 }
37
38 externalNativeBuild {
39 cmake {
40 path = file("src/main/cpp/CMakeLists.txt")
41 version = "3.22.1"
42 }
43 }
44
45 buildTypes {
46 release {
47 isMinifyEnabled = false
48 }
49 }
50
51 compileOptions {
52 sourceCompatibility = JavaVersion.VERSION_17
53 targetCompatibility = JavaVersion.VERSION_17
54 }
55
56 testOptions {
57 // Unit tests are pure JVM (payload rules, telemetry validation, sender);
58 // they never load the native library.
59 unitTests.isReturnDefaultValues = true
60 }
61
62 publishing {
63 singleVariant("release") {
64 withSourcesJar()
65 }
66 }
67}
68
69kotlin {
70 compilerOptions {
71 jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
72 }
73}
74
75dependencies {
76 testImplementation(libs.junit)
77 androidTestImplementation(libs.androidx.test.runner)
78 androidTestImplementation(libs.androidx.test.ext.junit)
79}