-DFILAMENT_SKIP_SAMPLES=ON with CMake -Pfilament_skip_samples with gradle This change also renames CMake options specific to Filament to avoid clashes with subprojects.
70 lines
1.9 KiB
Groovy
70 lines
1.9 KiB
Groovy
// This script accepts the following parameters:
|
|
//
|
|
// filament_dist_dir
|
|
// Path to the Filament distribution/install directory for Android
|
|
// (produced by make/ninja install). This directory must contain lib/arm64-v8a/ etc.
|
|
//
|
|
// filament_skip_samples
|
|
// Exclude samples from the project. Useful to speed up compilation.
|
|
//
|
|
// Example:
|
|
// ./gradlew -Pfilament_dist_dir=../dist-android-release assembleRelease
|
|
|
|
buildscript {
|
|
def filamentPath = file("../out/android-release/filament").absolutePath
|
|
if (project.hasProperty("filament_dist_dir")) {
|
|
filamentPath = file("$filament_dist_dir").absolutePath
|
|
}
|
|
|
|
ext.filamentPath = filamentPath
|
|
|
|
// Our minSdkVersion is actually 19, we lie and say 14 here so apps don't have
|
|
// to increase their minSdkVersion unnecessarily. It is however up to them to
|
|
// ensure they do not initialize Filament on API levels < 19.
|
|
ext.versions = [
|
|
'minSdk': 14,
|
|
'targetSdk': 29,
|
|
'compileSdk': 29,
|
|
'kotlin': '1.3.61',
|
|
'buildTools': '29.0.3',
|
|
]
|
|
|
|
ext.deps = [
|
|
'androidx': [
|
|
'annotations': "androidx.annotation:annotation:1.1.0",
|
|
'core': "androidx.core:core:1.1.0",
|
|
],
|
|
'kotlin': "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${versions.kotlin}"
|
|
]
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
google()
|
|
jcenter()
|
|
}
|
|
|
|
dependencies {
|
|
classpath 'com.android.tools.build:gradle:3.6.0'
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
|
|
}
|
|
}
|
|
|
|
subprojects { project ->
|
|
group = GROUP
|
|
version = VERSION_NAME
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
google()
|
|
jcenter()
|
|
}
|
|
}
|
|
|
|
gradle.taskGraph.whenReady {
|
|
gradle.taskGraph.allTasks.each {
|
|
it.onlyIf {
|
|
!it.project.ext.has('isSample') || !project.hasProperty('filament_skip_samples')
|
|
}
|
|
}
|
|
}
|