Skip to content

Commit 9a71180

Browse files
author
Stefan Steinhauser
committed
Merge branch 'master' into feature/exasol-import-export
2 parents c658f4d + 2f6afbc commit 9a71180

File tree

212 files changed

+7086
-11587
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

212 files changed

+7086
-11587
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,49 +16,27 @@ jobs:
1616
- uses: actions/checkout@main
1717
with:
1818
fetch-depth: 0
19-
- name: Set up JDK 11
19+
- name: Set up JDK 17
2020
uses: actions/setup-java@main
2121
with:
22-
java-version: '11'
22+
java-version: '17'
2323
distribution: 'temurin'
2424
- name: Build with Gradle
2525
uses: gradle/actions/setup-gradle@main
2626
- name: Run Gradle Check
2727
run: ./gradlew check
2828

29-
maven_verify:
30-
needs: gradle_check
31-
runs-on: ubuntu-latest
32-
steps:
33-
- uses: actions/checkout@main
34-
with:
35-
fetch-depth: 0
36-
- name: Set up JDK 11
37-
uses: actions/setup-java@main
38-
with:
39-
java-version: '11'
40-
distribution: 'temurin'
41-
cache: maven
42-
server-id: sonatype-nexus-snapshots
43-
server-username: MAVEN_USERNAME
44-
server-password: MAVEN_PASSWORD
45-
- name: Build with Maven
46-
run: mvn -X -B verify --file pom.xml -DdisableXmlReport=true -Djacoco.skip=true -Dpmd.skip=true
47-
env:
48-
MAVEN_USERNAME: ${{ secrets.OSSRHUSERNAME }}
49-
MAVEN_PASSWORD: ${{ secrets.OSSRHPASSWORD }}
50-
5129
gradle_publish:
52-
needs: maven_verify
30+
needs: gradle_check
5331
runs-on: ubuntu-latest
5432
steps:
5533
- uses: actions/checkout@main
5634
with:
5735
fetch-depth: 0
58-
- name: Set up JDK 11
36+
- name: Set up JDK 17
5937
uses: actions/setup-java@main
6038
with:
61-
java-version: '11'
39+
java-version: '17'
6240
distribution: 'temurin'
6341
- name: Build with Gradle
6442
uses: gradle/actions/setup-gradle@main

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@
3232
/nbproject/
3333

3434
/.gradle
35+
36+
# Mac
37+
.DS_Store

CHANGELOG.md

Lines changed: 0 additions & 10578 deletions
This file was deleted.

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [JSqlParser 5.1 Website](https://jsqlparser.github.io/JSqlParser) <img src="src/site/sphinx/_images/logo-no-background.svg" alt="drawing" width="200" align="right"/>
1+
# [JSqlParser 5.3 Website](https://jsqlparser.github.io/JSqlParser) <img src="src/site/sphinx/_images/logo-no-background.svg" alt="drawing" width="200" align="right"/>
22

33
[![CI](https://github.com/JSQLParser/JSqlParser/actions/workflows/ci.yml/badge.svg)](https://github.com/JSQLParser/JSqlParser/actions/workflows/ci.yml)
44
[![Coverage Status](https://coveralls.io/repos/JSQLParser/JSqlParser/badge.svg?branch=master)](https://coveralls.io/r/JSQLParser/JSqlParser?branch=master)
@@ -67,6 +67,22 @@ For details, please see https://storage.googleapis.com/gweb-research2023-media/p
6767

6868
JSQLParser-4.9 was the last JDK8 compatible version. JSQLParser-5.0 and later depend on JDK11 and introduce API breaking changes to the AST Visitors. Please see the Migration Guide for the details.
6969

70+
Building JSQLParser-5.1 and newer with Gradle will depend on a JDK17 toolchain due to the used plugins.
71+
72+
JSQLParser-5.4 Snapshot and later use JavaCC-8 Snapshots for generating the parser.
73+
74+
## Performance
75+
76+
Unfortunately the released JSQLParser-5.2 shows a performance deterioration caused by commit [30cf5d7](https://github.com/JSQLParser/JSqlParser/commit/30cf5d7b930ae0a076f49deb5cc841d39e62b3dc) related to `FunctionAllColumns()`.
77+
This has been resolved in JSQLParser 5.3-SNAPSHOT and JMH benchmarks have been added to avoid such regressions in the future. Further all `LOOKAHEAD` have been revised one by one, and we have gained back a very good performance of the Parser.
78+
79+
```text
80+
Benchmark (version) Mode Cnt Score Error Units
81+
JSQLParserBenchmark.parseSQLStatements latest avgt 15 82.695 ± 2.841 ms/op
82+
JSQLParserBenchmark.parseSQLStatements 5.3 avgt 15 84.687 ± 3.321 ms/op
83+
JSQLParserBenchmark.parseSQLStatements 5.1 avgt 15 86.592 ± 5.781 ms/op
84+
```
85+
7086
## [Supported Grammar and Syntax](https://jsqlparser.github.io/JSqlParser/syntax.html)
7187

7288
**JSqlParser** aims to support the SQL standard as well as all major RDBMS. Any missing syntax or features can be added on demand.

build.gradle

Lines changed: 78 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
import se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask
2+
import com.nwalsh.gradle.saxon.SaxonXsltTask
3+
4+
buildscript {
5+
dependencies {
6+
classpath group: 'net.sf.saxon', name: 'Saxon-HE', version: 'latest.release'
7+
}
8+
}
29

310
plugins {
411
id 'java'
@@ -12,14 +19,16 @@ plugins {
1219
id "com.diffplug.spotless" version "latest.release"
1320
id 'pmd'
1421
id 'checkstyle'
22+
id 'eclipse'
1523

1624
// download the RR tools which have no Maven Repository
1725
id "de.undercouch.download" version "latest.release"
1826
id 'org.hidetake.ssh' version "latest.release"
1927

20-
id "se.bjurr.gitchangelog.git-changelog-gradle-plugin" version "2.0.0" //later depends on JDK 17
28+
id "se.bjurr.gitchangelog.git-changelog-gradle-plugin" version "latest.release"
2129
id "me.champeau.jmh" version "latest.release"
22-
id "com.nwalsh.gradle.saxon.saxon-gradle" version "0.9.6"
30+
id "com.nwalsh.gradle.saxon.saxon-gradle" version "latest.release"
31+
id 'biz.aQute.bnd.builder' version "latest.release"
2332
}
2433

2534
def getVersion = { boolean considerSnapshot ->
@@ -65,13 +74,14 @@ description = 'JSQLParser library'
6574

6675
repositories {
6776
gradlePluginPortal()
68-
mavenLocal()
6977
mavenCentral()
7078

71-
// Sonatype OSSRH
79+
// JavaCC 8 Snapshots
7280
maven {
73-
url = uri('https://s01.oss.sonatype.org/content/repositories/snapshots/')
81+
url = uri('https://central.sonatype.com/repository/maven-snapshots/')
7482
}
83+
84+
maven { url "https://dev.saxonica.com/maven" }
7585
}
7686

7787
configurations {
@@ -88,23 +98,36 @@ dependencies {
8898
testImplementation 'com.h2database:h2:+'
8999

90100
// for JaCoCo Reports
91-
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.+'
92-
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.11.+'
93-
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.11.+'
101+
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.4'
102+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.11.4'
103+
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.11.4'
94104

95105
// https://mvnrepository.com/artifact/org.mockito/mockito-junit-jupiter
96-
testImplementation 'org.mockito:mockito-junit-jupiter:+'
106+
testImplementation 'org.mockito:mockito-junit-jupiter:5.18.0'
97107

98108
// Performance Benchmark
99109
testImplementation 'org.openjdk.jmh:jmh-core:+'
100110
testImplementation 'org.openjdk.jmh:jmh-generator-annprocess:+'
101111

102112
// Java Doc in XML Format
103-
xmlDoclet 'com.manticore-projects.tools:xml-doclet:1.+'
113+
xmlDoclet 'com.manticore-projects.tools:xml-doclet:2.+'
104114

105115
// enforce latest version of JavaCC
106-
testImplementation 'net.java.dev.javacc:javacc:+'
107-
javacc 'net.java.dev.javacc:javacc:+'
116+
testImplementation('org.javacc:core:8.1.0-SNAPSHOT') { changing = true }
117+
testImplementation('org.javacc.generator:java:8.1.0-SNAPSHOT') { changing = true }
118+
119+
jmh 'org.openjdk.jmh:jmh-core:1.37'
120+
jmh 'org.openjdk.jmh:jmh-generator-annprocess:1.37'
121+
javacc('org.javacc:core:8.1.0-SNAPSHOT') { changing = true }
122+
javacc('org.javacc.generator:java:8.1.0-SNAPSHOT') { changing = true }
123+
}
124+
configurations.configureEach {
125+
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
126+
if (details.requested.group in ['org.javacc:core', 'org.javacc.generator']) {
127+
// Check for updates every build
128+
resolutionStrategy.cacheChangingModulesFor 30, 'seconds'
129+
}
130+
}
108131
}
109132

110133
compileJavacc {
@@ -117,9 +140,10 @@ java {
117140

118141
sourceCompatibility = '11'
119142
targetCompatibility = '11'
143+
120144
// needed for XML-Doclet to work (since Doclet changed again with Java 13)
121145
toolchain {
122-
languageVersion.set(JavaLanguageVersion.of(11))
146+
languageVersion.set(JavaLanguageVersion.of(17))
123147
}
124148
}
125149

@@ -137,6 +161,17 @@ jar {
137161
"Automatic-Module-Name": "net.sf.jsqlparser"
138162
)
139163
}
164+
165+
bundle {
166+
properties.empty()
167+
bnd(
168+
"Created-By": System.properties.get('user.name'),
169+
"Bundle-SymbolicName": "net.sf.jsqlparser",
170+
"Import-Package": "*",
171+
"Export-Package": "net.sf.jsqlparser.*",
172+
"Automatic-Module-Name": "net.sf.jsqlparser"
173+
)
174+
}
140175
}
141176

142177
tasks.register('xmldoc', Javadoc) {
@@ -153,10 +188,11 @@ tasks.register('xmldoc', Javadoc) {
153188
)
154189

155190
source = sourceSets.main.allJava
156-
// beware: Gradle deletes this folder automatically and there is no switch-off
191+
include("**/javacc/net/sf/jsqlparser/parser/*.java" )
192+
157193
destinationDir = reporting.file("xmlDoclet")
158194
options.docletpath = configurations.xmlDoclet.files as List
159-
options.doclet = "com.github.markusbernhardt.xmldoclet.XmlDoclet"
195+
options.doclet = "com.manticore.tools.xmldoclet.XmlDoclet"
160196
title = "API $version"
161197
options.addBooleanOption("rst", true)
162198
options.addBooleanOption("withFloatingToc", Boolean.parseBoolean(System.getenv().getOrDefault("FLOATING_TOC", "true")))
@@ -177,7 +213,7 @@ test {
177213
useJUnitPlatform()
178214

179215
// set heap size for the test JVM(s)
180-
minHeapSize = "128m"
216+
minHeapSize = "1G"
181217
maxHeapSize = "4G"
182218

183219
// set JVM stack size
@@ -283,6 +319,7 @@ pmd {
283319
pmdMain {
284320
excludes = [
285321
"build/generated/*"
322+
, "**/net/sf/jsqlparser/parser/SimpleCharStream.java"
286323
]
287324
}
288325
}
@@ -292,6 +329,12 @@ checkstyle {
292329
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
293330
}
294331

332+
tasks.named('checkstyleMain') {
333+
source = source.filter {
334+
!it.absolutePath.contains('net/sf/jsqlparser/parser/SimpleCharStream.java')
335+
}
336+
}
337+
295338
spotless {
296339
// optional: limit format enforcement to just the files changed by this feature branch
297340
ratchetFrom 'origin/master'
@@ -370,14 +413,14 @@ tasks.register('renderRR') {
370413

371414

372415
tasks.register('gitChangelogTask', GitChangelogTask) {
373-
fromRepo = file("$projectDir")
374-
file = new File("${projectDir}/src/site/sphinx/changelog.rst")
375-
fromRevision = "4.0"
416+
fromRepo.set( file("$projectDir").toString() )
417+
file.set( new File("${projectDir}/src/site/sphinx/changelog.rst") )
418+
fromRevision.set( "4.0")
376419
//toRef = "1.1";
377420

378421
// switch off the formatter since the indentation matters for Mark-down
379422
// @formatter:off
380-
templateContent ="""
423+
templateContent.set ("""
381424
************************
382425
Changelog
383426
************************
@@ -404,7 +447,7 @@ Version {{name}}
404447
405448
{{/issues}}
406449
{{/tags}}
407-
"""
450+
""")
408451
// @formatter:on
409452
}
410453

@@ -421,21 +464,21 @@ tasks.register('updateKeywords', JavaExec) {
421464
dependsOn(compileJava)
422465
}
423466

424-
xslt {
467+
tasks.register('xslt', SaxonXsltTask) {
425468
def outFile = version.endsWith("-SNAPSHOT")
426-
? file("src/site/sphinx/syntax_snapshot.rst")
427-
: file("src/site/sphinx/syntax_stable.rst")
469+
? file("src/site/sphinx/syntax_snapshot.rst")
470+
: file("src/site/sphinx/syntax_stable.rst")
428471

429472
dependsOn(renderRR)
430-
stylesheet 'src/main/resources/rr/xhtml2rst.xsl'
473+
stylesheet file('src/main/resources/rr/xhtml2rst.xsl')
431474

432-
parameters (
475+
parameters(
433476
"withFloatingToc": System.getenv().getOrDefault("FLOATING_TOC", "true"),
434477
"isSnapshot": Boolean.toString(version.endsWith("-SNAPSHOT"))
435478
)
436479

437480
// Transform every .xml file in the "input" directory.
438-
input layout.buildDirectory.file("rr/JSqlParserCC.xhtml")
481+
input layout.buildDirectory.file("rr/JSqlParserCC.xhtml").get()
439482
output outFile
440483
}
441484

@@ -607,3 +650,11 @@ tasks.register('upload') {
607650
check {
608651
dependsOn jacocoTestCoverageVerification
609652
}
653+
654+
jmh {
655+
includes = ['.*JSQLParserBenchmark.*']
656+
warmupIterations = 2
657+
fork = 3
658+
iterations = 5
659+
timeOnIteration = '1s'
660+
}

0 commit comments

Comments
 (0)