publish.gradle 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. apply plugin: 'com.android.library'
  2. apply plugin: 'com.github.dcendents.android-maven'
  3. apply plugin: 'com.jfrog.bintray'
  4. def prjVersion = "1.0.4"
  5. def prjGroup = "com.vincent.filepicker"
  6. def prjName = "MultiTypeFilePicker"
  7. def prjArtifactId = "MultiTypeFilePicker"
  8. def prjDescription = "A light Android file picker library"
  9. def siteUrl = 'https://github.com/fishwjy/MultiType-FilePicker' // 项目的主页
  10. def gitUrl = 'https://github.com/fishwjy/MultiType-FilePicker.git' // Git仓库的url
  11. def pckName = "MultiTypeFilePicker" //发布到JCenter上的项目名字
  12. def bintrayRepo = "maven"
  13. version = prjVersion
  14. group = prjGroup
  15. project.archivesBaseName=prjArtifactId
  16. install {
  17. repositories.mavenInstaller {
  18. // This generates POM.xml with proper parameters
  19. pom.project {
  20. packaging 'aar'
  21. // Add your description here
  22. name prjName
  23. version prjVersion
  24. groupId prjGroup
  25. description prjDescription
  26. url siteUrl
  27. artifactId prjArtifactId
  28. // Set your license
  29. licenses {
  30. license {
  31. name 'The Apache Software License, Version 2.0'
  32. url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
  33. }
  34. }
  35. developers {
  36. developer {
  37. id 'vincentwoo'
  38. name 'VincentWoo'
  39. email 'fishwjy@gmail.com'
  40. }
  41. }
  42. scm {
  43. connection gitUrl
  44. developerConnection gitUrl
  45. url siteUrl
  46. }
  47. }
  48. }
  49. }
  50. task sourcesJar(type: Jar) {
  51. from android.sourceSets.main.java.srcDirs
  52. classifier = 'sources'
  53. }
  54. task javadoc(type: Javadoc) {
  55. options.encoding = "UTF-8"
  56. source = android.sourceSets.main.java.srcDirs
  57. classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
  58. }
  59. tasks.withType(JavaCompile) {
  60. options.encoding = "UTF-8"
  61. }
  62. task javadocJar(type: Jar, dependsOn: javadoc) {
  63. classifier = 'javadoc'
  64. from javadoc.destinationDir
  65. }
  66. artifacts {
  67. archives javadocJar
  68. archives sourcesJar
  69. }
  70. Properties properties = new Properties()
  71. properties.load(project.rootProject.file('local.properties').newDataInputStream())
  72. bintray {
  73. user = properties.getProperty("bintray.user")
  74. key = properties.getProperty("bintray.apikey")
  75. configurations = ['archives']
  76. publish = true
  77. dryRun = false
  78. pkg {
  79. repo = bintrayRepo
  80. name = pckName
  81. websiteUrl = siteUrl
  82. vcsUrl = gitUrl
  83. licenses = ["Apache-2.0"]
  84. publicDownloadNumbers = true
  85. version {
  86. name = prjVersion
  87. desc = prjDescription
  88. vcsTag = prjVersion
  89. gpg {
  90. sign = true
  91. }
  92. }
  93. }
  94. }