mirror of
https://github.com/aNNiMON/Own-Programming-Language-Tutorial.git
synced 2024-09-20 08:44:20 +03:00
43 lines
1.1 KiB
Groovy
43 lines
1.1 KiB
Groovy
apply plugin: "java"
|
|
|
|
sourceCompatibility = '1.8'
|
|
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
|
project.ext.mainClass = 'com.annimon.ownlang.Main'
|
|
|
|
sourceSets {
|
|
main.java.srcDir "src/"
|
|
test.java.srcDir "test/"
|
|
}
|
|
|
|
dependencies{
|
|
compile fileTree(dir: 'libs', include: '*.jar')
|
|
}
|
|
|
|
task run(dependsOn: classes, type: JavaExec) {
|
|
main = project.mainClass
|
|
classpath = sourceSets.main.runtimeClasspath
|
|
standardInput = System.in
|
|
ignoreExitValue = true
|
|
}
|
|
|
|
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
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
jcenter()
|
|
}
|
|
|
|
dependencies {
|
|
testCompile group: 'junit', name: 'junit', version: '4.12'
|
|
testCompile group: 'org.openjdk.jmh', name: 'jmh-core', version: '1.12'
|
|
testCompile group: 'org.openjdk.jmh', name: 'jmh-generator-annprocess', version: '1.12'
|
|
}
|