-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
74 lines (62 loc) · 1.55 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 'antlr'
id 'idea'
id 'maven-publish'
}
group = "com.jq"
version = "0.2"
repositories {
mavenCentral()
jcenter()
}
dependencies {
antlr "org.antlr:antlr4:4.9.1"
compile "org.antlr:antlr4-runtime:4.9.1"
testImplementation 'org.assertj:assertj-core:3.19.0'
testImplementation(platform('org.junit:junit-bom:5.7.0'))
testImplementation('org.junit.jupiter:junit-jupiter')
}
generateGrammarSource {
maxHeapSize = "128m"
arguments += ['-package', 'com.jq.JqParser', '-visitor', '-listener']
outputDirectory = new File("${project.buildDir}/generated-src/antlr/main/com/jq/JqParser".toString())
}
compileJava.dependsOn generateGrammarSource
sourceSets {
generated {
java.srcDir 'generated-src/antlr/main/'
}
}
compileJava.source sourceSets.generated.java, sourceSets.main.java
clean{
delete "generated-src"
}
idea {
module {
sourceDirs += file("generated-src/antlr/main/")
}
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
// this is not stricly necessary but it is useful if you are not using an IDE
// it will create a JAR with all dependencies included
task fatJar(type: Jar) {
manifest {
attributes 'Main-Class': 'com.jq.App'
}
archiveBaseName.set(project.name + '-all')
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}