build.gradle 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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="045A"
  12. model="1039"
  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. ndk {
  32. abiFilters 'armeabi-v7a'
  33. }
  34. packagingOptions {
  35. pickFirst 'lib/armeabi-v7a/libc++_shared.so'
  36. }
  37. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  38. kapt {
  39. arguments {
  40. arg("AROUTER_MODULE_NAME", project.getName())
  41. arg("room.schemaLocation", "$projectDir/schemas".toString())
  42. }
  43. }
  44. multiDexEnabled true
  45. }
  46. flavorDimensions "platform"
  47. productFlavors {
  48. brand000ATuya {
  49. dimension "platform"
  50. applicationId "com.develop.foodcooking"
  51. buildConfigField("String", "UpdatePlatform", "\"normal\"")
  52. resValue("string", "app_theme", "@style/SplashTheme")
  53. }
  54. brand045ATuya {
  55. dimension "platform"
  56. applicationId "com.develop.foodcooking"
  57. buildConfigField("String", "UpdatePlatform", "\"normal\"")
  58. resValue("string", "app_theme", "@style/SplashTheme")
  59. }
  60. brand011ATuya {
  61. dimension "platform"
  62. applicationId "com.develop.foodcooking"
  63. buildConfigField("String", "UpdatePlatform", "\"normal\"")
  64. resValue("string", "app_theme", "@style/SplashTheme")
  65. }
  66. brand017ATuya {
  67. dimension "platform"
  68. applicationId "com.develop.foodcooking"
  69. buildConfigField("String", "UpdatePlatform", "\"normal\"")
  70. resValue("string", "app_theme", "@style/Splash017Theme")
  71. }
  72. brand030ATuya {
  73. dimension "platform"
  74. applicationId "com.develop.foodcooking"
  75. buildConfigField("String", "UpdatePlatform", "\"normal\"")
  76. resValue("string", "app_theme", "@style/SplashTheme")
  77. }
  78. brand029CTuya {
  79. dimension "platform"
  80. applicationId "com.develop.foodcooking"
  81. buildConfigField("String", "UpdatePlatform", "\"normal\"")
  82. resValue("string", "app_theme", "@style/Splash029CTheme")
  83. }
  84. brand036I {
  85. dimension "platform"
  86. applicationId "com.develop.foodcooking"
  87. buildConfigField("String", "UpdatePlatform", "\"night\"")
  88. resValue("string", "app_theme", "@style/SplashTheme")
  89. }
  90. brand036ITuya {
  91. dimension "platform"
  92. applicationId "com.develop.foodcooking"
  93. buildConfigField("String", "UpdatePlatform", "\"night\"")
  94. resValue("string", "app_theme", "@style/SplashTheme")
  95. }
  96. brand000A {
  97. dimension "platform"
  98. applicationId "com.develop.foodcooking"
  99. buildConfigField("String", "UpdatePlatform", "\"normal\"")
  100. resValue("string", "app_theme", "@style/SplashTheme")
  101. buildConfigField("String", "UpdatePlatform", "\"036I\"")
  102. resValue("string", "app_theme", "@style/Splash036IDTheme")
  103. }
  104. brand010D {
  105. dimension "platform"
  106. applicationId "com.develop.foodcooking"
  107. buildConfigField("String", "UpdatePlatform", "\"night\"")
  108. resValue("string", "app_theme", "@style/Splash010DTheme")
  109. }
  110. brand030A {
  111. dimension "platform"
  112. applicationId "com.develop.foodcooking"
  113. buildConfigField("String", "UpdatePlatform", "\"036I\"")
  114. resValue("string", "app_theme", "@style/SplashTheme")
  115. resValue("string", "app_theme", "@style/Splash036IDTheme")
  116. buildConfigField("String", "UpdatePlatform", "\"normal\"")
  117. }
  118. }
  119. signingConfigs {
  120. debug {
  121. storeFile file('..\\signature\\rk.jks')
  122. storePassword '123456'
  123. keyAlias 'rk'
  124. keyPassword '123456'
  125. }
  126. foodCooking {
  127. storeFile file("..\\signature\\rk.jks")
  128. storePassword '123456'
  129. keyAlias 'rk'
  130. keyPassword '123456'
  131. }
  132. release {
  133. storeFile file('..\\signature\\rk.jks')
  134. storePassword '123456'
  135. keyAlias 'rk'
  136. keyPassword '123456'
  137. }
  138. }
  139. buildTypes {
  140. release {
  141. minifyEnabled false
  142. productFlavors.brand010D.signingConfig signingConfigs.release
  143. productFlavors.brand029CTuya.signingConfig signingConfigs.release
  144. productFlavors.brand000ATuya.signingConfig signingConfigs.release
  145. productFlavors.brand030A.signingConfig signingConfigs.release
  146. productFlavors.brand011ATuya.signingConfig signingConfigs.release
  147. productFlavors.brand036ITuya.signingConfig signingConfigs.release
  148. productFlavors.brand030ATuya.signingConfig signingConfigs.release
  149. productFlavors.brand017ATuya.signingConfig signingConfigs.release
  150. productFlavors.brand036I.signingConfig signingConfigs.release
  151. productFlavors.brand000A.signingConfig signingConfigs.release
  152. productFlavors.brand045ATuya.signingConfig signingConfigs.release
  153. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  154. }
  155. }
  156. compileOptions {
  157. sourceCompatibility JavaVersion.VERSION_1_8
  158. targetCompatibility JavaVersion.VERSION_1_8
  159. }
  160. kotlinOptions {
  161. jvmTarget = '1.8'
  162. }
  163. viewBinding {
  164. enabled = true
  165. }
  166. }
  167. dependencies {
  168. implementation project(path: ':libBase') //基础工具模块,不涉及业务逻辑
  169. implementation project(path: ':BusinessCommon')//业务相关的基础类
  170. implementation project(path: ':BusinessMain') //烹饪主模块
  171. implementation project(path: ':BusinessAuth')//登录-注册-个人信息模块
  172. implementation project(path: ':BusinessSetting') //设置模块
  173. implementation project(path: ':BusinessStep') //烹饪步骤模块
  174. kapt 'com.alibaba:arouter-compiler:1.5.2'
  175. }