-
Notifications
You must be signed in to change notification settings - Fork 10
/
android.gradle
70 lines (62 loc) · 1.74 KB
/
android.gradle
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Gradle script to build Android native libraries
plugins {
alias(libs.plugins.android.library)
}
String flavor = 'Sp'
if (project.hasProperty('flavor')) {
flavor = project.ext.flavor
}
android {
buildTypes.debug {
jniDebuggable = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
compileSdkVersion 30
defaultConfig {
minSdkVersion 22
targetSdkVersion 30
ndk {
//abiFilters 'x86_64'
}
}
externalNativeBuild.ndkBuild {
path 'Android.mk'
}
namespace 'com.github.stephengold.libbulletjme'
ndkVersion '23.1.7779620'
}
dependencies {
implementation(libs.jaxb.api)
}
tasks.register('copyToDist') {}
def archmap = [ 'ARM7' : 'armeabi-v7a', \
'ARM8' : 'arm64-v8a', \
'X86' : 'x86', \
'X86_64' : 'x86_64' ]
def btmap = [ 'Debug' : 'merged_native_libs/debug', \
'Release' : 'stripped_native_libs/release' ]
archmap.each { arch ->
btmap.each { bt ->
String q = arch.key + bt.key + flavor
String so = bt.value + "/out/lib/${arch.value}/libbulletjme.so"
def sharedLibraryFile = file('build/intermediates/' + so)
copyToDist.dependsOn('copyToDist_' + q)
tasks.register('copyToDist_' + q, Copy) {
dependsOn 'assemble' + bt.key
from sharedLibraryFile
rename { return 'Android_' + q + '_libbulletjme.so' }
into 'dist'
}
}
}
// Register cleanup tasks:
clean.dependsOn('cleanCxx', 'cleanDist')
tasks.register('cleanCxx', Delete) {
delete '.cxx'
}
tasks.register('cleanDist', Delete) { // files to be distributed
delete 'dist'
}