build.gradle 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. description = 'Moquette - distribution'
  2. apply plugin: 'application'
  3. // adds task shadowJar - Create a combined JAR of project and runtime dependencies
  4. apply plugin: 'com.github.johnrengelman.shadow'
  5. mainClassName = "io.moquette.server.Server"
  6. dependencies {
  7. compile project(':moquette-broker')
  8. compile project(':moquette-h2-storage')
  9. compile project(':moquette-mapdb-storage')
  10. }
  11. def packageSet = project.copySpec {
  12. from 'src/main/resources/README.txt'
  13. into ('bin'){
  14. from 'src/main/scripts/'
  15. fileMode=0755
  16. }
  17. into ('lib'){
  18. from "build/libs/${project.name}-${version}.jar"
  19. rename { "moquette-${version}.jar" }
  20. }
  21. into ('lib'){
  22. from configurations.compile
  23. }
  24. into ('config'){
  25. from 'src/main/resources/moquette.conf'
  26. from 'src/main/resources/password_file.conf'
  27. from 'src/main/resources/hazelcast.xml'
  28. // from 'src/main/resources/acl.conf'
  29. }
  30. into ('config'){
  31. from 'src/main/resources/log4j.properties'
  32. rename { 'moquette-log.properties' }
  33. }
  34. }
  35. task distMoquetteTar(type: Tar) {
  36. archiveName = "moquette-${version}.tar"
  37. destinationDir file('build')
  38. extension 'tar'
  39. compression = Compression.GZIP
  40. with packageSet
  41. }
  42. distMoquetteTar.dependsOn jar
  43. task distMoquetteZip(type: Zip) {
  44. archiveName = "moquette-${version}.zip"
  45. destinationDir file('build')
  46. with packageSet
  47. }
  48. distMoquetteZip.dependsOn jar