Skip to content

Commit e428c7f

Browse files
doc: many website cosmetics about Release vs. Snapshot
1 parent eb3a6cb commit e428c7f

7 files changed

Lines changed: 49 additions & 15115 deletions

File tree

.github/workflows/sphinx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Setup Gradle
2424
uses: gradle/gradle-build-action@v2
2525
- name: Run build with Gradle Wrapper
26-
run: gradle --no-build-cache clean xmldoc sphinx
26+
run: FLOATING_TOC=false gradle --no-build-cache clean xmldoc sphinx
2727
- name: Deploy
2828
uses: actions/configure-pages@v2
2929
- name: Upload artifact

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
/src/site/sphinx/changelog.rst
1010
/src/site/sphinx/javadoc_stable.rst
1111
/src/site/sphinx/syntax_stable.rst
12+
/src/site/sphinx/javadoc_snapshot.rst
13+
/src/site/sphinx/syntax_snapshot.rst
1214

1315
# Generated by javacc-maven-plugin
1416
/bin
@@ -29,5 +31,3 @@
2931
/nbproject/
3032

3133
/.gradle
32-
/src/site/sphinx/javadoc_snapshot.rst
33-
/src/site/sphinx/syntax_snapshot.rst

build.gradle

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ def getVersion = { boolean considerSnapshot ->
6262
? "${major}.${minor}.${patch}${snapshot}"
6363
: "${major}.${minor}${snapshot}"
6464
}
65-
version = getVersion(true)
65+
66+
// for publishing a release, call Gradle with Environment Variable RELEASE:
67+
// RELEASE=true gradle JSQLParser:publish
68+
version = getVersion( !System.getenv("RELEASE") )
6669
group = 'com.github.jsqlparser'
6770
description = 'JSQLParser library'
6871
archivesBaseName = "JSQLParser"
@@ -431,6 +434,11 @@ xslt {
431434
dependsOn(renderRR)
432435
stylesheet 'src/main/resources/rr/xhtml2rst.xsl'
433436

437+
parameters (
438+
"withFloatingToc": System.getenv().getOrDefault("FLOATING_TOC", "true"),
439+
"isSnapshot": Boolean.toString(version.endsWith("-SNAPSHOT"))
440+
)
441+
434442
// Transform every .xml file in the "input" directory.
435443
input "$buildDir/rr/JSqlParserCC.xhtml"
436444
output outFile
@@ -571,7 +579,6 @@ remotes {
571579
}
572580

573581
tasks.register('upload') {
574-
dependsOn(check, assemble, gitChangelogTask, renderRR, xslt, updateKeywords, xmldoc)
575582
doFirst {
576583
if (findProperty("${project.name}.host") == null) {
577584
println(
@@ -594,4 +601,5 @@ tasks.register('upload') {
594601
}
595602
}
596603
}
604+
upload.dependsOn(check, assemble, gitChangelogTask, renderRR, xslt, updateKeywords, xmldoc)
597605

src/main/resources/rr/xhtml2rst.xsl

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@
2121
omit-xml-declaration="yes"
2222
indent="no" />
2323

24-
<xsl:param name="withFloatingToc" select="'true'" />
24+
<xsl:param name="withFloatingToc" select="'false'" />
25+
<xsl:param name="isSnapshot" select="'false'" />
2526

2627
<!-- a default catch is needed to suppress all unwanted nodes -->
2728
<xsl:template match="*">
28-
<xsl:text disable-output-escaping="yes">
29+
<xsl:choose>
30+
<xsl:when test="$withFloatingToc='true'">
31+
<xsl:text disable-output-escaping="yes">
2932
.. raw:: html
3033

3134
&lt;div id="floating-toc"&gt;
@@ -36,18 +39,26 @@
3639
&lt;ul id="toc-list"&gt;&lt;/ul&gt;
3740
&lt;/div&gt;
3841

39-
4042
</xsl:text>
43+
</xsl:when>
44+
</xsl:choose>
45+
4146
<xsl:apply-templates select="/xhtml:html/xhtml:body"/>
4247
</xsl:template>
4348

4449
<xsl:template match="/xhtml:html/xhtml:body">
4550
<xsl:text disable-output-escaping="yes">
4651
*********************************************************************
47-
SQL Syntax |JSQLPARSER_SNAPSHOT_VERSION|
52+
SQL Syntax JSQLParser-</xsl:text><xsl:choose>
53+
<xsl:when test="$isSnapshot='true'"><xsl:text>|JSQLPARSER_SNAPSHOT_VERSION|</xsl:text></xsl:when>
54+
<xsl:otherwise><xsl:text>|JSQLPARSER_VERSION|</xsl:text></xsl:otherwise>
55+
</xsl:choose><xsl:text>
4856
*********************************************************************
4957

50-
The EBNF and Railroad Diagrams for JSQLParser-|JSQLPARSER_VERSION|.
58+
The EBNF and Railroad Diagrams for JSQLParser-</xsl:text><xsl:choose>
59+
<xsl:when test="$isSnapshot='true'"><xsl:text>|JSQLPARSER_SNAPSHOT_VERSION|</xsl:text></xsl:when>
60+
<xsl:otherwise><xsl:text>|JSQLPARSER_VERSION|</xsl:text></xsl:otherwise>
61+
</xsl:choose><xsl:text>.
5162

5263
</xsl:text>
5364
<xsl:apply-templates select="svg:svg"/>

0 commit comments

Comments
 (0)