build.gradle 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. apply plugin: 'com.android.library'
  2. android {
  3. // If you want to use the debugger for JNI code, you want to debug this lib-project in Debug!
  4. // And due to gradle limitations/bugs, the best way is to always debug it in debug.
  5. // See https://code.google.com/p/android/issues/detail?id=52962
  6. // and http://stackoverflow.com/questions/27277433/why-does-gradle-build-my-module-in-release-mode-when-the-app-is-in-debug
  7. // defaultPublishConfig "debug"
  8. compileSdkVersion 28
  9. buildToolsVersion '28.0.3'
  10. defaultConfig {
  11. compileSdkVersion 28
  12. buildToolsVersion "28.0.3"
  13. minSdkVersion 14
  14. resValue "bool", "embed", "false"
  15. externalNativeBuild {
  16. ndkBuild {
  17. arguments "-j4"
  18. }
  19. }
  20. ndk {
  21. // Specifies the ABI configurations of your native
  22. // libraries Gradle should build and package with your APK.
  23. abiFilters 'armeabi-v7a', 'arm64-v8a'
  24. }
  25. targetSdkVersion 29
  26. }
  27. buildTypes {
  28. release {
  29. minifyEnabled true
  30. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  31. }
  32. }
  33. flavorDimensions 'mode'
  34. productFlavors {
  35. normal {
  36. dimension 'mode'
  37. }
  38. playstore {
  39. dimension 'mode'
  40. }
  41. embed {
  42. dimension 'mode'
  43. resValue "bool", "embed", "true"
  44. }
  45. }
  46. sourceSets {
  47. main {
  48. java {
  49. srcDir 'src/jni/SDL2/android-project/app/src/main/java'
  50. srcDir 'src/main/java'
  51. }
  52. }
  53. playstore {
  54. java {
  55. srcDir 'src/normal/java'
  56. }
  57. }
  58. }
  59. externalNativeBuild {
  60. ndkBuild {
  61. path "src/jni/Android.mk"
  62. }
  63. }
  64. lintOptions {
  65. abortOnError false
  66. }
  67. packagingOptions {
  68. exclude 'lib/arm64-v8a/libSDL2.so'
  69. exclude 'lib/armeabi-v7a/libSDL2.so'
  70. }
  71. }
  72. dependencies {
  73. api fileTree(dir: 'libs', include: ['*.jar'])
  74. api 'androidx.appcompat:appcompat:1.1.0-alpha01'
  75. }