🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.1 KiB

  1. def buildAsLibrary = project.hasProperty('BUILD_AS_LIBRARY');
  2. def buildAsApplication = !buildAsLibrary
  3. if (buildAsApplication) {
  4. apply plugin: 'com.android.application'
  5. }
  6. else {
  7. apply plugin: 'com.android.library'
  8. }
  9. android {
  10. if (buildAsApplication) {
  11. namespace "org.libsdl.app"
  12. }
  13. compileSdkVersion 34
  14. defaultConfig {
  15. minSdkVersion 19
  16. targetSdkVersion 34
  17. versionCode 1
  18. versionName "1.0"
  19. externalNativeBuild {
  20. ndkBuild {
  21. arguments "APP_PLATFORM=android-19"
  22. abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
  23. }
  24. // cmake {
  25. // arguments "-DANDROID_APP_PLATFORM=android-19", "-DANDROID_STL=c++_static"
  26. // // abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
  27. // abiFilters 'arm64-v8a'
  28. // }
  29. }
  30. }
  31. buildTypes {
  32. release {
  33. minifyEnabled false
  34. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  35. }
  36. }
  37. applicationVariants.all { variant ->
  38. tasks["merge${variant.name.capitalize()}Assets"]
  39. .dependsOn("externalNativeBuild${variant.name.capitalize()}")
  40. }
  41. if (!project.hasProperty('EXCLUDE_NATIVE_LIBS')) {
  42. sourceSets.main {
  43. jniLibs.srcDir 'libs'
  44. }
  45. externalNativeBuild {
  46. ndkBuild {
  47. path 'jni/Android.mk'
  48. }
  49. // cmake {
  50. // path 'jni/CMakeLists.txt'
  51. // }
  52. }
  53. }
  54. lint {
  55. abortOnError false
  56. }
  57. if (buildAsLibrary) {
  58. libraryVariants.all { variant ->
  59. variant.outputs.each { output ->
  60. def outputFile = output.outputFile
  61. if (outputFile != null && outputFile.name.endsWith(".aar")) {
  62. def fileName = "org.libsdl.app.aar";
  63. output.outputFile = new File(outputFile.parent, fileName);
  64. }
  65. }
  66. }
  67. }
  68. }
  69. dependencies {
  70. implementation fileTree(include: ['*.jar'], dir: 'libs')
  71. }