build.gradle 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. apply plugin: 'com.android.library'
  2. apply plugin: 'maven-publish'
  3. apply plugin: 'kotlin-android'
  4. apply plugin: 'kotlin-kapt'
  5. // https://github.com/sky-uk/gradle-maven-plugin
  6. //apply from: "https://gitee.com/woyiqiankun/gradle-maven-plugin/raw/master/gradle-mavenizer.gradle"
  7. android {
  8. compileSdkVersion 32
  9. buildToolsVersion "32.0.0"
  10. defaultConfig {
  11. minSdkVersion 19
  12. targetSdkVersion 32
  13. versionCode 122013
  14. versionName "1.2201.3"
  15. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  16. consumerProguardFiles 'consumer-rules.pro'
  17. }
  18. buildTypes {
  19. release {
  20. minifyEnabled true
  21. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  22. }
  23. }
  24. compileOptions {
  25. sourceCompatibility JavaVersion.VERSION_1_8
  26. targetCompatibility JavaVersion.VERSION_1_8
  27. }
  28. }
  29. tasks.withType(JavaCompile) {
  30. options.encoding = 'UTF-8'
  31. }
  32. task androidJavadocs(type: Javadoc) {
  33. failOnError false
  34. title = "hgsoftloglibrarytwo ${project.version} API"
  35. description "Generates Javadoc"
  36. source = android.sourceSets.main.java.srcDirs
  37. classpath += files(android.bootClasspath)
  38. android.libraryVariants.all { variant ->
  39. if (variant.name == 'release') {
  40. owner.classpath += variant.javaCompileProvider.get().classpath
  41. }
  42. }
  43. exclude '**/R.html', '**/R.*.html', '**/index.html', '**/*.kt'
  44. options {
  45. windowTitle("hgsoftloglibrarytwo ${project.version} Reference")
  46. locale = 'zh_CN'
  47. encoding = 'UTF-8'
  48. charSet = 'UTF-8'
  49. links("http://docs.oracle.com/javase/8/docs/api/")
  50. linksOffline("http://d.android.com/reference", "${android.sdkDirectory}/docs/reference")
  51. setMemberLevel(JavadocMemberLevel.PUBLIC)
  52. }
  53. }
  54. task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
  55. archiveClassifier.convention('javadoc')
  56. archiveClassifier.set('javadoc')
  57. from androidJavadocs.destinationDir
  58. }
  59. task androidSourcesJar(type: Jar) {
  60. archiveClassifier.convention('sources')
  61. archiveClassifier.set('sources')
  62. from android.sourceSets.main.java.srcDirs
  63. }
  64. afterEvaluate {
  65. publishing {
  66. publications {
  67. // Creates a Maven publication called "release".
  68. mavenPublish(MavenPublication) {
  69. // Applies the component for the release build variant.
  70. from components.release
  71. artifact androidSourcesJar
  72. artifact androidJavadocsJar
  73. // You can then customize attributes of the publication as shown below.
  74. groupId = 'com.hgsoft.app'
  75. artifactId = 'loglibrarytwo'
  76. version = '1.2201.6'
  77. }
  78. }
  79. repositories {
  80. maven {
  81. credentials {
  82. username 'yinxueqin'
  83. password 'hgits1024'
  84. }
  85. url = 'https://nexus.hgits.cn/nexus/repository/hgsoft/'
  86. }
  87. }
  88. repositories {
  89. maven {
  90. credentials {
  91. username '60de898e6da2f73831c32a9d'
  92. password 'G-O=rDpLTK7B'
  93. }
  94. url = 'https://packages.aliyun.com/maven/repository/2117453-release-bMZITa/'
  95. }
  96. }
  97. }
  98. }
  99. dependencies {
  100. implementation fileTree(dir: 'libs', include: ['*.jar'])
  101. compileOnly 'androidx.appcompat:appcompat:1.4.2'
  102. api 'com.github.fengzhizi715.SAF-Kotlin-log:core:2.6.8'
  103. api 'com.github.fengzhizi715.SAF-Kotlin-log:file:2.6.8'
  104. api 'com.github.fengzhizi715.SAF-Kotlin-log:extension:2.6.8'
  105. api 'com.github.fengzhizi715.SAF-Kotlin-log:gson:2.6.8'
  106. api 'net.lingala.zip4j:zip4j:2.1.3'
  107. testImplementation 'junit:junit:4.13.2'
  108. androidTestImplementation 'androidx.test.ext:junit:1.1.3'
  109. androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
  110. }