build.gradle 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. plugins {
  2. id 'com.android.application'
  3. id 'kotlin-android'
  4. }
  5. def keystorePropertiesFile = rootProject.file("keystore.properties")
  6. def keystoreProperties = new Properties()
  7. keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
  8. android {
  9. compileSdk rootProject.ext.android.compileSdk
  10. buildToolsVersion rootProject.ext.android.buildToolsVersion
  11. defaultConfig {
  12. applicationId "com.yyxx.lab.demo"
  13. minSdk rootProject.ext.android.minSdk
  14. targetSdk rootProject.ext.android.targetSdk
  15. versionCode rootProject.ext.android.versionCode
  16. versionName rootProject.ext.android.versionName
  17. ndk {
  18. // 设置支持的SO库架构
  19. abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
  20. }
  21. }
  22. buildFeatures {
  23. viewBinding true
  24. compose true
  25. buildConfig false
  26. }
  27. signingConfigs {
  28. config {
  29. keyAlias keystoreProperties['keyAlias']
  30. keyPassword keystoreProperties['keyPassword']
  31. storeFile file(keystoreProperties['storeFile'])
  32. storePassword keystoreProperties['storePassword']
  33. }
  34. }
  35. buildTypes {
  36. debug {
  37. minifyEnabled false
  38. signingConfig signingConfigs.config
  39. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  40. }
  41. release {
  42. minifyEnabled false
  43. signingConfig signingConfigs.config
  44. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  45. }
  46. }
  47. compileOptions {
  48. sourceCompatibility JavaVersion.VERSION_1_8
  49. targetCompatibility JavaVersion.VERSION_1_8
  50. }
  51. composeOptions {
  52. kotlinCompilerExtensionVersion compose_version
  53. kotlinCompilerVersion kotlin_version
  54. }
  55. kotlinOptions {
  56. jvmTarget = '1.8'
  57. useIR = true
  58. }
  59. packagingOptions {
  60. resources {
  61. excludes += '/META-INF/{AL2.0,LGPL2.1}'
  62. }
  63. }
  64. }
  65. dependencies {
  66. implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  67. implementation project(':flutter')
  68. // ktx
  69. api rootProject.ext.ktxLibs
  70. // jetpack
  71. api rootProject.ext.jetpackLibs
  72. // ui
  73. api rootProject.ext.uiLibs
  74. implementation "androidx.compose.material:material:$compose_version"
  75. implementation 'androidx.activity:activity-compose:1.4.0'
  76. implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
  77. implementation "androidx.compose.ui:ui:$compose_version"
  78. implementation "androidx.compose.ui:ui-tooling:$compose_version"
  79. implementation "androidx.compose.runtime:runtime:$compose_version"
  80. implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
  81. implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.4.0"
  82. debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
  83. debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
  84. }