2018-11-06 01:39:09 +08:00
|
|
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
|
|
|
|
|
|
|
buildscript {
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
google()
|
|
|
|
jcenter()
|
|
|
|
}
|
|
|
|
dependencies {
|
|
|
|
classpath 'com.android.tools.build:gradle:@ANDROID_GRADLE_PLUGIN_VERSION@'
|
2021-06-05 19:46:09 +08:00
|
|
|
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:@KOTLIN_PLUGIN_VERSION@'
|
2018-11-06 01:39:09 +08:00
|
|
|
|
|
|
|
// NOTE: Do not place your application dependencies here; they belong
|
|
|
|
// in the individual module build.gradle files
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
allprojects {
|
|
|
|
repositories {
|
|
|
|
google()
|
|
|
|
jcenter()
|
2023-11-17 19:17:17 +08:00
|
|
|
if (gradle.opencv_source == "maven_local") {
|
|
|
|
maven {
|
|
|
|
url gradle.opencv_maven_path
|
|
|
|
}
|
|
|
|
}
|
2018-11-06 01:39:09 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task clean(type: Delete) {
|
|
|
|
delete rootProject.buildDir
|
|
|
|
}
|
|
|
|
|
|
|
|
//allprojects {
|
|
|
|
// gradle.projectsEvaluated {
|
|
|
|
// tasks.withType(JavaCompile) {
|
|
|
|
// options.compilerArgs << "-Xlint:unchecked"
|
|
|
|
// options.compilerArgs << "-Xlint:deprecation"
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
|
2022-10-23 22:31:02 +08:00
|
|
|
def opencv_strict_build_configuration = @ANDROID_STRICT_BUILD_CONFIGURATION@;
|
2018-11-06 01:39:09 +08:00
|
|
|
|
|
|
|
gradle.afterProject { project ->
|
|
|
|
if (project.pluginManager.hasPlugin('com.android.application')
|
|
|
|
|| project.pluginManager.hasPlugin('com.android.library')
|
|
|
|
|| project.pluginManager.hasPlugin('com.android.test')
|
|
|
|
|| project.pluginManager.hasPlugin('com.android.feature') ) {
|
|
|
|
if (true) {
|
|
|
|
gradle.println("Override build ABIs for the project ${project.name}")
|
|
|
|
project.android {
|
|
|
|
splits {
|
|
|
|
abi {
|
|
|
|
enable true
|
|
|
|
universalApk false
|
|
|
|
@ANDROID_ABI_FILTER@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (true) {
|
|
|
|
gradle.println("Override lintOptions for the project ${project.name}")
|
|
|
|
project.android {
|
|
|
|
lintOptions {
|
|
|
|
// checkReleaseBuilds false
|
|
|
|
abortOnError false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-05-19 01:13:39 +08:00
|
|
|
|
|
|
|
// (you still need to re-build OpenCV with debug information to debug it)
|
|
|
|
if (true) {
|
|
|
|
gradle.println("Override doNotStrip-debug for the project ${project.name}")
|
|
|
|
project.android {
|
|
|
|
buildTypes {
|
|
|
|
debug {
|
|
|
|
packagingOptions {
|
|
|
|
doNotStrip '**/*.so' // controlled by OpenCV CMake scripts
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (false || project.hasProperty("doNotStrip")) {
|
|
|
|
gradle.println("Override doNotStrip-release for the project ${project.name}")
|
|
|
|
project.android {
|
|
|
|
buildTypes {
|
|
|
|
release {
|
|
|
|
packagingOptions {
|
|
|
|
doNotStrip '**/*.so' // controlled by OpenCV CMake scripts
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-23 22:31:02 +08:00
|
|
|
// Android Gradle Plugin (AGP) 3.5+ is required
|
|
|
|
// https://github.com/android/ndk-samples/wiki/Configure-NDK-Path
|
|
|
|
def isNdkVersionSupported = project.android.metaClass.getProperties().find { it.name == 'ndkVersion' } != null
|
|
|
|
if ((false || opencv_strict_build_configuration) && isNdkVersionSupported) {
|
|
|
|
gradle.println("Override ndkVersion for the project ${project.name}")
|
|
|
|
project.android {
|
|
|
|
ndkVersion '@ANDROID_NDK_REVISION@'
|
|
|
|
}
|
|
|
|
}
|
2018-11-06 01:39:09 +08:00
|
|
|
}
|
|
|
|
}
|