forked from JSQLParser/JSqlParser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
171 lines (144 loc) · 4.24 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
161
162
163
164
165
166
167
168
169
170
171
plugins {
id 'java'
id 'maven-publish'
id "ca.coglinc2.javacc" version "3.0.0"
id 'jacoco'
id "com.github.spotbugs" version "4.7.2"
id 'pmd'
// download the RR tools which have no Maven Repository
id "de.undercouch.download" version "4.1.2"
}
group = 'com.github.jsqlparser'
version = '4.2-SNAPSHOT'
description = 'JSQLParser library'
java.sourceCompatibility = JavaVersion.VERSION_1_8
repositories {
gradlePluginPortal()
mavenLocal()
maven {
url = uri('https://repo.maven.apache.org/maven2/')
}
}
dependencies {
testImplementation 'commons-io:commons-io:2.6'
testImplementation 'junit:junit:4.13.1'
testImplementation 'org.mockito:mockito-core:2.28.2'
testImplementation 'org.assertj:assertj-core:3.16.1'
testImplementation 'org.apache.commons:commons-lang3:3.10'
testImplementation 'com.h2database:h2:1.4.200'
// for JaCoCo Reports
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}
compileJavacc {
arguments = [grammar_encoding: 'UTF-8', static: 'false', java_template_type: 'modern']
}
java {
withSourcesJar()
withJavadocJar()
}
jacoco {
toolVersion = "0.8.7"
}
test {
finalizedBy jacocoTestReport // report is always generated after tests run
finalizedBy jacocoTestCoverageVerification
}
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
reports {
xml.required = false
csv.required = false
html.outputLocation = layout.buildDirectory.dir('reports/jacoco')
}
}
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = 0.840
}
}
}
}
spotbugsMain {
reports {
html {
enabled = true
destination = file("build/reports/spotbugs/main/spotbugs.html")
stylesheet = 'fancy-hist.xsl'
}
}
}
spotbugs {
// fail only on P1 and without the net.sf.jsqlparser.parser.*
excludeFilter = file("spotBugsExcludeFilter.xml")
// do not run over the test, although we should do that eventually
spotbugsTest.enabled = false
}
pmd {
consoleOutput = false
toolVersion = "6.36.0"
sourceSets = [sourceSets.main]
// clear the ruleset in order to use configured rules only, although we should apply the Prio 1 rules eventually
ruleSets = []
rulesMinimumPriority = 1
ruleSetFiles = files("ruleset.xml")
pmdMain {
excludes = [
"build/generated/*"
]
}
}
task renderRR() {
doLast {
// these WAR files have been provided as a courtesy by Gunther Rademacher
// and belong to the RR - Railroad Diagram Generator Project
// https://github.com/GuntherRademacher/rr
//
// Hosting at manticore-projects.com is temporary until a better solution is found
// Please do not use these files without Gunther's permission
download {
src 'http://manticore-projects.com/download/convert.war'
dest "$buildDir/rr/convert.war"
overwrite false
}
download {
src 'http://manticore-projects.com/download/rr.war'
dest "$buildDir/rr/rr.war"
overwrite false
}
javaexec {
standardOutput = new FileOutputStream("${buildDir}/rr/JSqlParserCC.ebnf")
main="-jar";
args = [
"$buildDir/rr/convert.war",
"$buildDir/generated/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jj"
]
}
javaexec {
main="-jar";
args = [
"$buildDir/rr/rr.war",
"-noepsilon",
"-color:#4D88FF",
"-offset:0",
"-width:800",
//"-png",
//"-out:${buildDir}/rr/JSqlParserCC.zip",
"-out:${buildDir}/rr/JSqlParserCC.xhtml",
"${buildDir}/rr/JSqlParserCC.ebnf"
]
}
}
}
publishing {
publications {
maven(MavenPublication) {
from(components.java)
}
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}