mirror of
https://github.com/aNNiMON/Own-Programming-Language-Tutorial.git
synced 2024-09-20 00:34:20 +03:00
41 lines
921 B
Groovy
41 lines
921 B
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'
|
||
|
}
|