mirror of
https://abf.rosa.ru/djam/stringtemplate4.git
synced 2025-04-21 00:24:17 +00:00
Automatic import for version 4.0.4-6.0
This commit is contained in:
commit
b587fa27de
5 changed files with 482 additions and 0 deletions
2
.abf.yml
Normal file
2
.abf.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
sources:
|
||||||
|
"ST-4.0.4-src.zip": ef8e9822da72faea4108fdbad858474cd9fb672e
|
62
DoubleKeyMap.java
Normal file
62
DoubleKeyMap.java
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
package org.antlr.runtime.misc;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/** Sometimes we need to map a key to a value but key is two pieces of data.
|
||||||
|
* This nested hash table saves creating a single key each time we access
|
||||||
|
* map; avoids mem creation.
|
||||||
|
*/
|
||||||
|
public class DoubleKeyMap<Key1, Key2, Value> {
|
||||||
|
Map<Key1, Map<Key2, Value>> data = new LinkedHashMap<Key1, Map<Key2, Value>>();
|
||||||
|
|
||||||
|
public Value put(Key1 k1, Key2 k2, Value v) {
|
||||||
|
Map<Key2, Value> data2 = data.get(k1);
|
||||||
|
Value prev = null;
|
||||||
|
if ( data2==null ) {
|
||||||
|
data2 = new LinkedHashMap<Key2, Value>();
|
||||||
|
data.put(k1, data2);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
prev = data2.get(k2);
|
||||||
|
}
|
||||||
|
data2.put(k2, v);
|
||||||
|
return prev;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Value get(Key1 k1, Key2 k2) {
|
||||||
|
Map<Key2, Value> data2 = data.get(k1);
|
||||||
|
if ( data2==null ) return null;
|
||||||
|
return data2.get(k2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<Key2, Value> get(Key1 k1) { return data.get(k1); }
|
||||||
|
|
||||||
|
/** Get all values associated with primary key */
|
||||||
|
public Collection<Value> values(Key1 k1) {
|
||||||
|
Map<Key2, Value> data2 = data.get(k1);
|
||||||
|
if ( data2==null ) return null;
|
||||||
|
return data2.values();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** get all primary keys */
|
||||||
|
public Set<Key1> keySet() {
|
||||||
|
return data.keySet();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** get all secondary keys associated with a primary key */
|
||||||
|
public Set<Key2> keySet(Key1 k1) {
|
||||||
|
Map<Key2, Value> data2 = data.get(k1);
|
||||||
|
if ( data2==null ) return null;
|
||||||
|
return data2.keySet();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Collection<Value> values() {
|
||||||
|
Set<Value> s = new HashSet<Value>();
|
||||||
|
for (Map<Key2, Value> k2 : data.values()) {
|
||||||
|
for (Value v : k2.values()) {
|
||||||
|
s.add(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
}
|
58
STLexer.tokens
Normal file
58
STLexer.tokens
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
RBRACK=17
|
||||||
|
LBRACK=16
|
||||||
|
ELSE=5
|
||||||
|
ELLIPSIS=11
|
||||||
|
LCURLY=20
|
||||||
|
BANG=10
|
||||||
|
EQUALS=12
|
||||||
|
TEXT=22
|
||||||
|
ID=25
|
||||||
|
SEMI=9
|
||||||
|
LPAREN=14
|
||||||
|
IF=4
|
||||||
|
ELSEIF=6
|
||||||
|
COLON=13
|
||||||
|
RPAREN=15
|
||||||
|
WS=27
|
||||||
|
COMMA=18
|
||||||
|
RCURLY=21
|
||||||
|
ENDIF=7
|
||||||
|
RDELIM=24
|
||||||
|
SUPER=8
|
||||||
|
DOT=19
|
||||||
|
LDELIM=23
|
||||||
|
STRING=26
|
||||||
|
PIPE=28
|
||||||
|
OR=29
|
||||||
|
AND=30
|
||||||
|
INDENT=31
|
||||||
|
NEWLINE=32
|
||||||
|
AT=33
|
||||||
|
END=34
|
||||||
|
TRUE=35
|
||||||
|
FALSE=36
|
||||||
|
COMMENT=37
|
||||||
|
'...'=11
|
||||||
|
'super'=8
|
||||||
|
'|'=28
|
||||||
|
'!'=10
|
||||||
|
'}'=21
|
||||||
|
'else'=5
|
||||||
|
'if'=4
|
||||||
|
'{'=20
|
||||||
|
'...'=11
|
||||||
|
'elseif'=6
|
||||||
|
';'=9
|
||||||
|
'='=12
|
||||||
|
':'=13
|
||||||
|
'('=14
|
||||||
|
'['=16
|
||||||
|
','=18
|
||||||
|
'.'=19
|
||||||
|
'endif'=7
|
||||||
|
')'=15
|
||||||
|
']'=17
|
||||||
|
'||'=29
|
||||||
|
'&&'=30
|
||||||
|
'@'=33
|
||||||
|
'@end'=34
|
246
pom.xml
Normal file
246
pom.xml
Normal file
|
@ -0,0 +1,246 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
|
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>org.antlr</groupId>
|
||||||
|
<artifactId>ST4</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
The version number defined here in the version tag indicates how the
|
||||||
|
jar is named and released. When it ends with SNAPSHOT, it will be stored
|
||||||
|
in your local repository (~/m2 on UNIX) as stringtemplate-X.Y-SNAPSHOT, but
|
||||||
|
will be deplyed to the ANTLR snapshot repository at antlr.org with the word
|
||||||
|
SNAPSHOT replaced with the the data, time and unique number.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<version>4.0.4-SNAPSHOT</version>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
The name of the project as seen by IDEs and release documentation etc.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<name>ANTLR ST4 4.0.4-SNAPSHOT</name>
|
||||||
|
<description>StringTemplate is a java template engine for generating source code,
|
||||||
|
web pages, emails, or any other formatted text output.
|
||||||
|
|
||||||
|
StringTemplate is particularly good at multi-targeted code generators,
|
||||||
|
multiple site skins, and internationalization/localization.
|
||||||
|
|
||||||
|
It evolved over years of effort developing jGuru.com.
|
||||||
|
|
||||||
|
StringTemplate also generates the stringtemplate website: http://www.stringtemplate.org
|
||||||
|
and powers the ANTLR v3 code generator. Its distinguishing characteristic
|
||||||
|
is that unlike other engines, it strictly enforces model-view separation.
|
||||||
|
|
||||||
|
Strict separation makes websites and code generators more flexible
|
||||||
|
and maintainable; it also provides an excellent defense against malicious
|
||||||
|
template authors.
|
||||||
|
|
||||||
|
There are currently about 600 StringTemplate source downloads a month.
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
The URL of the base project
|
||||||
|
-->
|
||||||
|
|
||||||
|
<url>http://www.stringtemplate.org</url>
|
||||||
|
<developers>
|
||||||
|
<developer>
|
||||||
|
<name>Terence Parr</name>
|
||||||
|
<organization>USFCA</organization>
|
||||||
|
<organizationUrl>http://www.cs.usfca.edu</organizationUrl>
|
||||||
|
<email>parrt@antlr.org</email>
|
||||||
|
<roles>
|
||||||
|
<role>Project Leader</role>
|
||||||
|
<role>Developer - Java Target</role>
|
||||||
|
</roles>
|
||||||
|
<timezone>PST</timezone>
|
||||||
|
</developer>
|
||||||
|
<developer>
|
||||||
|
<name>Jim Idle</name>
|
||||||
|
<organization>Temporal Wave LLC</organization>
|
||||||
|
<organizationUrl>http://www.temporal-wave.com</organizationUrl>
|
||||||
|
<email>jimi@temporal-wave.com</email>
|
||||||
|
<roles>
|
||||||
|
<role>Developer - Maven stuff</role>
|
||||||
|
</roles>
|
||||||
|
<timezone>PST</timezone>
|
||||||
|
</developer>
|
||||||
|
</developers>
|
||||||
|
|
||||||
|
<licenses>
|
||||||
|
<license>
|
||||||
|
<name>BSD licence</name>
|
||||||
|
<url>http://antlr.org/license.html</url>
|
||||||
|
<distribution>repo</distribution>
|
||||||
|
</license>
|
||||||
|
</licenses>
|
||||||
|
|
||||||
|
<scm>
|
||||||
|
<url>http://fisheye2.cenqua.com/browse/stringtemplate</url>
|
||||||
|
<connection>http://fisheye2.cenqua.com/browse/stringtemplate</connection>
|
||||||
|
</scm>
|
||||||
|
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Definition of the ANTLR repositories. Note that you can only deploy
|
||||||
|
to the repositories via scp, and so the server must already know about
|
||||||
|
your public key. Only StringTemplate developers are allowed to deploy to the
|
||||||
|
release and snapshot repositories, which are synced with the Maven central
|
||||||
|
repository.
|
||||||
|
-->
|
||||||
|
<distributionManagement>
|
||||||
|
<repository>
|
||||||
|
<id>antlr-repo</id>
|
||||||
|
<name>ANTLR Testing repository</name>
|
||||||
|
<url>scpexe://antlr.org/home/mavensync/antlr-repo</url>
|
||||||
|
</repository>
|
||||||
|
<snapshotRepository>
|
||||||
|
<id>antlr-snapshot</id>
|
||||||
|
<name>ANTLR Testing Snapshot Repository</name>
|
||||||
|
<url>scpexe://antlr.org/home/mavensync/antlr-snapshot</url>
|
||||||
|
</snapshotRepository>
|
||||||
|
</distributionManagement>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<version>4.8.2</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.antlr</groupId>
|
||||||
|
<artifactId>antlr-runtime</artifactId>
|
||||||
|
<version>3.3</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<defaultGoal>install</defaultGoal>
|
||||||
|
<extensions>
|
||||||
|
<extension>
|
||||||
|
<groupId>org.apache.maven.wagon</groupId>
|
||||||
|
<artifactId>wagon-ssh-external</artifactId>
|
||||||
|
<version>1.0-beta-2</version>
|
||||||
|
</extension>
|
||||||
|
</extensions>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
The root of the source code for StringTemplate
|
||||||
|
-->
|
||||||
|
<sourceDirectory>src</sourceDirectory>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
The root of the test source code for StringTemplate.
|
||||||
|
-->
|
||||||
|
<testSourceDirectory>test</testSourceDirectory>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
All the resources that should be on the classpath, when
|
||||||
|
the junit tests are run. Here we need to include the test
|
||||||
|
source code directory as the .st files loaded dynamically
|
||||||
|
by the tests, are located underneath this tree.
|
||||||
|
-->
|
||||||
|
<testResources>
|
||||||
|
<testResource>
|
||||||
|
<directory>test</directory>
|
||||||
|
</testResource>
|
||||||
|
</testResources>
|
||||||
|
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.antlr</groupId>
|
||||||
|
<artifactId>antlr3-maven-plugin</artifactId>
|
||||||
|
<version>3.3</version>
|
||||||
|
<configuration>
|
||||||
|
<libDirectory>src/org/stringtemplate/v4/compiler</libDirectory>
|
||||||
|
<sourceDirectory>src</sourceDirectory>
|
||||||
|
<verbose>true</verbose>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>antlr</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>2.3.2</version>
|
||||||
|
<configuration>
|
||||||
|
<source>1.6</source>
|
||||||
|
<!--
|
||||||
|
NB: If you want to generate 1.4 compatible classes then change
|
||||||
|
the target to:
|
||||||
|
<target>jsr14</target>
|
||||||
|
|
||||||
|
However, the junit tests will then all be hidden from junit and
|
||||||
|
none will run, hence this is not done by default.
|
||||||
|
-->
|
||||||
|
<target>1.6</target>
|
||||||
|
<sourceDirectory>src</sourceDirectory>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.8.1</version>
|
||||||
|
<configuration>
|
||||||
|
<additionalClasspathElements>
|
||||||
|
<additionalClasspathElement>${basedir}/src</additionalClasspathElement>
|
||||||
|
</additionalClasspathElements>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>findbugs-maven-plugin</artifactId>
|
||||||
|
<version>2.3.2</version>
|
||||||
|
<configuration>
|
||||||
|
<findbugsXmlOutput>true</findbugsXmlOutput>
|
||||||
|
<findbugsXmlWithMessages>true</findbugsXmlWithMessages>
|
||||||
|
<xmlOutput>true</xmlOutput>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
|
<version>2.1.2</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>attach-sources</id>
|
||||||
|
<goals>
|
||||||
|
<goal>jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
|
<version>2.8</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>attach-javadocs</id>
|
||||||
|
<goals>
|
||||||
|
<goal>jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
|
|
114
stringtemplate4.spec
Normal file
114
stringtemplate4.spec
Normal file
|
@ -0,0 +1,114 @@
|
||||||
|
%{?_javapackages_macros:%_javapackages_macros}
|
||||||
|
%global pkgname ST
|
||||||
|
|
||||||
|
Name: stringtemplate4
|
||||||
|
Version: 4.0.4
|
||||||
|
Release: 6.0%{?dist}
|
||||||
|
Summary: A Java template engine
|
||||||
|
URL: http://www.stringtemplate.org/
|
||||||
|
Source0: http://www.stringtemplate.org/download/%{pkgname}-%{version}-src.zip
|
||||||
|
|
||||||
|
# missing from source tarball so we add it here for now
|
||||||
|
Source1: https://raw.github.com/antlr/stringtemplate4/master/src/org/stringtemplate/v4/compiler/STLexer.tokens
|
||||||
|
Source2: https://raw.github.com/antlr/antlr/revision-3.4/runtime/Java/src/main/java/org/antlr/runtime/misc/DoubleKeyMap.java
|
||||||
|
Source3: https://raw.github.com/antlr/stringtemplate4/master/pom.xml
|
||||||
|
|
||||||
|
License: BSD
|
||||||
|
|
||||||
|
BuildArch: noarch
|
||||||
|
|
||||||
|
BuildRequires: ant-antlr3, ant-junit
|
||||||
|
BuildRequires: antlr3
|
||||||
|
BuildRequires: stringtemplate
|
||||||
|
# yup...it needs itself...
|
||||||
|
BuildRequires: stringtemplate4
|
||||||
|
# Standard deps
|
||||||
|
BuildRequires: java-devel >= 1:1.6.0
|
||||||
|
BuildRequires: jpackage-utils
|
||||||
|
Requires: java >= 1:1.6.0
|
||||||
|
Requires: jpackage-utils
|
||||||
|
|
||||||
|
%description
|
||||||
|
StringTemplate is a java template engine (with ports for
|
||||||
|
C# and Python) for generating source code, web pages,
|
||||||
|
emails, or any other formatted text output. StringTemplate
|
||||||
|
is particularly good at multi-targeted code generators,
|
||||||
|
multiple site skins, and internationalization/localization.
|
||||||
|
|
||||||
|
%package javadoc
|
||||||
|
|
||||||
|
Summary: API documentation for %{name}
|
||||||
|
Requires: jpackage-utils
|
||||||
|
|
||||||
|
%description javadoc
|
||||||
|
%{summary}.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q -n %{pkgname}-%{version}
|
||||||
|
|
||||||
|
# copy sources missing in source archive into places
|
||||||
|
cp %{SOURCE1} src/org/stringtemplate/v4/compiler/STLexer.tokens
|
||||||
|
mkdir -p src/org/antlr/runtime/misc
|
||||||
|
# this is temporary until we build new antlr3 properly
|
||||||
|
cp %{SOURCE2} src/org/antlr/runtime/misc/DoubleKeyMap.java
|
||||||
|
cp %{SOURCE3} pom.xml
|
||||||
|
|
||||||
|
rm -rf lib/* target
|
||||||
|
ln -sf $(build-classpath antlr3) lib/antlr-3.3-complete.jar
|
||||||
|
ln -sf $(build-classpath ant/ant-antlr3) lib/ant-antlr3.jar
|
||||||
|
|
||||||
|
sed -i \
|
||||||
|
's:location="${ant-antlr3.jar}":location="/usr/share/java/antlr3-runtime.jar":' build.xml
|
||||||
|
sed -i 's:<path id="classpath">:<path id="classpath">\n<pathelement location="'\
|
||||||
|
$(build-classpath stringtemplate4)'"/>:' build.xml
|
||||||
|
|
||||||
|
%build
|
||||||
|
export CLASSPATH="`build-classpath ant/ant-antlr3 antlr3 antlr3-runtime antlr`"
|
||||||
|
ant build-jar
|
||||||
|
|
||||||
|
%javadoc -d javadoc -public `find build/src build/gen -name '*.java'`
|
||||||
|
|
||||||
|
%install
|
||||||
|
install -d -m 755 %{buildroot}%{_javadir}
|
||||||
|
install -p -m 644 dist/ST-%{version}.jar \
|
||||||
|
%{buildroot}%{_javadir}/%{name}.jar
|
||||||
|
|
||||||
|
|
||||||
|
install -d -m 755 %{buildroot}%{_mavenpomdir}
|
||||||
|
install -p -m 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
|
||||||
|
%add_maven_depmap
|
||||||
|
|
||||||
|
mkdir -p %{buildroot}%{_javadocdir}/%{name}
|
||||||
|
cp -pr javadoc/* %{buildroot}%{_javadocdir}/%{name}/
|
||||||
|
|
||||||
|
|
||||||
|
%files
|
||||||
|
%doc LICENSE.txt README.txt
|
||||||
|
%{_datadir}/java/%{name}.jar
|
||||||
|
%{_mavenpomdir}/JPP-%{name}.pom
|
||||||
|
%{_mavendepmapfragdir}/%{name}
|
||||||
|
|
||||||
|
%files javadoc
|
||||||
|
%doc LICENSE.txt
|
||||||
|
%{_javadocdir}/%{name}
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.4-6
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
|
||||||
|
|
||||||
|
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.4-5
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
||||||
|
|
||||||
|
* Tue Aug 7 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.4-4
|
||||||
|
- Fix file permissions
|
||||||
|
|
||||||
|
* Thu Jul 26 2012 Stanislav Ochotnicky <sochotnicky@redhat.com> - 4.0.4-3
|
||||||
|
- Fix build. stringtemplate4 now needs itself to build so add it to
|
||||||
|
classpath
|
||||||
|
|
||||||
|
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0.4-2
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||||
|
|
||||||
|
* Fri Jan 13 2012 Stanislav Ochotnicky <sochotnicky@redhat.com> - 4.0.4-1
|
||||||
|
- Initial version of the package
|
||||||
|
|
Loading…
Add table
Reference in a new issue