@@ -2,7 +2,8 @@ buildscript {
22 repositories {
33 mavenCentral()
44 repositories {
5- maven { url " https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven" }
5+ maven { url " https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven/" }
6+
67 }
78 }
89 dependencies {
@@ -11,7 +12,7 @@ buildscript {
1112
1213
1314plugins {
14- id " org.jetbrains.intellij" version " 1.14.2 "
15+ id " org.jetbrains.intellij" version " 1.17.4 "
1516}
1617
1718java {
@@ -23,34 +24,48 @@ java {
2324group ' antlr'
2425version pluginVersion
2526
27+
2628apply plugin : ' java'
2729apply plugin : ' org.jetbrains.intellij'
2830apply plugin : ' antlr'
2931apply plugin : ' jacoco'
3032
33+ task cleanParser (type : Delete ) {
34+ delete fileTree(" src/main/java/org/eolang/jetbrains/parser" ) // Deletes antlr auto-generated classes
35+ }
36+
37+ task qulice (type : Exec ) {
38+ workingDir " ${ projectDir} "
39+ def mvnExecutable = System . properties[' os.name' ]. toLowerCase(). contains(' windows' ) ? ' mvn.cmd' : ' mvn'
40+ commandLine mvnExecutable, ' com.qulice:qulice-maven-plugin:check' , ' -e' , ' -X'
41+
42+ standardOutput = new FileOutputStream (" qulice.log" )
43+ errorOutput = new FileOutputStream (" qulice-error.log" )
44+ }
45+
3146task getGrammar {
3247 doFirst {
33- def f = new File (' src/main/antlr/org/jetbrains/eolang/parser/EO .g4' )
48+ def f = new File (' src/main/antlr/org/jetbrains/eolang/parser/Eo .g4' )
3449 if (! f. exists())
35- println (" Created destination file: src/main/antlr/org/jetbrains/eolang/parser/EO .g4" )
50+ println (" Created destination file: src/main/antlr/org/jetbrains/eolang/parser/Eo .g4" )
3651 else {
3752 println (" File already exists. Delete it and rerun task" )
3853 return
3954 }
4055 println (" Creating and downloading grammar file from " +
4156 " https://raw.githubusercontent.com/objectionary/" +
42- " eo/master/eo-parser/src/main/antlr4/org/eolang/parser/Program .g4" )
57+ " eo/refs/heads/ master/eo-parser/src/main/antlr4/org/eolang/parser/Eo .g4" )
4358
44- new URL (' https://raw.githubusercontent.com/objectionary/eo/master/eo-parser/src/main/antlr4/org/eolang/parser/Program .g4' ).
59+ new URL (' https://raw.githubusercontent.com/objectionary/eo/refs/heads/ master/eo-parser/src/main/antlr4/org/eolang/parser/Eo .g4' ).
4560 withInputStream { i -> f. withOutputStream { it << i } }
4661 f. append(' \n\n BAD_CHARACTER\n ' +
4762 ' \t :\t .\t -> channel(HIDDEN)\n ' +
4863 ' \t ;' )
4964 if (f. exists())
5065 println (" Grammar downloading is completed" )
5166
52- ant. replaceregexp(match : ' Program' , replace : ' EO ' , flags : ' g' , byline : true ) {
53- fileset(dir : ' src/main/antlr/org/jetbrains/eolang/parser' , includes : ' EO .g4' )
67+ ant. replaceregexp(match : ' Program' , replace : ' Eo ' , flags : ' g' , byline : true ) {
68+ fileset(dir : ' src/main/antlr/org/jetbrains/eolang/parser' , includes : ' Eo .g4' )
5469 }
5570 }
5671}
@@ -69,10 +84,8 @@ jacocoTestReport {
6984 }
7085}
7186
72- task qulice (type : Exec ) {
73- workingDir " ${ projectDir} "
74- commandLine ' mvn' , ' com.qulice:qulice-maven-plugin:check'
75- }
87+
88+
7689
7790compileJava {
7891 sourceCompatibility = ' 1.8'
@@ -92,6 +105,9 @@ intellij {
92105 plugins = [" com.intellij.java" , " org.jetbrains.idea.maven" ]
93106}
94107
108+ test {
109+ useJUnitPlatform() // Sign to use JUnit 5
110+ }
95111
96112publishPlugin {
97113 dependsOn(test)
@@ -100,6 +116,8 @@ publishPlugin {
100116
101117generateGrammarSource {
102118 dependsOn(getGrammar)
119+ dependsOn(qulice)
120+ dependsOn(cleanParser)
103121 outputDirectory = new File (" src/main/java/org/eolang/jetbrains/parser" . toString())
104122 arguments + = [" -package" , " org.eolang.jetbrains.parser" , " -Xexact-output-dir" ]
105123}
@@ -116,11 +134,18 @@ dependencies {
116134 }
117135 implementation ' org.antlr:antlr4-intellij-adaptor:0.1'
118136 testImplementation group : ' junit' , name : ' junit' , version : ' 4.13.2'
137+ testImplementation ' org.junit.jupiter:junit-jupiter-api:5.8.2'
138+ testImplementation ' org.junit.jupiter:junit-jupiter-engine:5.8.2'
139+ implementation ' org.jetbrains:annotations:13.0'
119140}
120141
142+
143+
121144build {
122- dependsOn(qulice )
145+ dependsOn(jacocoTestReport )
123146}
124147
148+
149+
125150sourceCompatibility = JavaVersion . VERSION_1_9
126151targetCompatibility = JavaVersion . VERSION_1_9
0 commit comments