93 lines
2.3 KiB
Groovy
93 lines
2.3 KiB
Groovy
apply plugin: 'com.android.application'
|
|
apply plugin: 'kotlin-android'
|
|
apply plugin: 'kotlin-android-extensions'
|
|
|
|
apply from: '../../../build/filament-tasks.gradle'
|
|
|
|
compileMesh {
|
|
group 'Filament'
|
|
description 'Compile mesh'
|
|
|
|
inputFile = file("../../../../third_party/models/shader_ball/shader_ball.obj")
|
|
outputDir = file("src/main/assets/models")
|
|
}
|
|
|
|
generateIbl {
|
|
group 'Filament'
|
|
description 'Generate IBL'
|
|
|
|
inputFile = file("../../../../third_party/environments/flower_road_2k.hdr")
|
|
outputDir = file("src/main/assets/envs")
|
|
}
|
|
|
|
preBuild.dependsOn compileMesh
|
|
preBuild.dependsOn generateIbl
|
|
|
|
android {
|
|
compileSdkVersion 28
|
|
defaultConfig {
|
|
applicationId "com.google.android.filament.ibl"
|
|
minSdkVersion 21
|
|
targetSdkVersion 28
|
|
versionCode 1
|
|
versionName "1.0"
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
}
|
|
}
|
|
|
|
// Filament comes with native code, the following declarations
|
|
// can be used to generate architecture specific APKs
|
|
flavorDimensions 'cpuArch'
|
|
productFlavors {
|
|
arm8 {
|
|
dimension 'cpuArch'
|
|
ndk {
|
|
abiFilters 'arm64-v8a'
|
|
}
|
|
}
|
|
arm7 {
|
|
dimension 'cpuArch'
|
|
ndk {
|
|
abiFilters 'armeabi-v7a'
|
|
}
|
|
}
|
|
x86_64 {
|
|
dimension 'cpuArch'
|
|
ndk {
|
|
abiFilters 'x86_64'
|
|
}
|
|
}
|
|
x86 {
|
|
dimension 'cpuArch'
|
|
ndk {
|
|
abiFilters 'x86'
|
|
}
|
|
}
|
|
universal {
|
|
dimension 'cpuArch'
|
|
}
|
|
}
|
|
|
|
// We use the .filamat extension for materials compiled with matc
|
|
// Telling aapt to not compress them allows to load them efficiently
|
|
aaptOptions {
|
|
noCompress 'filamat'
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
|
|
// Depend on Filament
|
|
implementation 'com.google.android.filament:filament-android'
|
|
|
|
// Depend on Filamat
|
|
implementation 'com.google.android.filament:filamat-android'
|
|
}
|