bintrayconfig.gradle 1.5 KB

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