bintray-java-v1.gradle 1.7 KB

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