bintrayconfig.gradle 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. if (!project.rootProject.file('local.properties').exists()) {
  2. println "Not applying install.gradle"
  3. return
  4. }
  5. apply plugin: 'com.novoda.bintray-release'
  6. def getBintrayUserAndKey() {
  7. Properties properties = new Properties()
  8. properties.load(project.rootProject.file('local.properties').newDataInputStream())
  9. return [
  10. properties.getProperty("bintray.user"),
  11. properties.getProperty("bintray.apikey")
  12. ]
  13. }
  14. if (shard == null) {
  15. throw new IllegalStateException("Must specify a shard in module's build.gradle")
  16. } else if (versions == null || versions.publishVersion == null) {
  17. throw new IllegalStateException("Unable to reference publishVersion")
  18. }
  19. task checkBintrayConfig {
  20. doLast {
  21. def (user, key) = getBintrayUserAndKey()
  22. if (user == null || user.isEmpty() ||
  23. key == null || key.isEmpty()) {
  24. throw new IllegalStateException("Must specify Bintray user/API key in your local.properties.")
  25. }
  26. }
  27. }
  28. afterEvaluate {
  29. bintrayUpload.dependsOn checkBintrayConfig
  30. }
  31. def (user, key) = getBintrayUserAndKey()
  32. publish {
  33. bintrayUser = user
  34. bintrayKey = key
  35. userOrg = 'drummer-aidan'
  36. groupId = 'com.afollestad.material-dialogs'
  37. uploadName = "material-dialogs:$shard"
  38. artifactId = shard
  39. publishVersion = versions.publishVersion
  40. desc = 'A beautiful, fluid, and customizable dialogs API.'
  41. website = 'https://github.com/afollestad/material-dialogs'
  42. dryRun = false
  43. }