133 lines
3.3 KiB
Groovy
133 lines
3.3 KiB
Groovy
plugins {
|
|
id 'com.android.library'
|
|
}
|
|
|
|
android {
|
|
namespace 'org.godotengine.plugin.vavcore'
|
|
compileSdkVersion 34
|
|
|
|
defaultConfig {
|
|
minSdkVersion 29 // Android 10+ required for AV1 MediaCodec
|
|
targetSdkVersion 34
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
consumerProguardFiles "consumer-rules.pro"
|
|
|
|
ndk {
|
|
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64'
|
|
}
|
|
|
|
externalNativeBuild {
|
|
cmake {
|
|
cppFlags "-std=c++17 -frtti -fexceptions"
|
|
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64'
|
|
arguments "-DANDROID_STL=c++_shared"
|
|
}
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
|
|
ndk {
|
|
debugSymbolLevel 'SYMBOL_TABLE'
|
|
}
|
|
}
|
|
|
|
debug {
|
|
debuggable true
|
|
jniDebuggable true
|
|
|
|
ndk {
|
|
debugSymbolLevel 'FULL'
|
|
}
|
|
}
|
|
}
|
|
|
|
externalNativeBuild {
|
|
cmake {
|
|
path "jni/CMakeLists.txt"
|
|
version "3.18.1"
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
jniLibs.srcDirs = ['src/main/jniLibs']
|
|
}
|
|
}
|
|
|
|
packagingOptions {
|
|
pickFirst '**/libc++_shared.so'
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
// Godot 4.4.1 dependencies
|
|
compileOnly 'org.godotengine:godot:4.4.1.stable'
|
|
|
|
// AndroidX dependencies
|
|
implementation 'androidx.core:core:1.12.0'
|
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
|
|
|
// Test dependencies
|
|
testImplementation 'junit:junit:4.13.2'
|
|
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
|
}
|
|
|
|
// Task to copy VavCore library from platform build
|
|
task copyVavCoreLibrary {
|
|
doLast {
|
|
def sourceDir = file("../../vavcore/libs")
|
|
def targetDir = file("src/main/jniLibs")
|
|
|
|
if (sourceDir.exists()) {
|
|
copy {
|
|
from sourceDir
|
|
into targetDir
|
|
include '**/*.so'
|
|
}
|
|
println "VavCore libraries copied from platform build"
|
|
} else {
|
|
println "Warning: VavCore platform build not found at ${sourceDir}"
|
|
println "Please build VavCore platform library first:"
|
|
println "cd ../../vavcore && ./build.sh"
|
|
}
|
|
}
|
|
}
|
|
|
|
// Task to copy VavCore headers for JNI
|
|
task copyVavCoreHeaders {
|
|
doLast {
|
|
def sourceDir = file("../../../../VavCore/include")
|
|
def targetDir = file("jni/VavCore")
|
|
|
|
if (sourceDir.exists()) {
|
|
copy {
|
|
from sourceDir
|
|
into targetDir.parent
|
|
include '**/*.h'
|
|
}
|
|
println "VavCore headers copied for JNI compilation"
|
|
} else {
|
|
println "Warning: VavCore headers not found at ${sourceDir}"
|
|
}
|
|
}
|
|
}
|
|
|
|
// Run copy tasks before build
|
|
preBuild.dependsOn copyVavCoreLibrary, copyVavCoreHeaders
|
|
|
|
// Clean task
|
|
clean {
|
|
delete "src/main/jniLibs"
|
|
delete "jni/VavCore"
|
|
} |