build.gradle 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. buildscript {
  2. repositories {
  3. google()
  4. mavenCentral()
  5. }
  6. dependencies {
  7. classpath 'com.android.tools.build:gradle:7.4.1'
  8. }
  9. }
  10. repositories {
  11. google()
  12. mavenCentral()
  13. }
  14. apply plugin: 'com.android.application'
  15. dependencies {
  16. implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
  17. }
  18. android {
  19. /*******************************************************
  20. * The following variables:
  21. * - androidBuildToolsVersion,
  22. * - androidCompileSdkVersion
  23. * - qtAndroidDir - holds the path to qt android files
  24. * needed to build any Qt application
  25. * on Android.
  26. *
  27. * are defined in gradle.properties file. This file is
  28. * updated by QtCreator and androiddeployqt tools.
  29. * Changing them manually might break the compilation!
  30. *******************************************************/
  31. compileSdkVersion androidCompileSdkVersion.toInteger()
  32. buildToolsVersion androidBuildToolsVersion
  33. ndkVersion androidNdkVersion
  34. // Extract native libraries from the APK
  35. packagingOptions.jniLibs.useLegacyPackaging true
  36. sourceSets {
  37. main {
  38. manifest.srcFile 'AndroidManifest.xml'
  39. java.srcDirs = [qtAndroidDir + '/src', 'src', 'java']
  40. aidl.srcDirs = [qtAndroidDir + '/src', 'src', 'aidl']
  41. res.srcDirs = [qtAndroidDir + '/res', 'res']
  42. resources.srcDirs = ['resources']
  43. renderscript.srcDirs = ['src']
  44. assets.srcDirs = ['assets']
  45. jniLibs.srcDirs = ['libs']
  46. }
  47. }
  48. tasks.withType(JavaCompile) {
  49. options.incremental = true
  50. }
  51. compileOptions {
  52. sourceCompatibility JavaVersion.VERSION_1_8
  53. targetCompatibility JavaVersion.VERSION_1_8
  54. }
  55. lintOptions {
  56. abortOnError false
  57. }
  58. // Do not compress Qt binary resources file
  59. aaptOptions {
  60. noCompress 'rcc'
  61. }
  62. defaultConfig {
  63. resConfig "en"
  64. minSdkVersion qtMinSdkVersion
  65. targetSdkVersion qtTargetSdkVersion
  66. ndk.abiFilters = qtTargetAbiList.split(",")
  67. }
  68. }