build.gradle 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. plugins {
  2. id 'com.android.library'
  3. id 'kotlin-android'
  4. id 'kotlin-kapt'
  5. id 'maven-publish'
  6. id 'signing'
  7. }
  8. android {
  9. compileSdk 31
  10. defaultConfig {
  11. minSdk 17
  12. targetSdk 31
  13. }
  14. buildTypes {
  15. release {
  16. minifyEnabled false
  17. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  18. }
  19. }
  20. compileOptions {
  21. sourceCompatibility JavaVersion.VERSION_1_8
  22. targetCompatibility JavaVersion.VERSION_1_8
  23. }
  24. kotlinOptions {
  25. jvmTarget = '1.8'
  26. }
  27. buildFeatures {
  28. viewBinding true
  29. }
  30. }
  31. dependencies {
  32. compileOnly "androidx.core:core-ktx:1.7.0"
  33. compileOnly "androidx.appcompat:appcompat:1.4.1"
  34. api "io.github.vincent-series:common:1.0.7"
  35. kapt "io.github.vincent-series:annotation-compiler:1.0.3"
  36. }
  37. afterEvaluate {
  38. publishing {
  39. def stagingVersion = "4.0.5"
  40. def snapshotsVersion = "4.0.1-1.0.0-SNAPSHOT"
  41. def uploadVersion = stagingVersion
  42. publications {
  43. maven(MavenPublication) {
  44. from components.release
  45. groupId = 'io.github.vincent-series'
  46. artifactId = 'smart-dialog'
  47. version = uploadVersion
  48. pom {
  49. name = 'smart-dialog'
  50. description = 'robust dialog lib developed by zhiqiang.zhu.'
  51. url = 'https://github.com/vincent-series/smart-show'
  52. licenses {
  53. license {
  54. name = 'The Apache License, Version 2.0'
  55. url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
  56. }
  57. }
  58. developers {
  59. developer {
  60. id = 'zhiqiang.zhu'
  61. name = 'zhiqiang.zhu'
  62. email = 'coder_zzq@aliyun.com'
  63. }
  64. }
  65. scm {
  66. connection = 'scm:git:https://github.com/vincent-series/smart-show.git'
  67. developerConnection = 'scm:git:https://github.com/vincent-series/smart-show.git'
  68. url = 'https://github.com/vincent-series/smart-show'
  69. }
  70. }
  71. artifact generateSourcesJar
  72. }
  73. }
  74. signing {
  75. sign publishing.publications.maven
  76. }
  77. }
  78. }
  79. task generateSourcesJar(type: Jar) {
  80. group = 'jar'
  81. archiveClassifier.set("sources")
  82. from("src/main/java")
  83. }