apply plugin: 'java' apply plugin: 'application' mainClassName= 'de.fabianonline.telegram_backup.CommandLineRunner' sourceCompatibility = 1.7 targetCompatibility = 1.7 repositories { mavenCentral() maven { url "https://jitpack.io" } } dependencies { compile 'com.github.badoualy:kotlogram:0.0.6' compile 'org.xerial:sqlite-jdbc:3.8.11.2' compile 'com.github.spullara.mustache.java:compiler:0.8.18' } run { standardInput = System.in } def getVersionName= { -> def stdout = new ByteArrayOutputStream() exec { commandLine 'git', 'describe', '--tags', '--dirty' standardOutput = stdout } return stdout.toString().trim() } ant.propertyfile(file: "$project.rootDir/build/resources/main/build.properties") { entry(key: "version", value: getVersionName()) } jar { manifest { attributes "Main-Class": "$mainClassName" } from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } includes [ "*.mustache" ] }