build.gradle 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. /*
  2. * ********************************************************************************************************************
  3. *
  4. * iFHS7.
  5. * ;BBMBMBMc rZMBMBR BMB
  6. * MBEr:;PBM, 7MBMMEOBB: BBB RBW
  7. * XK: BO SB. :SZ MBM. c;; ir BBM :FFr :SSF: ;xBMB:r iuGXv. i:. iF2;
  8. * DBBM0r. :D S7 ;XMBMB GMBMu. MBM: BMB MBMBBBMBMS WMBMBMBBK MBMBMBM BMBRBMBW .MBMBMBMBB
  9. * :JMRMMD .. , 1MMRM1; ;MBMBBR: MBM ;MB: BMB: MBM. RMBr sBMH BM0 UMB, BMB. KMBv
  10. * ;. XOW B1; :uM: 1RE, i .2BMBs rMB. MBO MBO JMB; MBB MBM BBS 7MBMBOBM: MBW :BMc
  11. * OBRJ.SEE MRDOWOR, 3DE:7OBM . ;BMB RMR7BM BMB MBB. BMB ,BMR .BBZ MMB rMB, BMM rMB7
  12. * :FBRO0D0 RKXSXPR. JOKOOMPi BMBSSWBMB; BMBB: MBMB0ZMBMS .BMBOXRBMB MBMDE RBM2;SMBM; MBB xBM2
  13. * iZGE O0SHSPO. uGZ7. sBMBMBDL :BMO OZu:BMBK, rRBMB0; ,EBMB xBMBr:ER. RDU :OO;
  14. * ,BZ, 1D0 RPSFHXR. xWZ .SMr . .BBB
  15. * :0BMRDG RESSSKR. 2WOMBW; BMBMR
  16. * i0BM: SWKHKGO MBDv
  17. * .UB OOGDM. MK, Copyright (c) 2015-2019. 斯伯坦机器人
  18. * , XMW ..
  19. * r All rights reserved.
  20. *
  21. * ********************************************************************************************************************
  22. */
  23. group rootProject.group
  24. version rootProject.version
  25. apply plugin: 'com.android.library'
  26. apply plugin: 'kotlin-android'
  27. apply plugin: 'kotlin-android-extensions'
  28. apply plugin: 'org.jetbrains.dokka-android'
  29. apply plugin: 'maven'
  30. android {
  31. compileSdkVersion ANDROID_SDK_VERSION.toInteger()
  32. buildToolsVersion ANDROID_BUILD_TOOLS_VERSION
  33. defaultConfig {
  34. minSdkVersion ANDROID_MIN_SDK_VERSION.toInteger()
  35. targetSdkVersion ANDROID_SDK_VERSION.toInteger()
  36. versionCode SAGA_CODE.toInteger()
  37. versionName SAGA_ANDROID_VERSION
  38. testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
  39. }
  40. buildTypes {
  41. release {
  42. proguardFile 'proguard-rules.pro'
  43. }
  44. }
  45. // 解决lint语法检查错误(kotlin语法无法通过lint)
  46. lintOptions {
  47. abortOnError false
  48. }
  49. kotlinOptions {
  50. jvmTarget = JVM_TARGET
  51. }
  52. }
  53. dependencies {
  54. implementation fileTree(dir: 'libs', include: ['*.jar'])
  55. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  56. // kotlin 依赖
  57. // https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib-jdk8
  58. implementation group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: KOTLIN_VERSION
  59. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  60. // android支持
  61. implementation group: 'com.android.support', name: 'appcompat-v7', version: ANDROID_SUPPORT_VERSION
  62. implementation group: 'com.android.support', name: 'design', version: ANDROID_SUPPORT_VERSION
  63. // implementation group: 'com.android.support', name: 'support-v4', version: ANDROID_SUPPORT_VERSION
  64. implementation group: 'com.android.support.constraint', name: 'constraint-layout', version: CONSTRAINT_VERSION
  65. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  66. // anko依赖
  67. // https://mvnrepository.com/artifact/org.jetbrains.anko/anko-common
  68. implementation group: 'org.jetbrains.anko', name: 'anko-commons', version: ANKO_VERSION
  69. // https://mvnrepository.com/artifact/org.jetbrains.anko/anko-sdk25
  70. implementation group: 'org.jetbrains.anko', name: 'anko-sdk25', version: ANKO_VERSION
  71. // https://mvnrepository.com/artifact/org.jetbrains.anko/anko-design
  72. implementation group: 'org.jetbrains.anko', name: 'anko-design', version: ANKO_VERSION
  73. // https://mvnrepository.com/artifact/org.jetbrains.anko/anko-appcompat-v7
  74. implementation group: 'org.jetbrains.anko', name: 'anko-appcompat-v7', version: ANKO_VERSION
  75. // https://mvnrepository.com/artifact/org.jetbrains.anko/anko-support-v4
  76. implementation group: 'org.jetbrains.anko', name: 'anko-support-v4', version: ANKO_VERSION
  77. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  78. // 二维码与条形码
  79. // https://mvnrepository.com/artifact/com.google.zxing/core
  80. implementation group: 'com.google.zxing', name: 'core', version: ZXING_VERSION
  81. // https://mvnrepository.com/artifact/com.google.zxing/android-core
  82. implementation 'com.android.support.constraint:constraint-layout:1.1.3'
  83. implementation group: 'com.google.zxing', name: 'android-core', version: ZXING_VERSION
  84. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  85. // SAGA依赖
  86. implementation group: 'cn.sagacloud', name: 'saga-kotlin-base', version: SAGA_KOTLIN_VERSION
  87. implementation project(':sybotan-android-base')
  88. implementation project(':sybotan-android-views')
  89. }
  90. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  91. // 文档生成
  92. // 源码
  93. task sourcesJar(type: Jar) {
  94. group = 'jar'
  95. from "${android.sourceSets.main.java.srcDirs}"
  96. classifier = 'sources'
  97. }
  98. // 文档
  99. task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask) {
  100. jdkVersion = JDK_VERSION.toInteger()
  101. noStdlibLink = true
  102. outputFormat = 'javadoc'
  103. outputDirectory = "$buildDir/javadoc"
  104. // sourceDirs = files('src/main/java')
  105. }
  106. // 上成上传的文档jar包
  107. task javadocJar(type: Jar, dependsOn: dokkaJavadoc) {
  108. group = 'jar'
  109. classifier = 'javadoc'
  110. from "${dokka.outputDirectory}"
  111. }
  112. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  113. // maven 仓库管理
  114. // 设置上传的包,默认上传aar与pom
  115. artifacts {
  116. // 上传源码包
  117. // archives sourcesJar
  118. // 上传文档包
  119. // archives javadocJar
  120. }
  121. uploadArchives {
  122. repositories {
  123. mavenDeployer {
  124. pom.groupId = project.group
  125. pom.version = project.version
  126. pom.artifactId = project.name
  127. pom.project {
  128. name project.name
  129. packaging 'jar'
  130. url SAGA_URL
  131. description '斯伯坦机器人世界 android works组件库。'
  132. licenses {
  133. license {
  134. name 'The Apache Software License, Version 2.0'
  135. url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
  136. }
  137. }
  138. developers {
  139. developer {
  140. id DEVELOPER_ID
  141. name DEVELOPER_NAME
  142. }
  143. }
  144. }
  145. snapshotRepository(url: MAVEN_REPO_SNAPSHOT_URL) {
  146. authentication(userName: NEXUS_USERNAME, password: NEXUS_PASSWORD)
  147. }
  148. repository(url: MAVEN_REPO_RELEASE_URL) {
  149. authentication(userName: NEXUS_USERNAME, password: NEXUS_PASSWORD)
  150. }
  151. }
  152. }
  153. }