-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
80 lines (68 loc) · 2.07 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
plugins {
id 'java'
id 'antlr'
id 'org.jetbrains.intellij' version '0.4.4'
id "de.undercouch.download" version "1.2"
}
group 'vosk.ruta'
version '0.0.2'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
//final antlr4Version = '4.7.2'
final antlr3Version = '3.5.2'
final rutaVersion = '2.7.0'
dependencies {
antlr("org.antlr:antlr:$antlr3Version") {
exclude group: 'com.ibm.icu', module: 'icu4j'
}
implementation group: 'org.apache.uima', name: 'ruta-core', version: rutaVersion
testCompile group: 'junit', name: 'junit', version: '4.12'
}
intellij {
version '2018.3.5'
// setPlugins("PsiViewer")
pluginName 'ruta-jetbrains-plugin'
plugins 'PsiViewer:183.2153','maven'
downloadSources true
updateSinceUntilBuild false
}
publishPlugin {
channels 'alpha'
username intellijPublishUsername
password intellijPublishPassword
}
patchPluginXml{
pluginDescription = new File('./src/main/resources/META-INF/Description.html').getText('UTF-8')
}
def genSource= 'src/main/gen'
def parserPackage= "org.apache.uima.ruta.parser.debug"
sourceSets.main.java.srcDir genSource
generateGrammarSource {
outputDirectory = file(genSource+"/"+parserPackage.replace(".","/"))
arguments += ['-visitor', '-long-messages', '-debug']
// arguments += ["-package", "org.apache.uima.ruta.parser", "-Xexact-output-dir"]
}
task downloadRuta(type: Download) {
def basePath = 'https://raw.githubusercontent.com/apache/uima-ruta/ruta-'+rutaVersion+'/ruta-core/src/main/antlr3/org/apache/uima/ruta/parser/'
src([
basePath+'RutaLexer.g',
basePath+'RutaLexer.tokens',
basePath+'RutaParser.g',
basePath+'RutaParser.tokens'
])
dest 'src/main/antlr'
}
downloadRuta.doLast {
ant.replaceregexp(match:'org.apache.uima.ruta.parser', replace:parserPackage, flags:'g', byline:true) {
fileset(dir: 'src/main/antlr', includes: '*.g')
}
}
downloadRuta.doLast {
copy {
from 'src/main/antlr'
include "*"
into 'src/main/resources/ruta/antlr'
}
}