build.gradle 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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="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. 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. brand036I {
  79. dimension "platform"
  80. applicationId "com.develop.foodcooking"
  81. buildConfigField("String", "UpdatePlatform", "\"night\"")
  82. resValue("string", "app_theme", "@style/SplashTheme")
  83. }
  84. brand036ITuya {
  85. dimension "platform"
  86. applicationId "com.develop.foodcooking"
  87. buildConfigField("String", "UpdatePlatform", "\"night\"")
  88. resValue("string", "app_theme", "@style/SplashTheme")
  89. }
  90. brand000A {
  91. dimension "platform"
  92. applicationId "com.develop.foodcooking"
  93. buildConfigField("String", "UpdatePlatform", "\"normal\"")
  94. resValue("string", "app_theme", "@style/SplashTheme")
  95. buildConfigField("String", "UpdatePlatform", "\"036I\"")
  96. resValue("string", "app_theme", "@style/Splash036IDTheme")
  97. }
  98. brand010D {
  99. dimension "platform"
  100. applicationId "com.develop.foodcooking"
  101. buildConfigField("String", "UpdatePlatform", "\"night\"")
  102. resValue("string", "app_theme", "@style/Splash010DTheme")
  103. }
  104. brand030A {
  105. dimension "platform"
  106. applicationId "com.develop.foodcooking"
  107. buildConfigField("String", "UpdatePlatform", "\"036I\"")
  108. resValue("string", "app_theme", "@style/SplashTheme")
  109. resValue("string", "app_theme", "@style/Splash036IDTheme")
  110. buildConfigField("String", "UpdatePlatform", "\"normal\"")
  111. }
  112. }
  113. signingConfigs {
  114. debug {
  115. storeFile file('..\\signature\\rk.jks')
  116. storePassword '123456'
  117. keyAlias 'rk'
  118. keyPassword '123456'
  119. }
  120. foodCooking {
  121. storeFile file("..\\signature\\rk.jks")
  122. storePassword '123456'
  123. keyAlias 'rk'
  124. keyPassword '123456'
  125. }
  126. release {
  127. storeFile file('..\\signature\\rk.jks')
  128. storePassword '123456'
  129. keyAlias 'rk'
  130. keyPassword '123456'
  131. }
  132. }
  133. buildTypes {
  134. release {
  135. minifyEnabled false
  136. productFlavors.brand010D.signingConfig signingConfigs.release
  137. productFlavors.brand000ATuya.signingConfig signingConfigs.release
  138. productFlavors.brand030A.signingConfig signingConfigs.release
  139. productFlavors.brand011ATuya.signingConfig signingConfigs.release
  140. productFlavors.brand036ITuya.signingConfig signingConfigs.release
  141. productFlavors.brand030ATuya.signingConfig signingConfigs.release
  142. productFlavors.brand017ATuya.signingConfig signingConfigs.release
  143. productFlavors.brand036I.signingConfig signingConfigs.release
  144. productFlavors.brand000A.signingConfig signingConfigs.release
  145. productFlavors.brand045ATuya.signingConfig signingConfigs.release
  146. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  147. }
  148. }
  149. compileOptions {
  150. sourceCompatibility JavaVersion.VERSION_1_8
  151. targetCompatibility JavaVersion.VERSION_1_8
  152. }
  153. kotlinOptions {
  154. jvmTarget = '1.8'
  155. }
  156. viewBinding {
  157. enabled = true
  158. }
  159. }
  160. dependencies {
  161. implementation project(path: ':libBase') //基础工具模块,不涉及业务逻辑
  162. implementation project(path: ':BusinessCommon')//业务相关的基础类
  163. implementation project(path: ':BusinessMain') //烹饪主模块
  164. implementation project(path: ':BusinessAuth')//登录-注册-个人信息模块
  165. implementation project(path: ':BusinessSetting') //设置模块
  166. implementation project(path: ':BusinessStep') //烹饪步骤模块
  167. kapt 'com.alibaba:arouter-compiler:1.5.2'
  168. }