bintrayUpload.gradle 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // 这里添加下面两行代码。
  2. apply plugin: 'com.github.dcendents.android-maven'
  3. apply plugin: 'com.jfrog.bintray'
  4. // 定义两个链接,下面会用到。
  5. def siteUrl = 'http://www.yanyis.space/yanyi/dateselect' // 项目主页。
  6. def gitUrl = 'http://www.yanyis.space/yanyi/dateselect.git' // Git仓库的url。
  7. group = "com.yanyi.benyanyi"// 唯一包名,比如compile 'com.ansen.http:okhttpencapsulation:1.0.1'中的com.ansen.http就是这里配置的。
  8. version = "1.0.1"//项目引用的版本号,比如compile 'com.ansen.http:okhttpencapsulation:1.0.1'中的1.0.1就是这里配置的。
  9. install {
  10. repositories.mavenInstaller {
  11. // This generates POM.xml with proper parameters
  12. pom {
  13. project {
  14. packaging 'aar'
  15. // Add your description here
  16. name 'multi-format 1D/2D barcode image processing use zxing.'
  17. url siteUrl
  18. // Set your license
  19. licenses {
  20. license {
  21. name 'The Apache Software License, Version 2.0'
  22. url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
  23. }
  24. }
  25. developers {
  26. developer {
  27. id 'benyanyi' //填写的一些基本信息
  28. name 'benyanyi'
  29. email 'git@yanyi.red'
  30. }
  31. }
  32. scm {
  33. connection gitUrl
  34. developerConnection gitUrl
  35. url siteUrl
  36. }
  37. }
  38. }
  39. }
  40. }
  41. task sourcesJar(type: Jar) {
  42. from android.sourceSets.main.java.srcDirs
  43. classifier = 'sources'
  44. }
  45. task javadoc(type: Javadoc) {
  46. source = android.sourceSets.main.java.srcDirs
  47. classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
  48. }
  49. task javadocJar(type: Jar, dependsOn: javadoc) {
  50. classifier = 'javadoc'
  51. from javadoc.destinationDir
  52. }
  53. artifacts {
  54. archives javadocJar
  55. archives sourcesJar
  56. }
  57. Properties properties = new Properties()
  58. properties.load(project.rootProject.file('local.properties').newDataInputStream())
  59. bintray {
  60. user = properties.getProperty("bintray.user")
  61. key = properties.getProperty("bintray.apikey")
  62. configurations = ['archives']
  63. pkg {
  64. repo = "DateSelect"
  65. name = "DateSelect" //发布到JCenter上的项目名字
  66. websiteUrl = siteUrl
  67. vcsUrl = gitUrl
  68. licenses = ["Apache-2.0"]
  69. publish = true
  70. }
  71. }
  72. javadoc { //jav doc采用utf-8编码否则会报“GBK的不可映射字符”错误
  73. options {
  74. encoding "UTF-8"
  75. charSet 'UTF-8'
  76. }
  77. }
  78. //gradlew bintrayUpload terminal中输入