Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for st4js tests #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 44 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,48 @@ See the samples folder. Here are some commands you can try in the samples folder
```

## BUILDING
You don't need to build anything but if you want too...

You need a JDK and ant to build it. Get the [source](https://github.com/jsnyders/STSTv4) and use ant to build.
The StringTemplate jar used by STSTv4 has been built from the StringTemplate master branch to get a fix related to the *<% %>* syntax that could be used in a ST dictionary. However you can replace the ``lib/ST-4.0.9.jar`` and the ``lib/antlr-runtime-3.5.2.jar`` jars with the ``lib/ST-4.0.8.jar`` if you do not care about this fix. Update the ``.sh`` and the ``.bat`` scripts accordingly (a runtime of ANTLR is no more included as a relocated package into the ST jar).

1. you need a JDK and ant to build it.
```
STSTv4 $ java -version
java version "1.6.0_45"
```

1. then clone the STSTv4 repository.

1. run ant:
```
STSTv4 $ /opt/apache-ant-1.9.6/bin/ant
[..snip..]
[jar] Building jar: /opt/working-dir/STSTv4/build/jar/stst.jar

all:

BUILD SUCCESSFUL
```

1. to test STSTv4 you need a start script. On Unix the stst.sh script should work without problems (read: resolve its STST_HOME automatically). On Windows edit the stst.bat.init file.

1. try out a test:
```
STSTv4 $ ./stst.sh -t samples things_HTML.main samples/things_drinks.json
<h1>Wikipedia has a catigory called 'Fictional beverages' with these listed</h1>
<ul>
<li>Alamo Beer</li>
<li>Alaskan Polar Bear Heater</li>
<li>Ambrosia</li>
<li>Crab juice</li>
<li>De-caf Double Half Caf</li>
<li>Duff Beer</li>
<li>Google Gulp</li>
<li>Pan Galactic Gargle Blaster</li>
<li>Slurm</li>
<li>Swill</li>

</ul>
STSTv4 $
```

To use the ``stst.sh``, or the ``stst.bat``, script from your projects just make sure to have the directory that contains the script in your ``PATH``.
Binary file removed lib/ST-4.0.8.jar
Binary file not shown.
Binary file added lib/ST-4.0.9.jar
Binary file not shown.
Binary file added lib/antlr-runtime-3.5.2.jar
Binary file not shown.
2 changes: 0 additions & 2 deletions src/jjs/stst/STStandaloneTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
import org.stringtemplate.v4.misc.STNoSuchPropertyException;
import org.stringtemplate.v4.misc.STNoSuchAttributeException;

import st4hidden.org.antlr.runtime.Token;

import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONArray;
Expand Down
2 changes: 1 addition & 1 deletion stst.bat.init
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ set STST_HOME=<home>

set JAVA_CMD=java
if not "%JAVA_HOME%"=="" set JAVA_CMD="%JAVA_HOME%\bin\java"
set CP=%STST_HOME%\lib\stst.jar;%STST_HOME%\lib\ST-4.0.8.jar
set CP=%STST_HOME%\build\jar\stst.jar;%STST_HOME%\lib\ST-4.0.9.jar;%STST_HOME%\lib\antlr-runtime-3.5.2.jar
%JAVA_CMD% -cp %CP% jjs.stst.STStandaloneTool %*
4 changes: 2 additions & 2 deletions stst.sh.init → stst.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# Set STST_HOME to the folder where stst.zip was extracted to
# Rename to "stst.sh" or "stst" and copy to somewhere on your path.
# Make sure the java command is on the path
STST_HOME=<home>
CP=$STST_HOME/lib/stst.jar:$STST_HOME/lib/ST-4.0.8.jar
STST_HOME=$( cd "$( dirname $0 )" && pwd )
CP=$STST_HOME/build/jar/stst.jar:$STST_HOME/lib/ST-4.0.9.jar:$STST_HOME/lib/antlr-runtime-3.5.2.jar
java -cp $CP jjs.stst.STStandaloneTool $*