bintray.gradle 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. group = PROJ_GROUP
  2. version = PROJ_VERSION
  3. project.archivesBaseName = PROJ_ARTIFACTID
  4. def NEXUS_REPOSITORY_URL='http://maven.rongcloud.cn/repository/maven-releases/' //nexus repository url
  5. apply plugin: 'maven'
  6. task sourcesJar(type: Jar) {
  7. from 'jcenter_src'
  8. classifier = 'sources'
  9. }
  10. task javadoc(type: Javadoc) {
  11. failOnError false
  12. source = android.sourceSets.main.java.sourceFiles
  13. classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
  14. classpath += configurations.compile
  15. }
  16. task javadocJar(type: Jar, dependsOn: javadoc) {
  17. classifier = 'javadoc'
  18. from javadoc.destinationDir
  19. }
  20. task syncJavadoc(type: Sync, dependsOn: javadoc) {
  21. from javadoc.destinationDir
  22. into rootProject.file('docs')
  23. }
  24. javadoc {
  25. options {
  26. encoding "UTF-8"
  27. charSet 'UTF-8'
  28. author true
  29. version true
  30. title "$PROJ_NAME $PROJ_VERSION"
  31. String packageListRef = "${android.sdkDirectory}/docs/reference/"
  32. linksOffline 'http://d.android.com/reference/', packageListRef
  33. }
  34. include()
  35. }
  36. artifacts {
  37. archives sourcesJar
  38. archives javadocJar
  39. }
  40. uploadArchives {
  41. repositories {
  42. mavenDeployer {
  43. repository(url: NEXUS_REPOSITORY_URL) {
  44. authentication(userName: BINTRAY_USER, password: BINTRAY_KEY)
  45. }
  46. pom.project {
  47. name PROJ_NAME
  48. version PROJ_VERSION
  49. artifactId PROJ_ARTIFACTID
  50. groupId PROJ_GROUP
  51. packaging 'aar'
  52. // description POM_DESCRIPTION
  53. licenses {
  54. license {
  55. name 'The Apache Software License, Version 2.0'
  56. url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
  57. distribution 'repo'
  58. }
  59. }
  60. }.whenConfigured {
  61. p ->
  62. p.dependencies = p.dependencies.findAll {
  63. dep ->
  64. dep.scope != "test" && dep.version!="unspecified"
  65. }
  66. }
  67. }
  68. }
  69. }