You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
89 lines
2.0 KiB
89 lines
2.0 KiB
group = "com.example.bluetooth_manager"
|
|
version = "1.0-SNAPSHOT"
|
|
|
|
buildscript {
|
|
ext.kotlin_version = "2.1.0"
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
classpath("com.android.tools.build:gradle:8.9.1")
|
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
|
|
}
|
|
}
|
|
|
|
allprojects {
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
}
|
|
}
|
|
|
|
apply plugin: "com.android.library"
|
|
apply plugin: "kotlin-android"
|
|
|
|
android {
|
|
namespace = "com.example.bluetooth_manager"
|
|
|
|
compileSdk = 36
|
|
|
|
// 与主工程一致。NDK r28 起链接器默认 16KB 页对齐;不声明就会退回工具链默认的
|
|
// 老 NDK,产出 p_align=0x1000 的 .so,Google Play 的 16KB 检查直接拒收。
|
|
ndkVersion = "28.2.13676358"
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_11
|
|
targetCompatibility = JavaVersion.VERSION_11
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = JavaVersion.VERSION_11
|
|
}
|
|
|
|
sourceSets {
|
|
main.java.srcDirs += "src/main/kotlin"
|
|
test.java.srcDirs += "src/test/kotlin"
|
|
}
|
|
|
|
defaultConfig {
|
|
minSdk = 24
|
|
|
|
// 开启 CMake 构建
|
|
externalNativeBuild {
|
|
cmake {
|
|
cppFlags ""
|
|
// NDK r27+ 支持,显式要求可变页大小(16KB)
|
|
arguments "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
|
|
}
|
|
}
|
|
}
|
|
|
|
// 指向我们的 CMakeLists.txt
|
|
externalNativeBuild {
|
|
cmake {
|
|
path "src/main/cpp/CMakeLists.txt"
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
testImplementation("org.jetbrains.kotlin:kotlin-test")
|
|
testImplementation("org.mockito:mockito-core:5.0.0")
|
|
}
|
|
|
|
testOptions {
|
|
unitTests.all {
|
|
useJUnitPlatform()
|
|
|
|
testLogging {
|
|
events "passed", "skipped", "failed", "standardOut", "standardError"
|
|
outputs.upToDateWhen {false}
|
|
showStandardStreams = true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
}
|
|
|