apply plugin: 'java' sourceCompatibility = '1.8' [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' if (!hasProperty('mainClass')) { ext.mainClass = 'com.annimon.ownlang.Main' } repositories { jcenter() } buildscript { repositories { mavenCentral() } dependencies { classpath 'net.sf.proguard:proguard-gradle:5.2.1' } } task run(dependsOn: classes, type: JavaExec) { main = project.mainClass classpath = sourceSets.main.runtimeClasspath standardInput = System.in ignoreExitValue = true } task runOptimizing(dependsOn: classes, type: JavaExec) { main = project.mainClass classpath = sourceSets.main.runtimeClasspath ignoreExitValue = true // args '-o 9 -m -a -f examples/game/minesweeper.own'.split(' ') args '-o 9 -m -a -f program.own'.split(' ') } task dist(dependsOn: classes, type: Jar) { from files(sourceSets.main.output.classesDir) from {configurations.compile.collect {zipTree(it)}} from files(sourceSets.main.resources) libsDirName = "$rootProject.projectDir/dist" manifest { attributes 'Main-Class': project.mainClass } } task proguard(dependsOn: dist, type: proguard.gradle.ProGuardTask) { configuration "$rootProject.projectDir/proguard.properties" injars "$rootProject.projectDir/dist/OwnLang.jar" outjars "$rootProject.projectDir/store/OwnLang.jar" } dependencies { compile 'com.squareup.okhttp3:okhttp:3.4.1' compile 'org.json:json:20160212' testCompile 'junit:junit:4.12' testCompile 'org.openjdk.jmh:jmh-core:1.13' testCompile 'org.openjdk.jmh:jmh-generator-annprocess:1.13' }