build.gradle 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. group 'com.example.native_vision'
  2. version '1.0-SNAPSHOT'
  3. buildscript {
  4. ext.kotlin_version = '1.6.10'
  5. repositories {
  6. google()
  7. mavenCentral()
  8. }
  9. dependencies {
  10. classpath 'com.android.tools.build:gradle:7.1.2'
  11. classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
  12. }
  13. }
  14. rootProject.allprojects {
  15. repositories {
  16. google()
  17. mavenCentral()
  18. }
  19. }
  20. apply plugin: 'com.android.library'
  21. apply plugin: 'kotlin-android'
  22. android {
  23. compileSdkVersion 31
  24. compileOptions {
  25. sourceCompatibility JavaVersion.VERSION_1_8
  26. targetCompatibility JavaVersion.VERSION_1_8
  27. }
  28. kotlinOptions {
  29. jvmTarget = '1.8'
  30. }
  31. sourceSets {
  32. main.java.srcDirs += 'src/main/kotlin'
  33. }
  34. defaultConfig {
  35. minSdkVersion 21
  36. }
  37. buildTypes {
  38. debug {
  39. externalNativeBuild {
  40. cmake {
  41. // arguments "-DOpenCV_DIR=" + opencvsdk + "/sdk/native"
  42. arguments "-DANDROID_STL=c++_shared"
  43. cppFlags "-frtti -fexceptions -std=c++17 -DDEBUG=1"
  44. abiFilters "armeabi-v7a", "arm64-v8a"
  45. }
  46. }
  47. }
  48. release {
  49. externalNativeBuild {
  50. cmake {
  51. // arguments "-DOpenCV_DIR=" + opencvsdk + "/sdk/native"
  52. arguments "-DANDROID_STL=c++_shared"
  53. cppFlags "-frtti -fexceptions -std=c++17 -DDEBUG=0"
  54. abiFilters "armeabi-v7a", "arm64-v8a"
  55. }
  56. }
  57. minifyEnabled false
  58. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  59. }
  60. }
  61. externalNativeBuild {
  62. // Encapsulates your CMake build configurations.
  63. cmake {
  64. // Provides a relative path to your CMake build script.
  65. path "CMakeLists.txt"
  66. }
  67. }
  68. }
  69. dependencies {
  70. implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
  71. }