blob: 64f7a04b61c25a28cbfbade2d84450faeede8b0f [file] [log] [blame]
task build {}
configurations {
perfa
}
def buildTypesList = ['Debug', 'Release'] as String[]
cmake {
name 'host'
buildTypes buildTypesList
projectDir "$rootDir/native"
}
cmake {
name 'android'
buildTypes buildTypesList
// x86 disabled for now; may be useful for local development if you want to
// target emulators. TODO: Enable when we're more confident with this new
// build step affecting the whole team.
abis 'armeabi-v7a', 'arm64-v8a' //, 'x86'
projectDir "$rootDir/native"
flags "-DHOST_BUILD_DIR=$buildDir/gen/release/host"
}
buildTypesList.each() { buildType ->
def buildTypeDir = buildType.toLowerCase()
project."precompileAndroid$buildType".dependsOn "compileHostRelease"
}
task assemblePerfa(type: Copy, dependsOn: compileAndroidRelease) {
into "$buildDir/artifacts/jni"
from("$buildDir/out/release") {
include "*/libperfa.so"
exclude "host/**"
}
}
artifacts {
perfa file: file("$buildDir/artifacts"), builtBy: assemblePerfa
}
// Linking "compileAndroid" to "build" will trigger it's build from IntelliJ, we don't want to do that just yet
// build.dependsOn compileAndroid
task clean(type: DefaultTask) {
doFirst {
file("$buildDir").deleteDir();
}
}