-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
74 lines (61 loc) · 1.6 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
plugins {
id 'java'
id 'application'
}
mainClassName = 'pyokagan.cs4212.Main'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
repositories {
mavenCentral()
flatDir {
dirs 'libs'
}
}
wrapper {
gradleVersion = '4.10.2'
}
def generatedSources = "$buildDir/generated-sources"
sourceSets {
main {
java.srcDirs += generatedSources
}
}
dependencies {
implementation name: 'java-cup-11b-runtime'
implementation 'com.fifesoft:rsyntaxtextarea:2.6.1'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.1.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.1.0'
}
task jflex(type:JavaExec) {
def inputFile = 'src/main/grammar/minijava.flex'
inputs.file inputFile
outputs.file "$generatedSources/pyokagan/cs4212/Lexer.java"
main = '-jar'
args = [
'libs/jflex-1.6.1.jar',
'-d',
"$generatedSources/pyokagan/cs4212",
inputFile,
]
doFirst { mkdir "$generatedSources/pyokagan/cs4212" }
}
task cup(type:JavaExec) {
def inputFile = 'src/main/grammar/minijava.cup'
inputs.file inputFile
outputs.file "$generatedSources/pyokagan/cs4212/Parser.java"
outputs.file "$generatedSources/pyokagan/cs4212/sym.java"
main = '-jar'
args = [
'libs/java-cup-11b.jar',
'-destdir', "$generatedSources/pyokagan/cs4212",
'-interface',
'-parser', 'Parser',
inputFile,
]
doFirst { mkdir "$generatedSources/pyokagan/cs4212" }
}
compileJava.dependsOn jflex
compileJava.dependsOn cup
test {
useJUnitPlatform()
}