build.gradle 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. apply plugin: 'com.android.application'
  2. apply plugin: 'com.tencent.vasdolly'
  3. buildscript {
  4. repositories {
  5. mavenLocal()
  6. mavenCentral()
  7. google()
  8. flatDir {
  9. dirs 'libs' // jar目录
  10. }
  11. }
  12. dependencies {
  13. classpath "com.tencent.vasdolly:plugin:3.0.6"
  14. }
  15. }
  16. android {
  17. namespace 'com.info666.app.infraredRemote'
  18. compileSdk 33
  19. defaultConfig {
  20. applicationId "com.info666.app.infraredRemote"
  21. minSdk 21
  22. targetSdk 33
  23. versionCode 5
  24. versionName "1.0.5"
  25. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  26. ndk {
  27. // 设置支持的SO库架构
  28. abiFilters 'armeabi', 'x86', 'armeabi-v7a', 'x86_64', 'arm64-v8a'
  29. }
  30. }
  31. signingConfigs {
  32. release {
  33. storeFile file("../keyStore/key.jks")
  34. storePassword "Info666.com"
  35. keyAlias "key0"
  36. keyPassword "Info666.com"
  37. enableV1Signing true
  38. enableV2Signing true
  39. enableV3Signing false
  40. }
  41. }
  42. buildTypes {
  43. release {
  44. minifyEnabled false
  45. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  46. signingConfig signingConfigs.release
  47. }
  48. }
  49. compileOptions {
  50. sourceCompatibility JavaVersion.VERSION_1_8
  51. targetCompatibility JavaVersion.VERSION_1_8
  52. }
  53. packagingOptions {
  54. exclude 'META-INF/INDEX.LIST'
  55. }
  56. }
  57. //VasDolly插件配置
  58. //gradle channelDebug/channelRelease 编译生成apk后,再根据生成的Apk生成渠道包
  59. channel{
  60. channelFile = file("app_channel.txt")
  61. //多渠道包的输出目录,默认为new File(project.buildDir,"channel")
  62. outputDir = new File(project.buildDir,"channels")
  63. //多渠道包的命名规则,默认为:${appName}-${versionName}-${versionCode}-${flavorName}-${buildType}-${buildTime}
  64. apkNameFormat ='${appName}-${flavorName}-${buildType}'
  65. //快速模式:生成渠道包时不进行校验(速度可以提升10倍以上,默认为false)
  66. fastMode = false
  67. //buildTime的时间格式,默认格式:yyyyMMdd-HHmmss
  68. buildTimeDateFormat = 'yyyyMMdd-HH:mm:ss'
  69. //低内存模式(仅针对V2签名,默认为false):只把签名块、中央目录和EOCD读取到内存,不把最大头的内容块读取到内存,在手机上合成APK时,可以使用该模式
  70. lowMemory = false
  71. }
  72. // gradle rebuildChannel 配置此任务用于不希望重新构建apk,直接根据指定的apk生成渠道包
  73. rebuildChannel {
  74. channelFile = file("app_channel.txt")
  75. //指定的apk生成渠道包,文件名中如果有base将被替换为渠道名,否则渠道名将作为前缀
  76. baseApk = new File(project.buildDir, "outputs/apk/debug/app-debug.apk")
  77. //默认为new File(project.buildDir, "rebuildChannel")
  78. outputDir = new File(project.buildDir, "rebuildChannels")
  79. //快速模式:生成渠道包时不进行校验(速度可以提升10倍以上,默认为false)
  80. fastMode = false
  81. //低内存模式(仅针对V2签名,默认为false):只把签名块、中央目录和EOCD读取到内存,不把最大头的内容块读取到内存,在手机上合成APK时,可以使用该模式
  82. lowMemory = false
  83. }
  84. dependencies {
  85. implementation 'androidx.appcompat:appcompat:1.4.1'
  86. implementation 'com.google.android.material:material:1.5.0'
  87. implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
  88. testImplementation 'junit:junit:4.13.2'
  89. androidTestImplementation 'androidx.test.ext:junit:1.1.3'
  90. androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
  91. implementation 'com.alibaba.fastjson2:fastjson2:2.0.35.android4'
  92. // AndroidX 版本
  93. implementation 'com.github.jenly1314:zxing-lite:2.2.1'
  94. implementation group: 'cn.hutool', name: 'hutool-core', version: '5.8.20'
  95. implementation 'com.squareup.okhttp3:okhttp:4.9.0'
  96. // implementation files('libs/pgy_analytics_sdk.jar')
  97. implementation 'com.tencent.bugly:crashreport:latest.release' //其中latest.release指代最新Bugly SDK版本号,也可以指定明确的版本号,例如4.0.3
  98. api "com.tencent.vasdolly:helper:3.0.6"
  99. }