build.gradle 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. apply plugin: 'com.android.library'
  2. apply plugin: 'kotlin-android-extensions'
  3. apply plugin: 'kotlin-kapt'
  4. apply plugin: 'org.jetbrains.kotlin.android'
  5. kapt {
  6. arguments {
  7. arg("AROUTER_MODULE_NAME", project.getName())
  8. // 是否生成路由文档,"enable":生成文档,其他字符串不生成路由文档
  9. arg("AROUTER_GENERATE_DOC", "enable")
  10. }
  11. }
  12. android {
  13. compileSdkVersion 31
  14. defaultConfig {
  15. minSdkVersion 21
  16. targetSdkVersion 31
  17. versionCode 1
  18. versionName "1.0"
  19. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  20. // kapt {
  21. // arguments {
  22. // //根据模块名来命名路由根节点
  23. // arg("AROUTER_MODULE_NAME", project.getName())
  24. // //生成Json文件
  25. // arg("AROUTER_GENERATE_DOC", "enable")
  26. // }
  27. // }
  28. }
  29. buildTypes {
  30. release {
  31. minifyEnabled false
  32. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  33. }
  34. }
  35. compileOptions {
  36. sourceCompatibility JavaVersion.VERSION_1_8
  37. targetCompatibility JavaVersion.VERSION_1_8
  38. }
  39. kotlinOptions {
  40. jvmTarget = '1.8'
  41. }
  42. packagingOptions {
  43. resources.excludes.add("META-INF/*")
  44. }
  45. buildFeatures{
  46. viewBinding = true
  47. }
  48. }
  49. dependencies {
  50. implementation 'androidx.appcompat:appcompat:1.3.0'
  51. implementation 'com.google.android.material:material:1.4.0'
  52. implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
  53. testImplementation 'junit:junit:4.13.2'
  54. androidTestImplementation 'androidx.test.ext:junit:1.1.3'
  55. implementation project(':BaseLibrary')
  56. //ARouter
  57. kapt "com.alibaba:arouter-compiler:$rootProject.ext.android.arouter_api_version"
  58. }