build.gradle 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. apply plugin: 'com.android.library'
  2. apply plugin: 'maven-publish'
  3. // https://github.com/sky-uk/gradle-maven-plugin
  4. //apply from: "https://gitee.com/woyiqiankun/gradle-maven-plugin/raw/master/gradle-mavenizer.gradle"
  5. android {
  6. compileSdkVersion 32
  7. buildToolsVersion "32.0.0"
  8. defaultConfig {
  9. minSdkVersion 19
  10. targetSdkVersion 32
  11. versionCode 122025
  12. versionName "1.2202.5"
  13. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  14. consumerProguardFiles 'consumer-rules.pro'
  15. }
  16. buildTypes {
  17. release {
  18. minifyEnabled true
  19. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  20. }
  21. }
  22. compileOptions {
  23. sourceCompatibility JavaVersion.VERSION_1_8
  24. targetCompatibility JavaVersion.VERSION_1_8
  25. }
  26. }
  27. tasks.withType(JavaCompile) {
  28. options.encoding = 'UTF-8'
  29. }
  30. task androidJavadocs(type: Javadoc) {
  31. failOnError false
  32. title = "hgsoftloglibrary ${project.version} API"
  33. description "Generates Javadoc"
  34. source = android.sourceSets.main.java.srcDirs
  35. classpath += files(android.bootClasspath)
  36. android.libraryVariants.all { variant ->
  37. if (variant.name == 'release') {
  38. owner.classpath += variant.javaCompileProvider.get().classpath
  39. }
  40. }
  41. exclude '**/R.html', '**/R.*.html', '**/index.html', '**/*.kt'
  42. options {
  43. windowTitle("hgsoftloglibrary ${project.version} Reference")
  44. locale = 'zh_CN'
  45. encoding = 'UTF-8'
  46. charSet = 'UTF-8'
  47. links("http://docs.oracle.com/javase/8/docs/api/")
  48. linksOffline("http://d.android.com/reference", "${android.sdkDirectory}/docs/reference")
  49. setMemberLevel(JavadocMemberLevel.PUBLIC)
  50. }
  51. }
  52. task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
  53. archiveClassifier.convention('javadoc')
  54. archiveClassifier.set('javadoc')
  55. from androidJavadocs.destinationDir
  56. }
  57. task androidSourcesJar(type: Jar) {
  58. archiveClassifier.convention('sources')
  59. archiveClassifier.set('sources')
  60. from android.sourceSets.main.java.srcDirs
  61. }
  62. afterEvaluate {
  63. publishing {
  64. publications {
  65. // Creates a Maven publication called "release".
  66. mavenPublish(MavenPublication) {
  67. // Applies the component for the release build variant.
  68. from components.release
  69. artifact androidSourcesJar
  70. artifact androidJavadocsJar
  71. // You can then customize attributes of the publication as shown below.
  72. groupId = 'com.hgsoft.app'
  73. artifactId = 'loglibrary'
  74. version = '1.2202.5'
  75. }
  76. }
  77. repositories {
  78. maven {
  79. credentials {
  80. username 'yinxueqin'
  81. password 'hgits1024'
  82. }
  83. url = 'https://nexus.hgits.cn/nexus/repository/hgsoft/'
  84. }
  85. }
  86. repositories {
  87. maven {
  88. credentials {
  89. username '60de898e6da2f73831c32a9d'
  90. password 'G-O=rDpLTK7B'
  91. }
  92. url = 'https://packages.aliyun.com/maven/repository/2117453-release-bMZITa/'
  93. }
  94. }
  95. }
  96. }
  97. //project.ext {
  98. // // 填你的名字
  99. // mavDevelopers = ["Ch":"yinxueqin"]
  100. // // 项目的网址,没有就填svn地址
  101. // mavSiteUrl = "http://svn.hgits.cn:81/svn/研发资料/创新研究院/研发中心/端组APP/03.公共模块/01 Android和IOS日志模块/代码参考/loglibrary"
  102. // // 填svn或者git地址
  103. // mavGitUrl = "http://svn.hgits.cn:81/svn/研发资料/创新研究院/研发中心/端组APP/03.公共模块/01 Android和IOS日志模块/代码参考/loglibrary"
  104. // // 填项目名称
  105. // mavProjectName = 'hgsoftloglibrary'
  106. // // 填GroupId,相对唯一
  107. // mavProjectGroup = "hgits.cn"
  108. // // 填ArtifactId,相对唯一
  109. // mavProjectArtifact = "hgsoftloglibrary"
  110. // // 包的版本号
  111. // mavProjectVersion = "1.2100.1"
  112. // // 填true
  113. // mavPublishToRemoteRepo = true
  114. // // 填用户名
  115. // mavRemoteRepoUser = "admin"
  116. // // 填对应的用户密码
  117. // mavRemoteRepoPassword = "nexus_hgits"
  118. // // 固定此地址
  119. // mavRepoRemoteUrl = "http://218.107.19.106:19999/repository/apphgits/"
  120. //}
  121. dependencies {
  122. implementation fileTree(dir: 'libs', include: ['*.jar'])
  123. compileOnly 'androidx.appcompat:appcompat:1.4.2'
  124. api 'com.tencent.mars:mars-xlog:1.2.6'
  125. api 'net.lingala.zip4j:zip4j:2.1.3'
  126. testImplementation 'junit:junit:4.13.2'
  127. androidTestImplementation 'androidx.test.ext:junit:1.1.3'
  128. androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
  129. }