build.gradle.in 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. // Top-level build file where you can add configuration options common to all sub-projects/modules.
  2. buildscript {
  3. repositories {
  4. google()
  5. jcenter()
  6. }
  7. dependencies {
  8. classpath 'com.android.tools.build:gradle:@ANDROID_GRADLE_PLUGIN_VERSION@'
  9. classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:@KOTLIN_PLUGIN_VERSION@'
  10. // NOTE: Do not place your application dependencies here; they belong
  11. // in the individual module build.gradle files
  12. }
  13. }
  14. allprojects {
  15. repositories {
  16. google()
  17. jcenter()
  18. }
  19. }
  20. task clean(type: Delete) {
  21. delete rootProject.buildDir
  22. }
  23. //allprojects {
  24. // gradle.projectsEvaluated {
  25. // tasks.withType(JavaCompile) {
  26. // options.compilerArgs << "-Xlint:unchecked"
  27. // options.compilerArgs << "-Xlint:deprecation"
  28. // }
  29. // }
  30. //}
  31. gradle.afterProject { project ->
  32. if (project.pluginManager.hasPlugin('com.android.application')
  33. || project.pluginManager.hasPlugin('com.android.library')
  34. || project.pluginManager.hasPlugin('com.android.test')
  35. || project.pluginManager.hasPlugin('com.android.feature') ) {
  36. if (true) {
  37. gradle.println("Override build ABIs for the project ${project.name}")
  38. project.android {
  39. splits {
  40. abi {
  41. enable true
  42. universalApk false
  43. @ANDROID_ABI_FILTER@
  44. }
  45. }
  46. }
  47. }
  48. if (true) {
  49. gradle.println("Override lintOptions for the project ${project.name}")
  50. project.android {
  51. lintOptions {
  52. // checkReleaseBuilds false
  53. abortOnError false
  54. }
  55. }
  56. }
  57. // (you still need to re-build OpenCV with debug information to debug it)
  58. if (true) {
  59. gradle.println("Override doNotStrip-debug for the project ${project.name}")
  60. project.android {
  61. buildTypes {
  62. debug {
  63. packagingOptions {
  64. doNotStrip '**/*.so' // controlled by OpenCV CMake scripts
  65. }
  66. }
  67. }
  68. }
  69. }
  70. if (false || project.hasProperty("doNotStrip")) {
  71. gradle.println("Override doNotStrip-release for the project ${project.name}")
  72. project.android {
  73. buildTypes {
  74. release {
  75. packagingOptions {
  76. doNotStrip '**/*.so' // controlled by OpenCV CMake scripts
  77. }
  78. }
  79. }
  80. }
  81. }
  82. }
  83. }