forked from gbigenios/elasticsearch-analysis-decompound
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
160 lines (139 loc) · 4.81 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
plugins {
id "org.sonarqube" version "2.5"
id "org.xbib.gradle.plugin.asciidoctor" version "1.5.4.1.0"
id "io.codearte.nexus-staging" version "0.7.0"
id "com.intershop.gradle.javacc" version "3.0.3"
}
printf "Host: %s\nOS: %s %s %s\nJVM: %s %s %s %s\nGroovy: %s\nGradle: %s\n" +
"Build: group: ${project.group} name: ${project.name} version: ${project.version}\n",
InetAddress.getLocalHost(),
System.getProperty("os.name"),
System.getProperty("os.arch"),
System.getProperty("os.version"),
System.getProperty("java.version"),
System.getProperty("java.vm.version"),
System.getProperty("java.vm.vendor"),
System.getProperty("java.vm.name"),
GroovySystem.getVersion(),
gradle.gradleVersion
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'findbugs'
apply plugin: 'pmd'
apply plugin: 'checkstyle'
apply plugin: "jacoco"
apply plugin: 'org.xbib.gradle.plugin.asciidoctor'
apply plugin: "com.intershop.gradle.javacc"
repositories {
mavenCentral()
}
configurations {
wagon
distJars {
extendsFrom runtime
exclude group: 'org.elasticsearch'
exclude module: 'lucene-core'
exclude module: 'lucene-analyzers-common'
exclude module: 'jna'
exclude module: 'jackson-core'
exclude module: 'jackson-dataformat-smile'
exclude module: 'jackson-dataformat-yaml'
exclude module: 'log4j-api'
}
}
apply from: 'gradle/ext.gradle'
apply from: 'gradle/publish.gradle'
apply from: 'gradle/sonarqube.gradle'
dependencies {
def without_hamcrest = {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
compile "org.elasticsearch:elasticsearch:${project.property('elasticsearch.version')}"
compile "org.apache.logging.log4j:log4j-api:${project.property('log4j.version')}"
testCompile "junit:junit:${project.property('junit.version')}", without_hamcrest
testCompile "org.apache.logging.log4j:log4j-core:${project.property('log4j.version')}"
testCompile "org.elasticsearch.plugin:transport-netty4-client:${project.property('elasticsearch.version')}"
testCompile "org.elasticsearch.test:framework:${project.property('elasticsearch.version')}"
distJars "${project.group}:${project.name}:${project.version}"
wagon "org.apache.maven.wagon:wagon-ssh:${project.property('wagon.version')}"
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:all" << "-profile" << "compact2"
}
javacc {
configs {
parser {
javaCCVersion = '5.0'
args = []
inputFile = file 'src/main/java/de/pansoft/lucene/queryparser/classic/QueryParser.jj'
packageName = 'de.pansoft.lucene.queryparser.classic'
}
}
}
sourceSets.main.java.srcDirs += 'build/generated/javacc/parser'
sourceSets.main.java.exclude(
'de/pansoft/lucene/queryparser/classic/CharStream.java',
'de/pansoft/lucene/queryparser/classic/Token.java',
'de/pansoft/lucene/queryparser/classic/ParseException.java'
)
test {
systemProperties['path.home'] = System.getProperty("user.dir")
systemProperties['tests.security.manager'] = false
testLogging {
showStandardStreams = false
exceptionFormat = 'full'
}
}
task makePluginDescriptor(type: Copy) {
from 'src/main/templates'
into 'build/tmp/plugin'
expand([
'descriptor': [
'name': project.property('pluginName'),
'classname': project.property('pluginClassname'),
'description': project.property('pluginDescription'),
'version': project.property('version'),
'javaVersion': project.property('targetCompatibility'),
'elasticsearchVersion' : project.property('elasticsearch.version')
]
])
}
task buildPluginZip(type: Zip, dependsOn: [':jar', ':makePluginDescriptor']) {
from configurations.distJars
from 'build/tmp/plugin'
//into 'elasticsearch'
classifier = 'plugin'
}
task unpackPlugin(type: Copy, dependsOn: [':buildPluginZip']) {
delete "plugins"
from configurations.distJars
from 'build/tmp/plugin'
into "plugins/${pluginName}"
}
clean {
delete "plugins"
delete "data"
delete "logs"
}
task javadocJar(type: Jar, dependsOn: classes) {
from javadoc
into 'build/tmp'
classifier 'javadoc'
}
task sourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
into 'build/tmp'
classifier 'sources'
}
artifacts {
archives sourcesJar, javadocJar, buildPluginZip
}
if (project.hasProperty('signing.keyId')) {
signing {
sign configurations.archives
}
}