Skip to content

Commit

Permalink
Prep 4.10 (#3599)
Browse files Browse the repository at this point in the history
* Tweak doc

* Swift was referring to hardcoded version

* Start version update script.

* add files to update

* clean up setup

* clean up setup

* clean up setup

* don't need file

* don't need file

* Fixes #3600.  add instructions and associated code necessary to build the xpath lexers.

* clean up version nums

* php8

* php8

* php8

* php8

* php8

* php8

* php8

* php8

* tweak doc

* ok, i give up. php won't  bump up too v8

* tweak doc

* version number bumped to 4.10 in runtime.

* Change the doc for releasing and update to use latest ST 4.3.2

* fix dart version to 4.10.0

* cmd files Cannot use export bash command.

* try fixing php ci again

* working on deploy

Signed-off-by: Terence Parr <[email protected]>

* php8 always install.

* set js to 4.10.0 not 4.10

* turn off apt update for php circleci

* try w/o cimg/php

* try setting branch

* ok i give up

* tweak

* update docs for release.

* php8 circleci

* use 3.5.3 antlr

* use 3.5.3-SNAPSHOT antlr
  • Loading branch information
parrt authored Apr 10, 2022
1 parent 4de285f commit 61ca09e
Show file tree
Hide file tree
Showing 54 changed files with 982 additions and 562 deletions.
14 changes: 9 additions & 5 deletions .circleci/scripts/install-linux-php.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@

set -euo pipefail

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
sudo apt-get update -qq

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update

sudo apt install php-all-dev
sudo apt install wget php8.0-cli php8.0-zip unzip
wget -O composer-setup.php https://getcomposer.org/installer
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer

sudo apt install php8.0
sudo apt install php8.0-mbstring
sudo apt install php8.0-xml
php -v

sudo apt install composer

git clone https://github.com/antlr/antlr-php-runtime.git runtime/PHP
composer install -d runtime/PHP
Expand Down
1 change: 0 additions & 1 deletion .github/scripts-windows/run-tests-csharp.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
dotnet build runtime/CSharp/src/Antlr4.csproj -c Release
dotnet pack runtime/CSharp/src/Antlr4.csproj -c Release
cd runtime-testsuite
export MAVEN_OPTS="-Xmx8g"
mvn -Dparallel=classes -DthreadCount=2 -Dtest=csharp.** test
cd ..
1 change: 0 additions & 1 deletion .github/scripts-windows/run-tests-dart.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
C:\ProgramData\chocolatey\bin\choco.exe -y install dart-sdk

cd runtime-testsuite
export MAVEN_OPTS="-Xmx8g"
mvn -Dtest=dart.** test -Dantlr-dart-dart="C:\tools\dart-sdk\bin\dart.exe" -Dantlr-dart-pub="C:\tools\dart-sdk\bin\pub.bat" -Dantlr-dart-dart2native="C:\tools\dart-sdk\bin\dart2native.bat"
cd ..
1 change: 0 additions & 1 deletion .github/scripts-windows/run-tests-go.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cd runtime-testsuite
export MAVEN_OPTS="-Xmx8g"
mvn -Dparallel=classes -DthreadCount=2 -Dtest=go.** test
cd ..
1 change: 0 additions & 1 deletion .github/scripts-windows/run-tests-java.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cd runtime-testsuite
export MAVEN_OPTS="-Xmx8g"
mvn -Dparallel=classes -DthreadCount=2 -Dtest=java.** test
cd ..
1 change: 0 additions & 1 deletion .github/scripts-windows/run-tests-javascript.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cd runtime-testsuite
export MAVEN_OPTS="-Xmx8g"
mvn -Dparallel=classes -DthreadCount=2 -Dtest=javascript.** test
cd ..
3 changes: 1 addition & 2 deletions .github/scripts-windows/run-tests-php.cmd
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
REM C:\ProgramData\chocolatey\bin\choco.exe install php -y --package-parameters='"/DontAddToPath"'

git clone https://github.com/antlr/antlr-php-runtime/tree/dev
git clone https://github.com/antlr/antlr-php-runtime.git
move antlr-php-runtime runtime\PHP

cd runtime-testsuite
export MAVEN_OPTS="-Xmx8g"
mvn -Dparallel=classes -DthreadCount=2 -Dtest=php.** test -Dantlr-php-php="C:\tools\php81\php.exe"
cd ..
1 change: 0 additions & 1 deletion .github/scripts-windows/run-tests-python2.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cd runtime-testsuite
export MAVEN_OPTS="-Xmx8g"
mvn -Dparallel=classes -DthreadCount=2 -Dantlr-python2-python="C:\Python27\python.exe" -Dtest=python2.** test
cd ..
1 change: 0 additions & 1 deletion .github/scripts-windows/run-tests-python3.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cd runtime-testsuite
export MAVEN_OPTS="-Xmx8g"
mvn -Dparallel=classes -DthreadCount=2 -Dantlr-python3-python="C:\Python310\python.exe" -Dtest=python3.** test
cd ..
21 changes: 16 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,22 @@

1. [Fork](https://help.github.com/articles/fork-a-repo) the [antlr/antlr4 repo](https://github.com/antlr/antlr4), which will give you both key branches, `master` and `dev`
2. Make sure to `git checkout dev` in your fork so that you are working from the latest development branch
2. Install and configure [EditorConfig](http://editorconfig.org/) so your text editor or IDE uses the ANTLR 4 coding style
3. [Build ANTLR 4](doc/building-antlr.md)
4. [Run the ANTLR project unit tests](doc/antlr-project-testing.md)
5. Create a [pull request](https://help.github.com/articles/using-pull-requests/) with your changes and make sure you're comparing the `dev` branch in your fork to the `dev` branch from the `antlr/antlr4` repo:
3. Create and work from a branch from `dev` such as `git checkout -b
your-branch-name`
4. Install and configure [EditorConfig](http://editorconfig.org/) so your text editor or IDE uses the ANTLR 4 coding style
5. [Build ANTLR 4](doc/building-antlr.md)
6. [Run the ANTLR project unit tests](doc/antlr-project-testing.md)
7. Create a [pull request](https://help.github.com/articles/using-pull-requests/) with your changes and make sure you're comparing the `dev` branch in your fork to the `dev` branch from the `antlr/antlr4` repo:

<img src="doc/images/PR-on-dev.png" width="600">

**Note:** You must sign the `contributors.txt` certificate of origin with your pull request if you've not done so before.
**Note:** Each commit requires a "signature", which is simple as using `-s` (not
`-S`) to the git commit command:

```
git commit -s -m 'This is my commit message'
```

Github's pull request process enforces the sig and gives instructions on how to
fix any commits that lack the sig. See [Github DCO app](https://github.com/apps/dco)
for more info.
2 changes: 1 addition & 1 deletion doc/dart-target.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ANTLR4 Runtime for Dart

From version 4.9.3 onwards antlr's dart generated code is null sound safety compatible and sets the minimum dart sdk version to 2.12.0.
From version 4.10 onwards antlr's dart generated code is null sound safety compatible and sets the minimum dart sdk version to 2.12.0.

### First steps

Expand Down
24 changes: 12 additions & 12 deletions doc/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Hi and welcome to the version 4 release of ANTLR! It's named after the fearless

ANTLR is really two things: a tool that translates your grammar to a parser/lexer in Java (or other target language) and the runtime needed by the generated parsers/lexers. Even if you are using the ANTLR Intellij plug-in or ANTLRWorks to run the ANTLR tool, the generated code will still need the runtime library.

The first thing you should do is probably download and install a development tool plug-in. Even if you only use such tools for editing, they are great. Then, follow the instructions below to get the runtime environment available to your system to run generated parsers/lexers. In what follows, I talk about antlr-4.9.3-complete.jar, which has the tool and the runtime and any other support libraries (e.g., ANTLR v4 is written in v3).
The first thing you should do is probably download and install a development tool plug-in. Even if you only use such tools for editing, they are great. Then, follow the instructions below to get the runtime environment available to your system to run generated parsers/lexers. In what follows, I talk about antlr-4.10-complete.jar, which has the tool and the runtime and any other support libraries (e.g., ANTLR v4 is written in v3).

If you are going to integrate ANTLR into your existing build system using mvn, ant, or want to get ANTLR into your IDE such as eclipse or intellij, see [Integrating ANTLR into Development Systems](https://github.com/antlr/antlr4/blob/master/doc/IDEs.md).

Expand All @@ -16,36 +16,36 @@ If you are going to integrate ANTLR into your existing build system using mvn, a
1. Download
```
$ cd /usr/local/lib
$ curl -O https://www.antlr.org/download/antlr-4.9.3-complete.jar
$ curl -O https://www.antlr.org/download/antlr-4.10-complete.jar
```
Or just download in browser from website:
[https://www.antlr.org/download.html](https://www.antlr.org/download.html)
and put it somewhere rational like `/usr/local/lib`.

2. Add `antlr-4.9.3-complete.jar` to your `CLASSPATH`:
2. Add `antlr-4.10-complete.jar` to your `CLASSPATH`:
```
$ export CLASSPATH=".:/usr/local/lib/antlr-4.9.3-complete.jar:$CLASSPATH"
$ export CLASSPATH=".:/usr/local/lib/antlr-4.10-complete.jar:$CLASSPATH"
```
It's also a good idea to put this in your `.bash_profile` or whatever your startup script is.

3. Create aliases for the ANTLR Tool, and `TestRig`.
```
$ alias antlr4='java -Xmx500M -cp "/usr/local/lib/antlr-4.9.3-complete.jar:$CLASSPATH" org.antlr.v4.Tool'
$ alias grun='java -Xmx500M -cp "/usr/local/lib/antlr-4.9.3-complete.jar:$CLASSPATH" org.antlr.v4.gui.TestRig'
$ alias antlr4='java -Xmx500M -cp "/usr/local/lib/antlr-4.10-complete.jar:$CLASSPATH" org.antlr.v4.Tool'
$ alias grun='java -Xmx500M -cp "/usr/local/lib/antlr-4.10-complete.jar:$CLASSPATH" org.antlr.v4.gui.TestRig'
```

### WINDOWS

(*Thanks to Graham Wideman*)

0. Install Java (version 1.7 or higher)
1. Download antlr-4.9.3-complete.jar (or whatever version) from [https://www.antlr.org/download/](https://www.antlr.org/download/)
1. Download antlr-4.10-complete.jar (or whatever version) from [https://www.antlr.org/download/](https://www.antlr.org/download/)
Save to your directory for 3rd party Java libraries, say `C:\Javalib`
2. Add `antlr-4.9.3-complete.jar` to CLASSPATH, either:
2. Add `antlr-4.10-complete.jar` to CLASSPATH, either:
* Permanently: Using System Properties dialog > Environment variables > Create or append to `CLASSPATH` variable
* Temporarily, at command line:
```
SET CLASSPATH=.;C:\Javalib\antlr-4.9.3-complete.jar;%CLASSPATH%
SET CLASSPATH=.;C:\Javalib\antlr-4.10-complete.jar;%CLASSPATH%
```
3. Create short convenient commands for the ANTLR Tool, and TestRig, using batch files or doskey commands:
* Batch files (in directory in system PATH) antlr4.bat and grun.bat
Expand All @@ -71,7 +71,7 @@ Either launch org.antlr.v4.Tool directly:

```
$ java org.antlr.v4.Tool
ANTLR Parser Generator Version 4.9.3
ANTLR Parser Generator Version 4.10
-o ___ specify output directory where all output is generated
-lib ___ specify location of .tokens files
...
Expand All @@ -80,8 +80,8 @@ ANTLR Parser Generator Version 4.9.3
or use -jar option on java:

```
$ java -jar /usr/local/lib/antlr-4.9.3-complete.jar
ANTLR Parser Generator Version 4.9.3
$ java -jar /usr/local/lib/antlr-4.10-complete.jar
ANTLR Parser Generator Version 4.10
-o ___ specify output directory where all output is generated
-lib ___ specify location of .tokens files
...
Expand Down
4 changes: 2 additions & 2 deletions doc/go-target.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ go get github.com/antlr/antlr4/runtime/Go/antlr

`go get` has no native way to specify a branch or commit. So, when you run it, you'll download the latest commits. This may or may not be your preference.

You'll need to use git to set the release. For example, to set the release tag for release 4.6.0:
You'll need to use git to set the release. For example, to set the release tag for release 4.9.3:

```bash
cd $GOPATH/src/github.com/antlr/antlr4 # enter the antlr4 source directory
git checkout tags/4.6.0 # the go runtime was added in release 4.6.0
git checkout tags/4.9.3 # the go runtime was added in release 4.9.3
```

A complete list of releases can be found on [the release page](https://github.com/antlr/antlr4/releases).
Expand Down
4 changes: 2 additions & 2 deletions doc/java-target.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ Edit the pom.xml file. Now we need to extensively modify the pom.xml file. The f
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.5</version>
<version>4.9.3</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down Expand Up @@ -164,7 +164,7 @@ Edit the pom.xml file. Now we need to extensively modify the pom.xml file. The f
<plugin>
<groupId>org.antlr</groupId>
<artifactId>antlr4-maven-plugin</artifactId>
<version>4.5</version>
<version>4.9.3</version>
<executions>
<execution>
<goals>
Expand Down
Loading

0 comments on commit 61ca09e

Please sign in to comment.