build.gradle 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. import java.text.SimpleDateFormat
  2. plugins {
  3. id 'com.android.application'
  4. id 'org.jetbrains.kotlin.android'
  5. id 'kotlin-kapt'
  6. id 'kotlinx-serialization'
  7. }
  8. ext{
  9. versionCode=Integer.parseInt(new SimpleDateFormat("yyMMddHH").format(new Date()) + 1)
  10. // versionCode=230617180
  11. brandCode="000A"
  12. model="5037"
  13. }
  14. android {
  15. compileSdk 31
  16. lintOptions {
  17. checkReleaseBuilds false
  18. }
  19. defaultConfig {
  20. applicationId "com.develop.foodcooking"
  21. minSdk 21
  22. targetSdk 30
  23. versionCode project.ext.versionCode
  24. versionName "${project.ext.model}.${project.ext.brandCode}.${project.ext.versionCode}"
  25. archivesBaseName = "cofar-cooking_${versionName}"
  26. javaCompileOptions {
  27. annotationProcessorOptions {
  28. arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
  29. }
  30. }
  31. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  32. kapt {
  33. arguments {
  34. arg("AROUTER_MODULE_NAME", project.getName())
  35. arg("room.schemaLocation", "$projectDir/schemas".toString())
  36. }
  37. }
  38. multiDexEnabled true
  39. }
  40. flavorDimensions "platform"
  41. productFlavors {
  42. brand010D {
  43. dimension "platform"
  44. applicationId "com.develop.foodcooking"
  45. buildConfigField("String", "UpdatePlatform", "\"night\"")
  46. resValue("string", "app_theme", "@style/SplashTheme")
  47. }
  48. brand000A {
  49. dimension "platform"
  50. applicationId "com.develop.foodcooking"
  51. buildConfigField("String", "UpdatePlatform", "\"normal\"")
  52. resValue("string", "app_theme", "@style/SplashTheme")
  53. }
  54. brand030A {
  55. dimension "platform"
  56. applicationId "com.develop.foodcooking"
  57. buildConfigField("String", "UpdatePlatform", "\"normal\"")
  58. resValue("string", "app_theme", "@style/SplashTheme")
  59. }
  60. brand036I {
  61. dimension "platform"
  62. applicationId "com.develop.foodcooking"
  63. buildConfigField("String", "UpdatePlatform", "\"036I\"")
  64. resValue("string", "app_theme", "@style/SplashTheme")
  65. }
  66. }
  67. signingConfigs {
  68. debug {
  69. storeFile file('..\\signature\\rk.jks')
  70. storePassword '123456'
  71. keyAlias 'rk'
  72. keyPassword '123456'
  73. }
  74. foodCooking {
  75. storeFile file("..\\signature\\rk.jks")
  76. storePassword '123456'
  77. keyAlias 'rk'
  78. keyPassword '123456'
  79. }
  80. release {
  81. storeFile file('..\\signature\\rk.jks')
  82. storePassword '123456'
  83. keyAlias 'rk'
  84. keyPassword '123456'
  85. }
  86. }
  87. buildTypes {
  88. release {
  89. minifyEnabled false
  90. productFlavors.brand010D.signingConfig signingConfigs.release
  91. productFlavors.brand030A.signingConfig signingConfigs.release
  92. productFlavors.brand036I.signingConfig signingConfigs.release
  93. productFlavors.brand000A.signingConfig signingConfigs.release
  94. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  95. }
  96. }
  97. compileOptions {
  98. sourceCompatibility JavaVersion.VERSION_1_8
  99. targetCompatibility JavaVersion.VERSION_1_8
  100. }
  101. kotlinOptions {
  102. jvmTarget = '1.8'
  103. }
  104. viewBinding {
  105. enabled = true
  106. }
  107. }
  108. dependencies {
  109. implementation project(path: ':libBase') //基础工具模块,不涉及业务逻辑
  110. implementation project(path: ':BusinessCommon')//业务相关的基础类
  111. implementation project(path: ':BusinessMain') //烹饪主模块
  112. implementation project(path: ':BusinessAuth')//登录-注册-个人信息模块
  113. implementation project(path: ':BusinessSetting') //设置模块
  114. implementation project(path: ':BusinessStep') //烹饪步骤模块
  115. kapt 'com.alibaba:arouter-compiler:1.5.2'
  116. }