-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
88 lines (73 loc) · 2.21 KB
/
build.gradle
File metadata and controls
88 lines (73 loc) · 2.21 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
plugins {
id 'java'
id 'java-library'
id 'maven-publish'
id 'antlr'
}
group 'net.programmer.igoodie'
version '1.5.1-alpha5'
java {
withJavadocJar()
withSourcesJar()
}
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
antlr "org.antlr:antlr4:4.13.1"
api 'com.github.iGoodie.RuntimeGoodies:core:1.3.9'
api 'com.github.iGoodie.RuntimeGoodies:json:1.3.9'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
implementation 'org.eclipse.lsp4j:org.eclipse.lsp4j:0.23.1'
}
sourceSets {
main {
java.srcDirs += "${projectDir}/src/main/antlr"
java.srcDirs += "${projectDir}/src/main/typescript"
}
}
generateGrammarSource {
maxHeapSize = "64m"
arguments += ["-visitor",
"-long-messages",
"-Xexact-output-dir",
"-package", "net.programmer.igoodie.tsl.parser"]
outputDirectory = file("${projectDir}/src/main/antlr/net/programmer/igoodie/tsl") as File
doLast {
File generatedDir = outputDirectory
File targetDir = file("$projectDir/src/main/java/net/programmer/igoodie/tsl/parser") as File
def filesToMove = [
"/TSLLexer.java",
"/TSLParserImpl.java",
"/TSLParserImplBaseListener.java",
"/TSLParserImplBaseVisitor.java",
"/TSLParserImplListener.java",
"/TSLParserImplVisitor.java"
]
filesToMove.each { relativePath ->
def sourceFile = new File(generatedDir, relativePath)
def targetFile = new File(targetDir, sourceFile.name)
println(targetFile)
if (sourceFile.exists()) {
println "Moving ${sourceFile} -> ${targetFile}"
targetFile.delete()
sourceFile.renameTo(targetFile)
} else {
println "File not found: ${sourceFile}"
}
}
}
}
test {
useJUnitPlatform()
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifactId = rootProject.name
}
}
}