description = 'Moquette - distribution' apply plugin: 'application' // adds task shadowJar - Create a combined JAR of project and runtime dependencies apply plugin: 'com.github.johnrengelman.shadow' mainClassName = "io.moquette.server.Server" dependencies { compile project(':moquette-broker') compile project(':moquette-h2-storage') compile project(':moquette-mapdb-storage') } def packageSet = project.copySpec { from 'src/main/resources/README.txt' into ('bin'){ from 'src/main/scripts/' fileMode=0755 } into ('lib'){ from "build/libs/${project.name}-${version}.jar" rename { "moquette-${version}.jar" } } into ('lib'){ from configurations.compile } into ('config'){ from 'src/main/resources/moquette.conf' from 'src/main/resources/password_file.conf' from 'src/main/resources/hazelcast.xml' // from 'src/main/resources/acl.conf' } into ('config'){ from 'src/main/resources/log4j.properties' rename { 'moquette-log.properties' } } } task distMoquetteTar(type: Tar) { archiveName = "moquette-${version}.tar" destinationDir file('build') extension 'tar' compression = Compression.GZIP with packageSet } distMoquetteTar.dependsOn jar task distMoquetteZip(type: Zip) { archiveName = "moquette-${version}.zip" destinationDir file('build') with packageSet } distMoquetteZip.dependsOn jar