bintray-android-v1.gradle 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. apply plugin: 'com.jfrog.bintray'
  2. version = libraryVersion
  3. task sourcesJar(type: Jar) {
  4. from android.sourceSets.main.java.srcDirs
  5. classifier = 'sources'
  6. }
  7. task javadoc(type: Javadoc) {
  8. excludes = ['**/*.kt'] // < ---- Exclude all kotlin files from javadoc file.
  9. source = android.sourceSets.main.java.srcDirs
  10. classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
  11. }
  12. task javadocJar(type: Jar, dependsOn: javadoc) {
  13. classifier = 'javadoc'
  14. from javadoc.destinationDir
  15. }
  16. artifacts {
  17. archives javadocJar
  18. archives sourcesJar
  19. }
  20. def _user = System.getenv("BINTRAY_USER")
  21. def _key = System.getenv("BINTRAY_API_KEY")
  22. def _passphrase = System.getenv("BINTRAY_PASSPHRASE")
  23. if(project.rootProject.file('local.properties').exists()){
  24. Properties properties = new Properties()
  25. properties.load(project.rootProject.file('local.properties').newDataInputStream())
  26. def local_user = properties.getProperty("bintray.user");
  27. if(local_user != null) _user = local_user;
  28. def local_key = properties.getProperty("bintray.apikey");
  29. if(local_key != null) _key = local_key;
  30. def local_passphrase = properties.getProperty("bintray.gpg.password");
  31. if(local_passphrase != null) _passphrase = local_passphrase;
  32. }
  33. // Bintray
  34. bintray {
  35. user = _user
  36. key = _key
  37. override = true
  38. configurations = ['archives']
  39. pkg {
  40. repo = bintrayRepo
  41. name = bintrayName
  42. desc = libraryDescription
  43. userOrg = orgName
  44. websiteUrl = siteUrl
  45. vcsUrl = gitUrl
  46. licenses = allLicenses
  47. publish = true
  48. publicDownloadNumbers = true
  49. version {
  50. desc = libraryDescription
  51. gpg {
  52. sign = true //Determines whether to GPG sign the files. The default is false
  53. passphrase = _passphrase
  54. //Optional. The passphrase for GPG signing'
  55. }
  56. }
  57. }
  58. }