-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
executable file
·126 lines (105 loc) · 3.13 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
buildscript {
repositories {
mavenCentral()
repositories {
maven { url "https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven" }
}
}
dependencies {
}
}
plugins {
id "org.jetbrains.intellij" version "1.14.2"
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
group 'antlr'
version pluginVersion
apply plugin: 'java'
apply plugin: 'org.jetbrains.intellij'
apply plugin: 'antlr'
apply plugin: 'jacoco'
task getGrammar {
doFirst {
def f = new File('src/main/antlr/org/jetbrains/eolang/parser/EO.g4')
if (!f.exists())
println("Created destination file: src/main/antlr/org/jetbrains/eolang/parser/EO.g4")
else {
println("File already exists. Delete it and rerun task")
return
}
println("Creating and downloading grammar file from " +
"https://raw.githubusercontent.com/objectionary/" +
"eo/master/eo-parser/src/main/antlr4/org/eolang/parser/Program.g4")
new URL('https://raw.githubusercontent.com/objectionary/eo/master/eo-parser/src/main/antlr4/org/eolang/parser/Program.g4').
withInputStream { i -> f.withOutputStream { it << i } }
f.append('\n\nBAD_CHARACTER\n' +
'\t:\t.\t-> channel(HIDDEN)\n' +
'\t;')
if (f.exists())
println("Grammar downloading is completed")
ant.replaceregexp(match: 'Program', replace: 'EO', flags: 'g', byline: true) {
fileset(dir: 'src/main/antlr/org/jetbrains/eolang/parser', includes: 'EO.g4')
}
}
}
jacoco {
toolVersion = "0.8.7"
}
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
reports {
html.required = false
xml.required = true
csv.required = false
xml.destination file("${buildDir}/reports/jacoco/report.xml")
}
}
task qulice (type: Exec) {
workingDir "${projectDir}"
commandLine 'mvn', 'com.qulice:qulice-maven-plugin:check'
}
compileJava {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
compileTestJava {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
intellij {
version = ideaVersion
pluginName = 'eo-intellij'
downloadSources = false
updateSinceUntilBuild = false
plugins = ["com.intellij.java", "org.jetbrains.idea.maven"]
}
publishPlugin {
dependsOn(test)
token = System.getenv('MARKETPLACE_TOKEN')
}
generateGrammarSource {
dependsOn(getGrammar)
outputDirectory = new File("src/main/java/org/eolang/jetbrains/parser".toString())
arguments += ["-package", "org.eolang.jetbrains.parser", "-Xexact-output-dir"]
}
verifyPlugin {
}
repositories {
mavenCentral()
}
dependencies {
antlr("org.antlr:antlr4:$antlr4Version") {
exclude group:'com.ibm.icu', module:'icu4j'
}
implementation 'org.antlr:antlr4-intellij-adaptor:0.1'
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
}
build {
dependsOn(qulice)
}
sourceCompatibility = JavaVersion.VERSION_1_9
targetCompatibility = JavaVersion.VERSION_1_9