2016-07-24 11:58:04 +03:00
|
|
|
apply plugin: 'java'
|
2016-02-25 23:10:51 +02:00
|
|
|
|
|
|
|
sourceCompatibility = '1.8'
|
|
|
|
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
|
|
|
|
2016-07-24 11:58:04 +03:00
|
|
|
if (!hasProperty('mainClass')) {
|
|
|
|
ext.mainClass = 'com.annimon.ownlang.Main'
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
jcenter()
|
|
|
|
}
|
|
|
|
|
|
|
|
buildscript {
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
dependencies {
|
|
|
|
classpath 'net.sf.proguard:proguard-gradle:5.2.1'
|
|
|
|
}
|
2016-02-25 23:10:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
task run(dependsOn: classes, type: JavaExec) {
|
|
|
|
main = project.mainClass
|
|
|
|
classpath = sourceSets.main.runtimeClasspath
|
|
|
|
standardInput = System.in
|
|
|
|
ignoreExitValue = true
|
|
|
|
}
|
|
|
|
|
2016-07-24 11:58:04 +03:00
|
|
|
task runOptimizing(dependsOn: classes, type: JavaExec) {
|
|
|
|
main = project.mainClass
|
|
|
|
classpath = sourceSets.main.runtimeClasspath
|
|
|
|
ignoreExitValue = true
|
2016-07-24 14:30:55 +03:00
|
|
|
// args '-o 9 -m -a -f examples/game/minesweeper.own'.split(' ')
|
2016-07-24 11:58:04 +03:00
|
|
|
args '-o 9 -m -a -f program.own'.split(' ')
|
|
|
|
}
|
|
|
|
|
2016-02-25 23:10:51 +02:00
|
|
|
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"
|
2016-07-24 11:58:04 +03:00
|
|
|
|
2016-02-25 23:10:51 +02:00
|
|
|
manifest {
|
|
|
|
attributes 'Main-Class': project.mainClass
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-07-24 11:58:04 +03:00
|
|
|
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"
|
2016-02-25 23:10:51 +02:00
|
|
|
}
|
|
|
|
|
2016-11-28 19:57:27 +02:00
|
|
|
task sandbox(dependsOn: proguard, type: Jar) {
|
|
|
|
from zipTree("$rootProject.projectDir/store/OwnLang.jar")
|
|
|
|
libsDirName = "$rootProject.projectDir/store"
|
|
|
|
appendix = "Sandbox"
|
|
|
|
|
|
|
|
exclude "**/modules/canvas/**", "**/modules/canvasfx/**", "**/modules/forms/**",
|
|
|
|
"**/modules/java/**", "**/modules/jdbc/**", "**/modules/robot/**",
|
|
|
|
"**/modules/socket/**", "io/**",
|
|
|
|
"**/modules/aimp/**", "aimpremote/**"
|
|
|
|
|
|
|
|
manifest {
|
|
|
|
attributes 'Main-Class': project.mainClass
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-25 23:10:51 +02:00
|
|
|
dependencies {
|
2016-08-02 23:18:02 +03:00
|
|
|
compile ('io.socket:socket.io-client:0.7.0') {
|
|
|
|
exclude group: 'org.json', module: 'json'
|
|
|
|
}
|
2016-07-24 11:58:04 +03:00
|
|
|
compile 'org.json:json:20160212'
|
2016-09-16 17:32:35 +03:00
|
|
|
compile 'org.yaml:snakeyaml:1.17'
|
2016-07-24 11:58:04 +03:00
|
|
|
|
|
|
|
testCompile 'junit:junit:4.12'
|
2016-07-24 12:17:05 +03:00
|
|
|
testCompile 'org.openjdk.jmh:jmh-core:1.13'
|
|
|
|
testCompile 'org.openjdk.jmh:jmh-generator-annprocess:1.13'
|
2016-02-25 23:10:51 +02:00
|
|
|
}
|