85 lines
2.4 KiB
Groovy
85 lines
2.4 KiB
Groovy
apply plugin: 'com.android.application'
|
|
apply plugin: 'kotlin-android'
|
|
apply plugin: 'kotlin-android-extensions'
|
|
|
|
Properties properties = new Properties()
|
|
properties.load(project.rootProject.file('local.properties').newDataInputStream())
|
|
def ndkDir = properties.getProperty('ndk.dir')
|
|
def valLayerBinDir = "${ndkDir}/sources/third_party/vulkan/src/build-android/jniLibs"
|
|
|
|
android {
|
|
compileSdkVersion 29
|
|
ndkVersion '21.2.6472646'
|
|
|
|
defaultConfig {
|
|
applicationId "com.ethicalml.kompute.examples.android"
|
|
minSdkVersion 26
|
|
targetSdkVersion 29
|
|
versionCode = 1
|
|
versionName = "0.0.1"
|
|
externalNativeBuild {
|
|
cmake {
|
|
abiFilters "armeabi-v7a", 'arm64-v8a', 'x86', 'x86_64'
|
|
arguments '-DANDROID_TOOLCHAIN=clang',
|
|
'-DANDROID_STL=c++_static',
|
|
'-DKOMPUTE_OPT_ANDOID_BUILD=1',
|
|
'-DKOMPUTE_OPT_INSTALL=0',
|
|
'-DKOMPUTE_OPT_BUILD_SINGLE_HEADER=1',
|
|
'-DKOMPUTE_OPT_DISABLE_VK_DEBUG_LAYERS=1'
|
|
}
|
|
}
|
|
}
|
|
|
|
buildFeatures {
|
|
viewBinding true
|
|
}
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled = false
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'),
|
|
'proguard-rules.pro'
|
|
}
|
|
}
|
|
externalNativeBuild {
|
|
cmake {
|
|
path 'src/main/cpp/CMakeLists.txt'
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
jniLibs {
|
|
// Must have ndk-r12 or better which including layer binaries
|
|
srcDirs = ["${valLayerBinDir}"]
|
|
}
|
|
}
|
|
}
|
|
|
|
flavorDimensions 'cpuArch'
|
|
productFlavors {
|
|
arm8 {
|
|
dimension 'cpuArch'
|
|
ndk {
|
|
abiFilters 'arm64-v8a', 'armeabi-v7a'
|
|
}
|
|
}
|
|
x86_64 {
|
|
dimension 'cpuArch'
|
|
ndk {
|
|
abiFilters 'x86_64', 'x86'
|
|
}
|
|
}
|
|
universal {
|
|
dimension 'cpuArch'
|
|
// include all default ABIs. with NDK-r16, it is:
|
|
// armeabi-v7a, arm64-v8a, x86, x86_64
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation 'androidx.appcompat:appcompat:1.1.0'
|
|
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
}
|