build.gradle 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 30
  14. defaultConfig {
  15. minSdkVersion 21
  16. targetSdkVersion 30
  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. debug{
  35. minifyEnabled false
  36. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  37. }
  38. preRelease{
  39. minifyEnabled false
  40. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  41. }
  42. }
  43. compileOptions {
  44. sourceCompatibility JavaVersion.VERSION_1_8
  45. targetCompatibility JavaVersion.VERSION_1_8
  46. }
  47. kotlinOptions {
  48. jvmTarget = '1.8'
  49. }
  50. packagingOptions {
  51. resources.excludes.add("META-INF/*")
  52. }
  53. buildFeatures{
  54. viewBinding = true
  55. }
  56. }
  57. dependencies {
  58. implementation 'androidx.appcompat:appcompat:1.3.0'
  59. implementation 'com.google.android.material:material:1.4.0'
  60. implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
  61. testImplementation 'junit:junit:4.13.2'
  62. androidTestImplementation 'androidx.test.ext:junit:1.1.3'
  63. implementation project(':BaseLibrary')
  64. //ARouter
  65. kapt "com.alibaba:arouter-compiler:$rootProject.ext.android.arouter_api_version"
  66. }