Skip to content

Commit d816220

Browse files
feat: rework the Visitors
Signed-off-by: Andreas Reichel <[email protected]>
1 parent 1387986 commit d816220

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

build.gradle

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@ def getVersion = { boolean considerSnapshot ->
3131
String snapshot = ""
3232

3333
def versionStr = providers.exec {
34-
commandLine "git", "--no-pager", "describe", "--tags", "--always", "--dirty=-SNAPSHOT"
34+
commandLine "git", "--no-pager", "-C", project(':JSQLParser').projectDir, "describe", "--tags", "--always", "--dirty=-SNAPSHOT"
3535
}.standardOutput.asText.get().trim()
3636

37-
println "Version String: $versionStr"
38-
39-
def pattern = /jsqlparser-(?<major>\d*)\.(?<minor>\d*)(\.(?<patch>\d*))?(-(?<build>\d*)-(?<commit>[a-zA-Z\d]*))?/
37+
def pattern = /(?<major>\d*)\.(?<minor>\d*)(\.(?<patch>\d*))?(-(?<build>\d*)-(?<commit>[a-zA-Z\d]*))?/
4038
def matcher = versionStr =~ pattern
4139

4240
if (matcher.find()) {
@@ -145,8 +143,6 @@ jar {
145143
}
146144

147145
tasks.register('xmldoc', Javadoc) {
148-
println getVersion( true )
149-
150146
def outFile = reporting.file(
151147
version.endsWith("-SNAPSHOT")
152148
? "xmlDoclet/javadoc_snapshot.xml"
@@ -166,11 +162,12 @@ tasks.register('xmldoc', Javadoc) {
166162
// source += fileTree(layout.buildDirectory.dir("generated/jjtree/net/sf/jsqlparser/parser").get()) {
167163
// include("**/*.java")
168164
// }
165+
169166
// beware: Gradle deletes this folder automatically and there is no switch-off
170167
destinationDir = reporting.file("xmlDoclet")
171168
options.docletpath = configurations.xmlDoclet.files as List
172169
options.doclet = "com.github.markusbernhardt.xmldoclet.XmlDoclet"
173-
title = "API " + getVersion( !System.getenv("RELEASE") )
170+
title = "API $version"
174171
options.addBooleanOption("rst", true)
175172
options.addBooleanOption("withFloatingToc", Boolean.parseBoolean(System.getenv().getOrDefault("FLOATING_TOC", "true")))
176173
options.addStringOption("basePackage", "net.sf.jsqlparser")

src/main/java/net/sf/jsqlparser/statement/piped/FromQuery.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ public <T, S> T accept(SelectVisitor<T> selectVisitor, S context) {
203203
return selectVisitor.visit(this, context);
204204
}
205205

206+
public <T, S> T accept(FromQueryVisitor<T, S> fromQueryVisitor, S context) {
207+
return fromQueryVisitor.visit(this, context);
208+
}
206209

207210
@Override
208211
public StringBuilder appendTo(StringBuilder builder) {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package net.sf.jsqlparser.statement.piped;
2+
3+
public interface FromQueryVisitor<T, S> {
4+
T visit(FromQuery fromQuery, S context);
5+
}

0 commit comments

Comments
 (0)