android_bintray_config.gradle 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. if (!project.rootProject.file('local.properties').exists()) {
  2. logger.warn("local.properties not found. Skipping Bintray Release setup.")
  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 (versions == null || versions.publish_version == null) {
  15. throw new IllegalStateException("Unable to reference publish_version!")
  16. } else if (module_group == null || module_name == null) {
  17. throw new IllegalStateException("Must provide module_group and module_name!")
  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 = module_group
  37. uploadName = "material-dialogs:$module_name"
  38. artifactId = module_name
  39. publishVersion = versions.publish_version
  40. desc = "A beautiful, fluid, and customizable dialogs API."
  41. website = "https://github.com/afollestad/material-dialogs"
  42. dryRun = false
  43. }