build.gradle 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. buildscript {
  2. repositories {
  3. maven { url 'https://maven.aliyun.com/repository/google' }
  4. maven { url 'https://maven.aliyun.com/repository/central' }
  5. google()
  6. mavenCentral()
  7. }
  8. dependencies {
  9. classpath "com.android.tools.build:gradle:${androidGradleToolsVersion}"
  10. //implementation 'com.github.jiangdongguo.AndroidUSBCamera:libausbc:latest_tag'
  11. //classpath "com.android.tools.build:gradle:7.4.2"
  12. }
  13. }
  14. /*Maven 是一个流行的构建工具和依赖管理工具,用于 Java 项目的构建、依赖管理和项目管理。
  15. 它提供了一个标准化的项目结构、构建生命周期和丰富的插件生态系统*/
  16. allprojects {
  17. repositories {
  18. maven { url 'https://maven.aliyun.com/repository/google' }
  19. maven { url 'https://maven.aliyun.com/repository/central' }
  20. maven { url 'https://jitpack.io' }
  21. google()
  22. mavenCentral()
  23. jcenter() // Warning: this repository is going to shut down soon
  24. //maven { url 'https://install.felgo.com/maven/' }
  25. }
  26. }
  27. apply plugin: 'com.android.application'
  28. dependencies {
  29. implementation 'androidx.appcompat:appcompat:1.4.1'
  30. implementation fileTree(dir: 'libs', include: ['*.jar','*.aar'])
  31. implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
  32. implementation 'com.google.android.material:material:1.4.0'
  33. implementation 'com.github.getActivity:XXPermissions:13.5' //权限申请框架
  34. implementation 'com.github.warkiz.widget:indicatorseekbar:2.1.2'
  35. implementation 'com.herohan:UVCAndroid:1.0.5'
  36. // implementation 'com.felgo.plugins:plugin-notification:4.+'
  37. implementation files('libs/watchdogdev.jar') //看门狗
  38. //implementation files('libs/UVCAndroid-1.0.5.arr') //https://github.com/shiyinghan/UVCAndroid
  39. //implementation files('libs/hutool-core-5.6.3.jar') //https://gitee.com/dromara/hutool#%F0%9F%8F%97%EF%B8%8F%E6%B7%BB%E7%A0%96%E5%8A%A0%E7%93%A6
  40. // testImplementation 'junit:junit:4.13.2'
  41. // androidTestImplementation 'androidx.test.ext:junit:1.1.3'
  42. // androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
  43. //implementation files('libs/MvCameraControl.jar')
  44. }
  45. android {
  46. /*******************************************************
  47. * The following variables:
  48. * - androidBuildToolsVersion,
  49. * - androidCompileSdkVersion
  50. * - qt5AndroidDir - holds the path to qt android files
  51. * needed to build any Qt application
  52. * on Android.
  53. *
  54. * are defined in gradle.properties file. This file is
  55. * updated by QtCreator and androiddeployqt tools.
  56. * Changing them manually might break the compilation!
  57. *******************************************************/
  58. compileSdkVersion androidCompileSdkVersion.toInteger()
  59. buildToolsVersion androidBuildToolsVersion
  60. buildTypes {
  61. release {
  62. minifyEnabled false
  63. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  64. }
  65. }
  66. compileOptions {
  67. sourceCompatibility 1.8
  68. targetCompatibility 1.8
  69. }
  70. defaultConfig {
  71. multiDexEnabled true
  72. targetSdkVersion androidCompileSdkVersion.toInteger()
  73. applicationId = productIdentifier
  74. versionCode = productVersionCode.toInteger()
  75. versionName = productVersionName
  76. minSdkVersion = project.hasProperty("qtMinSdkVersion") ? qtMinSdkVersion.toInteger() : 23
  77. ndk {
  78. abiFilters 'arm64-v8a'
  79. }
  80. }
  81. sourceSets {
  82. main {
  83. manifest.srcFile 'AndroidManifest.xml'
  84. java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java']
  85. aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl']
  86. res.srcDirs = [qt5AndroidDir + '/res', 'res']
  87. resources.srcDirs = ['src']
  88. renderscript.srcDirs = ['src']
  89. assets.srcDirs = ['assets']
  90. jniLibs.srcDirs = ['libs']
  91. }
  92. }
  93. lintOptions {
  94. //checkReleaseBuilds false
  95. abortOnError false
  96. }
  97. aaptOptions { // Do not compress Qt binary resources file
  98. noCompress 'rcc','tflite'
  99. }
  100. tasks.withType(JavaCompile) {
  101. options.incremental = true
  102. }
  103. packagingOptions {
  104. jniLibs {
  105. useLegacyPackaging = true
  106. }
  107. }
  108. }