Skip to content

Commit

Permalink
Update release docs to say 4.13.2; rebuild XPathLexers
Browse files Browse the repository at this point in the history
  • Loading branch information
parrt committed Aug 3, 2024
1 parent 2559349 commit 35ff30d
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 63 deletions.
100 changes: 50 additions & 50 deletions doc/releasing-antlr.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ Make sure this feature is turned on for the `antlr4` repo upon release.
Wack any existing tag as mvn will create one and it fails if already there.

```
$ git tag -d 4.13.1
$ git push origin :refs/tags/4.13.1
$ git push upstream :refs/tags/4.13.1
$ git tag -d 4.13.2
$ git push origin :refs/tags/4.13.2
$ git push upstream :refs/tags/4.13.2
```

### Go release tags

*I don't think this is necessary anymore as we have moved it release branch to https://github.com/antlr4-go/antlr*

It seems that [Go needs a `v` in the release git tag](https://go.dev/ref/mod#glos-version) so make sure that we double up with 4.13.1 and v4.13.1.
It seems that [Go needs a `v` in the release git tag](https://go.dev/ref/mod#glos-version) so make sure that we double up with 4.13.2 and v4.13.2.

```
$ git tag -a runtime/Go/antlr/v4/v4.13.1 -m "Go runtime module only"
$ git push upstream runtime/Go/antlr/v4/v4.13.1
$ git push origin runtime/Go/antlr/v4/v4.13.1
$ git tag -a runtime/Go/antlr/v4/v4.13.2 -m "Go runtime module only"
$ git push upstream runtime/Go/antlr/v4/v4.13.2
$ git push origin runtime/Go/antlr/v4/v4.13.2
```


Expand All @@ -51,13 +51,13 @@ There are a number of files that require inversion number be updated.
Here is a simple script to display any line from the critical files with, say, `4.11.1` in it. Here's an example run of the script:

```bash
~/antlr/code/antlr4 $ python scripts/update_antlr_version.py 4.10 4.11.0
Updating ANTLR version from 4.10 to 4.11.0
~/antlr/code/antlr4 $ python scripts/update_antlr_version.py 4.13.1 4.13.2
Updating ANTLR version from 4.13.1 to 4.13.2
Set ANTLR repo root (default ~/antlr/code/antlr4):
Perform antlr4 `mvn clean` and wipe build dirs Y/N? (default no):
Ok, not cleaning antlr4 dir
4.10 appears on 2 lines so _not_ updating /tmp/antlr4/runtime/JavaScript/package-lock.json
4.10 not in /tmp/antlr4/doc/releasing-antlr.md
4.13.1 appears on 2 lines so _not_ updating /tmp/antlr4/runtime/JavaScript/package-lock.json
4.13.1 not in /tmp/antlr4/doc/releasing-antlr.md
```

Make sure this file doesn't have `-SNAPSHOT` when releasing!
Expand All @@ -77,7 +77,7 @@ Commit to repository.

### PHP runtime

We only have to copy the PHP runtime into the ANTLR repository to run the unittests. But, we still need to bump the version to 4.13.1 in `~/antlr/code/antlr-php-runtime/src/RuntimeMetaData.php` in the separate repository, commit, and push.
We only have to copy the PHP runtime into the ANTLR repository to run the unittests. But, we still need to bump the version to 4.13.2 in `~/antlr/code/antlr-php-runtime/src/RuntimeMetaData.php` in the separate repository, commit, and push.

```
cd ~/antlr/code/antlr-php-runtime/src
Expand All @@ -94,19 +94,19 @@ git push origin master

## Build XPath parsers

This section addresses a [circular dependency regarding XPath](https://github.com/antlr/antlr4/issues/3600). In the java target I avoided a circular dependency (gen 4.13.1 parser for XPath using 4.13.1 which needs it to build) by hand building the parser: runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPath.java. Probably we won't have to rerun this for the patch releases, just major ones that alter the ATN serialization.
This section addresses a [circular dependency regarding XPath](https://github.com/antlr/antlr4/issues/3600). In the java target I avoided a circular dependency (gen 4.13.2 parser for XPath using 4.13.2 which needs it to build) by hand building the parser: runtime/Java/src/org/antlr/v4/runtime/tree/xpath/XPath.java. Probably we won't have to rerun this for the patch releases, just major ones that alter the ATN serialization.

```bash
cd ~/antlr/code/antlr4/runtime/Cpp/runtime/src/tree/xpath
java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.13.1-SNAPSHOT/antlr4-4.13.1-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Cpp XPathLexer.g4
java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.13.2-SNAPSHOT/antlr4-4.13.2-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Cpp XPathLexer.g4

cd ~/antlr/code/antlr4/runtime/CSharp/src/Tree/Xpath
java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.13.1-SNAPSHOT/antlr4-4.13.1-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=CSharp XPathLexer.g4
java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.13.2-SNAPSHOT/antlr4-4.13.2-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=CSharp XPathLexer.g4

cd ~/antlr/code/antlr4/runtime/Python3/tests/expr
java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.13.1-SNAPSHOT/antlr4-4.13.1-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Python3 Expr.g4
java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.13.2-SNAPSHOT/antlr4-4.13.2-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Python3 Expr.g4
cd ~/antlr/code/antlr4/runtime/Python3/src/antlr4/xpath
java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.13.1-SNAPSHOT/antlr4-4.13.1-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Python3 XPathLexer.g4
java -cp ":/Users/parrt/.m2/repository/org/antlr/antlr4/4.13.2-SNAPSHOT/antlr4-4.13.2-SNAPSHOT-complete.jar:$CLASSPATH" org.antlr.v4.Tool -Dlanguage=Python3 XPathLexer.g4
```

## Maven Repository Settings
Expand Down Expand Up @@ -156,7 +156,7 @@ Here is the file template

## Maven deploy snapshot

The goal is to get a snapshot, such as `4.13.1-SNAPSHOT`, to the staging server: [antlr4 tool](https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4/4.13.1-SNAPSHOT/) and [antlr4 java runtime](https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-runtime/4.13.1-SNAPSHOT/).
The goal is to get a snapshot, such as `4.13.2-SNAPSHOT`, to the staging server: [antlr4 tool](https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4/4.13.2-SNAPSHOT/) and [antlr4 java runtime](https://oss.sonatype.org/content/repositories/snapshots/org/antlr/antlr4-runtime/4.13.2-SNAPSHOT/).

Do this:

Expand Down Expand Up @@ -227,18 +227,18 @@ It will start out by asking you the version number:

```
...
What is the release version for "ANTLR 4"? (org.antlr:antlr4-master) 4.13.1: : 4.13.1
What is the release version for "ANTLR 4 Runtime"? (org.antlr:antlr4-runtime) 4.13.1: :
What is the release version for "ANTLR 4 Tool"? (org.antlr:antlr4) 4.13.1: :
What is the release version for "ANTLR 4 Maven plugin"? (org.antlr:antlr4-maven-plugin) 4.13.1: :
What is the release version for "ANTLR 4 Runtime Test Generator"? (org.antlr:antlr4-runtime-testsuite) 4.13.1: :
What is the release version for "ANTLR 4 Tool Tests"? (org.antlr:antlr4-tool-testsuite) 4.13.1: :
What is SCM release tag or label for "ANTLR 4"? (org.antlr:antlr4-master) antlr4-master-4.13.1: : 4.13.1
What is the new development version for "ANTLR 4"? (org.antlr:antlr4-master) 4.13.2-SNAPSHOT:
What is the release version for "ANTLR 4"? (org.antlr:antlr4-master) 4.13.2: : 4.13.2
What is the release version for "ANTLR 4 Runtime"? (org.antlr:antlr4-runtime) 4.13.2: :
What is the release version for "ANTLR 4 Tool"? (org.antlr:antlr4) 4.13.2: :
What is the release version for "ANTLR 4 Maven plugin"? (org.antlr:antlr4-maven-plugin) 4.13.2: :
What is the release version for "ANTLR 4 Runtime Test Generator"? (org.antlr:antlr4-runtime-testsuite) 4.13.2: :
What is the release version for "ANTLR 4 Tool Tests"? (org.antlr:antlr4-tool-testsuite) 4.13.2: :
What is SCM release tag or label for "ANTLR 4"? (org.antlr:antlr4-master) antlr4-master-4.13.2: : 4.13.2
What is the new development version for "ANTLR 4"? (org.antlr:antlr4-master) 4.13.3-SNAPSHOT:
...
```

Maven will go through your pom.xml files to update versions from 4.13.1-SNAPSHOT to 4.13.1 for release and then to 4.13.2-SNAPSHOT after release, which is done with:
Maven will go through your pom.xml files to update versions from 4.13.2-SNAPSHOT to 4.13.2 for release and then to 4.13.2-SNAPSHOT after release, which is done with:

```bash
mvn release:perform -Darguments="-DskipTests"
Expand All @@ -252,7 +252,7 @@ Now, go here:

and on the left click "Staging Repositories". You click the staging repo and close it, then you refresh, click it and release it. It's done when you see it here:

    [https://oss.sonatype.org/service/local/repositories/releases/content/org/antlr/antlr4-runtime/4.13.1/antlr4-runtime-4.13.1.jar](https://oss.sonatype.org/service/local/repositories/releases/content/org/antlr/antlr4-runtime/4.13.1/antlr4-runtime-4.13.1.jar)
    [https://oss.sonatype.org/service/local/repositories/releases/content/org/antlr/antlr4-runtime/4.13.2/antlr4-runtime-4.13.2.jar](https://oss.sonatype.org/service/local/repositories/releases/content/org/antlr/antlr4-runtime/4.13.2/antlr4-runtime-4.13.2.jar)

All releases should be here: [https://repo1.maven.org/maven2/org/antlr/antlr4-runtime](https://repo1.maven.org/maven2/org/antlr/antlr4-runtime).

Expand All @@ -278,7 +278,7 @@ Move (and zip) target to website:

```bash
cd src
zip -r ~/antlr/sites/website-antlr4/download/antlr-javascript-runtime-4.13.1.zip .
zip -r ~/antlr/sites/website-antlr4/download/antlr-javascript-runtime-4.13.2.zip .
```

### CSharp
Expand Down Expand Up @@ -369,32 +369,32 @@ On a Mac (with XCode 7+ installed):
```bash
cd ~/antlr/code/antlr4/runtime/Cpp
./deploy-macos.sh
cp antlr4-cpp-runtime-macos.zip ~/antlr/sites/website-antlr4/download/antlr4-cpp-runtime-4.13.1-macos.zip
cp antlr4-cpp-runtime-macos.zip ~/antlr/sites/website-antlr4/download/antlr4-cpp-runtime-4.13.2-macos.zip
```

On any Mac or Linux machine:

```bash
cd ~/antlr/code/antlr4/runtime/Cpp
./deploy-source.sh
cp antlr4-cpp-runtime-source.zip ~/antlr/sites/website-antlr4/download/antlr4-cpp-runtime-4.13.1-source.zip
cp antlr4-cpp-runtime-source.zip ~/antlr/sites/website-antlr4/download/antlr4-cpp-runtime-4.13.2-source.zip
```

On a Windows machine the build scripts checks if VS 2017 and/or VS 2019 are installed and builds binaries for each, if found. This script requires 7z to be installed (http://7-zip.org then do `set PATH=%PATH%;C:\Program Files\7-Zip\` from DOS not powershell).

```bash
cd ~/antlr/code/antlr4/runtime/Cpp
deploy-windows.cmd Community
cp antlr4-cpp-runtime-vs2019.zip ~/antlr/sites/website-antlr4/download/antlr4-cpp-runtime-4.13.1-vs2019.zip
cp antlr4-cpp-runtime-vs2019.zip ~/antlr/sites/website-antlr4/download/antlr4-cpp-runtime-4.13.2-vs2019.zip
```

Move target to website (**_rename to a specific ANTLR version first if needed_**):

```bash
pushd ~/antlr/sites/website-antlr4/download
git add antlr4-cpp-runtime-4.13.1-macos.zip
git add antlr4-cpp-runtime-4.13.1-windows.zip
git add antlr4-cpp-runtime-4.13.1-source.zip
git add antlr4-cpp-runtime-4.13.2-macos.zip
git add antlr4-cpp-runtime-4.13.2-windows.zip
git add antlr4-cpp-runtime-4.13.2-source.zip
git commit -a -m 'update C++ runtime'
git push origin gh-pages
popd
Expand All @@ -421,7 +421,7 @@ Otherwise enter `N` to ignore the warning.
Jars are in:

```
~/.m2/repository/org/antlr/antlr4-runtime/4.13.1/antlr4-runtime-4.13.1
~/.m2/repository/org/antlr/antlr4-runtime/4.13.2/antlr4-runtime-4.13.2
```

### Update version and copy jars / api
Expand All @@ -430,44 +430,44 @@ Copy javadoc and java jars to website using this script:

```bash
cd ~/antlr/code/antlr4
python scripts/deploy_to_website.py 4.13.0 4.13.1
python scripts/deploy_to_website.py 4.13.1 4.13.2
```

Output:

```bash
Updating ANTLR version from 4.13.0 to 4.13.1
Updating ANTLR version from 4.13.1 to 4.13.2
Set ANTLR website root (default /Users/parrt/antlr/sites/website-antlr4):
Version string updated. Please commit/push:
Javadoc copied:
api/Java updated from antlr4-runtime-4.13.1-javadoc.jar
api/JavaTool updated from antlr4-4.13.1-javadoc.jar
api/Java updated from antlr4-runtime-4.13.2-javadoc.jar
api/JavaTool updated from antlr4-4.13.2-javadoc.jar
Jars copied:
antlr-4.13.1-complete.jar
antlr-runtime-4.13.1.jar
antlr-4.13.2-complete.jar
antlr-runtime-4.13.2.jar

Please look for and add new api files!!
Then MANUALLY commit/push:

git commit -a -m 'Update website, javadoc, jars to 4.13.1'
git commit -a -m 'Update website, javadoc, jars to 4.13.2'
git push origin gh-pages
```

<!--
```bash
cp ~/.m2/repository/org/antlr/antlr4-runtime/4.13.1/antlr4-runtime-4.13.1.jar ~/antlr/sites/website-antlr4/download/antlr-runtime-4.13.1.jar
cp ~/.m2/repository/org/antlr/antlr4/4.13.1/antlr4-4.13.1-complete.jar ~/antlr/sites/website-antlr4/download/antlr-4.13.1-complete.jar
cp ~/.m2/repository/org/antlr/antlr4-runtime/4.13.2/antlr4-runtime-4.13.2.jar ~/antlr/sites/website-antlr4/download/antlr-runtime-4.13.2.jar
cp ~/.m2/repository/org/antlr/antlr4/4.13.2/antlr4-4.13.2-complete.jar ~/antlr/sites/website-antlr4/download/antlr-4.13.2-complete.jar
cd ~/antlr/sites/website-antlr4/download
git add antlr-4.13.1-complete.jar
git add antlr-runtime-4.13.1.jar
git add antlr-4.13.2-complete.jar
git add antlr-runtime-4.13.2.jar
```
-->

Once it's done, you must do the following manually:

```
cd ~/antlr/sites/website-antlr4
git commit -a -m 'Update website, javadoc, jars to 4.13.1'
git commit -a -m 'Update website, javadoc, jars to 4.13.2'
git push origin gh-pages
```

Expand All @@ -479,9 +479,9 @@ cd ~/antlr/sites/website-antlr4/api
git checkout gh-pages
git pull origin gh-pages
cd Java
jar xvf ~/.m2/repository/org/antlr/antlr4-runtime/4.13.1/antlr4-runtime-4.13.1-javadoc.jar
jar xvf ~/.m2/repository/org/antlr/antlr4-runtime/4.13.2/antlr4-runtime-4.13.2-javadoc.jar
cd ../JavaTool
jar xvf ~/.m2/repository/org/antlr/antlr4/4.13.1/antlr4-4.13.1-javadoc.jar
jar xvf ~/.m2/repository/org/antlr/antlr4/4.13.2/antlr4-4.13.2-javadoc.jar
git commit -a -m 'freshen api doc'
git push origin gh-pages
```
Expand Down
6 changes: 3 additions & 3 deletions runtime/CSharp/src/Tree/Xpath/XPathLexer.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// ANTLR Version: 4.11.2-SNAPSHOT
// ANTLR Version: 4.13.1
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

// Generated from XPathLexer.g4 by ANTLR 4.11.2-SNAPSHOT
// Generated from XPathLexer.g4 by ANTLR 4.13.1

// Unreachable code detected
#pragma warning disable 0162
Expand All @@ -27,7 +27,7 @@
using Antlr4.Runtime.Misc;
using DFA = Antlr4.Runtime.Dfa.DFA;

[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.11.2-SNAPSHOT")]
[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.13.1")]
[System.CLSCompliant(false)]
public partial class XPathLexer : Lexer {
protected static DFA[] decisionToDFA;
Expand Down
6 changes: 3 additions & 3 deletions runtime/Cpp/runtime/src/tree/xpath/XPathLexer.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Generated from XPathLexer.g4 by ANTLR 4.13.0
// Generated from XPathLexer.g4 by ANTLR 4.13.1


#include "XPathLexer.h"
Expand Down Expand Up @@ -45,7 +45,7 @@ ::antlr4::internal::OnceFlag xpathlexerLexerOnceFlag;
#if ANTLR4_USE_THREAD_LOCAL_CACHE
static thread_local
#endif
XPathLexerStaticData *xpathlexerLexerStaticData = nullptr;
std::unique_ptr<XPathLexerStaticData> xpathlexerLexerStaticData = nullptr;

void xpathlexerLexerInitialize() {
#if ANTLR4_USE_THREAD_LOCAL_CACHE
Expand Down Expand Up @@ -103,7 +103,7 @@ void xpathlexerLexerInitialize() {
for (size_t i = 0; i < count; i++) {
staticData->decisionToDFA.emplace_back(staticData->atn->getDecisionState(i), i);
}
xpathlexerLexerStaticData = staticData.release();
xpathlexerLexerStaticData = std::move(staticData);
}

}
Expand Down
2 changes: 1 addition & 1 deletion runtime/Cpp/runtime/src/tree/xpath/XPathLexer.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Generated from XPathLexer.g4 by ANTLR 4.13.0
// Generated from XPathLexer.g4 by ANTLR 4.13.1

#pragma once

Expand Down
4 changes: 2 additions & 2 deletions runtime/Python3/src/antlr4/xpath/XPathLexer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated from XPathLexer.g4 by ANTLR 4.11.2-SNAPSHOT
# Generated from XPathLexer.g4 by ANTLR 4.13.1
from antlr4 import *
from io import StringIO
import sys
Expand Down Expand Up @@ -63,7 +63,7 @@ class XPathLexer(Lexer):

def __init__(self, input=None, output:TextIO = sys.stdout):
super().__init__(input, output)
self.checkVersion("4.11.2-SNAPSHOT")
self.checkVersion("4.13.1")
self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
self._actions = None
self._predicates = None
Expand Down
4 changes: 2 additions & 2 deletions runtime/Python3/tests/expr/ExprLexer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated from Expr.g4 by ANTLR 4.11.2-SNAPSHOT
# Generated from Expr.g4 by ANTLR 4.13.1
from antlr4 import *
from io import StringIO
import sys
Expand Down Expand Up @@ -87,7 +87,7 @@ class ExprLexer(Lexer):

def __init__(self, input=None, output:TextIO = sys.stdout):
super().__init__(input, output)
self.checkVersion("4.11.2-SNAPSHOT")
self.checkVersion("4.13.1")
self._interp = LexerATNSimulator(self, self.atn, self.decisionsToDFA, PredictionContextCache())
self._actions = None
self._predicates = None
Expand Down
4 changes: 2 additions & 2 deletions runtime/Python3/tests/expr/ExprParser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated from Expr.g4 by ANTLR 4.11.2-SNAPSHOT
# Generated from Expr.g4 by ANTLR 4.13.1
# encoding: utf-8
from antlr4 import *
from io import StringIO
Expand Down Expand Up @@ -86,7 +86,7 @@ class ExprParser ( Parser ):

def __init__(self, input:TokenStream, output:TextIO = sys.stdout):
super().__init__(input, output)
self.checkVersion("4.11.2-SNAPSHOT")
self.checkVersion("4.13.1")
self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache)
self._predicates = None

Expand Down

0 comments on commit 35ff30d

Please sign in to comment.