build.gradle 3.8 KB

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