-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbufferallocator.gradle
More file actions
35 lines (30 loc) · 1.4 KB
/
bufferallocator.gradle
File metadata and controls
35 lines (30 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// build file for native buffer allocator, created by pavl_g on 5/17/22.
// directories for native source
String bufferAllocatorAndroidPath = 'src/native/jme_bufferallocator'
String bufferAllocatorHeaders = 'src/native/headers'
// directories for build
String bufferAllocatorBuildDir = "$buildDir" + File.separator + "bufferallocator"
String bufferAllocatorJniDir = bufferAllocatorBuildDir + File.separator + "jni"
String bufferAllocatorHeadersBuildDir = bufferAllocatorJniDir + File.separator + "headers"
String bufferAllocatorBuildLibsDir = bufferAllocatorBuildDir + File.separator + "libs"
// copy native src to build dir
task copyJmeBufferAllocator(type: Copy) {
from file(bufferAllocatorAndroidPath)
into file(bufferAllocatorJniDir)
}
// copy native headers to build dir
task copyJmeHeadersBufferAllocator(type: Copy, dependsOn: copyJmeBufferAllocator) {
from file(bufferAllocatorHeaders)
into file(bufferAllocatorHeadersBuildDir)
}
// compile and build copied natives in build dir
task buildBufferAllocatorNativeLib(type: Exec, dependsOn: [copyJmeBufferAllocator, copyJmeHeadersBufferAllocator]) {
dependsOn validateAndroidNdk
workingDir bufferAllocatorBuildDir
executable rootProject.ndkCommandPath
args(
"APP_ABI=${rootProject.ext.androidAbis.join(',')}",
"APP_PLATFORM=${rootProject.ext.androidPlatform}",
"-j${Runtime.runtime.availableProcessors()}"
)
}