apply plugin: 'application' // adds task shadowJar - Create a combined JAR of project and runtime dependencies description = 'Moquette - distribution' 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') compile group: 'org.slf4j', name: 'slf4j-log4j12', version:'1.7.5' } 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.gz" 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