You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by vs...@apache.org on 2007/05/30 00:21:38 UTC
svn commit: r542677 - in /maven/sandbox/trunk/plugins/maven-antlr3-plugin:
./ src/main/java/org/apache/maven/plugin/antlr3/ src/site/ src/site/apt/
src/test/java/org/apache/maven/plugin/antlr3/
Author: vsiveton
Date: Tue May 29 15:21:36 2007
New Revision: 542677
URL: http://svn.apache.org/viewvc?view=rev&rev=542677
Log:
MANTLR-17: Support for Antlr 3
o removed unused files
o removed useless pom elements
o updated the site layout
o updated the javadoc
o bumped to 1.0-SNAPSHOT
Removed:
maven/sandbox/trunk/plugins/maven-antlr3-plugin/LICENSE.txt
maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/site/apt/install.apt
Modified:
maven/sandbox/trunk/plugins/maven-antlr3-plugin/pom.xml
maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/main/java/org/apache/maven/plugin/antlr3/Antlr3PluginMojo.java
maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/main/java/org/apache/maven/plugin/antlr3/AntlrHelper.java
maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/site/apt/index.apt
maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/site/apt/usage.apt
maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/site/site.xml
maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/test/java/org/apache/maven/plugin/antlr3/Antlr3PluginMojoTest.java
maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/test/java/org/apache/maven/plugin/antlr3/AntlrHelperTest.java
Modified: maven/sandbox/trunk/plugins/maven-antlr3-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-antlr3-plugin/pom.xml?view=diff&rev=542677&r1=542676&r2=542677
==============================================================================
--- maven/sandbox/trunk/plugins/maven-antlr3-plugin/pom.xml (original)
+++ maven/sandbox/trunk/plugins/maven-antlr3-plugin/pom.xml Tue May 29 15:21:36 2007
@@ -1,41 +1,56 @@
-<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">
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<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>
-
<parent>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugins</artifactId>
<version>8</version>
</parent>
-
- <groupId>org.apache.maven.plugin.antlrv3</groupId>
<artifactId>maven-antlr3-plugin</artifactId>
<packaging>maven-plugin</packaging>
- <version>0.4-SNAPSHOT</version>
+ <version>1.0-SNAPSHOT</version>
<name>Maven ANTLR-v3 Plugin</name>
<description>Generate code from ANTLR version 3 grammar descriptions</description>
+
<developers>
<developer>
- <id>dave</id>
<name>David Holroyd</name>
<url>http://david.holroyd.me.uk/</url>
</developer>
</developers>
<inceptionYear>2007</inceptionYear>
- <organization>
- <name>David Holroyd</name>
- <url>http://david.holroyd.me.uk/</url>
- </organization>
- <licenses>
- <license>
- <name>The Apache License, Version 2.0</name>
- <url>LICENSE.txt</url>
- </license>
- </licenses>
+ <!-- Different from the parent -->
<scm>
- <connection>scm:svn:http://svn.badgers-in-foil.co.uk/maven-antlr3-plugin/maven-antlr3-plugin/trunk</connection>
- <developerConnection>scm:svn:http://svn.badgers-in-foil.co.uk/maven-antlr3-plugin/maven-antlr3-plugin/trunk</developerConnection>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/maven/sandbox/trunk/plugins/maven-antlr3-plugin/</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/sandbox/trunk/plugins/maven-antlr3-plugin/</developerConnection>
+ <url>http://svn.apache.org/viewcvs.cgi/maven/sandbox/trunk/plugins/maven-antlr3-plugin/</url>
</scm>
+ <issueManagement>
+ <system>jira</system>
+ <url>http://jira.codehaus.org/browse/MANTLR</url>
+ </issueManagement>
<dependencies>
<dependency>
@@ -54,57 +69,22 @@
<version>1.5.3</version>
</dependency>
<dependency>
+ <groupId>org.antlr</groupId>
+ <artifactId>antlr</artifactId>
+ <version>3.0</version>
+ </dependency>
+
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.antlr</groupId>
- <artifactId>antlr</artifactId>
- <version>3.0</version>
- </dependency>
- <dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-plugin-testing-harness</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
-
- <distributionManagement>
- <repository>
- <id>bif-repository</id>
- <url>scp://maven.badgers-in-foil.co.uk/home/maven/www/maven2</url>
- </repository>
- <site>
- <id>maven-antlr3-plugin-site</id>
- <url>scp://maven.badgers-in-foil.co.uk/home/maven/www/sites/maven-antlr3-plugin</url>
- </site>
- </distributionManagement>
-
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-plugin-plugin</artifactId>
- </plugin>
-
- <plugin>
- <!-- override the default report set; just reports with useful info -->
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-project-info-reports-plugin</artifactId>
- <reportSets>
- <reportSet>
- <reports>
- <report>dependencies</report>
- <report>project-team</report>
- <report>license</report>
- <report>scm</report>
- </reports>
- </reportSet>
- </reportSets>
- </plugin>
- </plugins>
- </reporting>
</project>
Modified: maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/main/java/org/apache/maven/plugin/antlr3/Antlr3PluginMojo.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/main/java/org/apache/maven/plugin/antlr3/Antlr3PluginMojo.java?view=diff&rev=542677&r1=542676&r2=542677
==============================================================================
--- maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/main/java/org/apache/maven/plugin/antlr3/Antlr3PluginMojo.java (original)
+++ maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/main/java/org/apache/maven/plugin/antlr3/Antlr3PluginMojo.java Tue May 29 15:21:36 2007
@@ -1,3 +1,5 @@
+package org.apache.maven.plugin.antlr3;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,8 +19,6 @@
* under the License.
*/
-package org.apache.maven.plugin.antlr3;
-
import org.antlr.Tool;
import org.antlr.analysis.DFA;
import org.antlr.codegen.CodeGenerator;
@@ -47,6 +47,8 @@
/**
* Generate source code from ANTLRv3 grammar specifications.
*
+ * @author <a href="mailto:dave@badgers-in-foil.co.uk">David Holroyd</a>
+ * @version $Id $
* @goal antlr
* @phase generate-sources
*/
@@ -54,7 +56,7 @@
{
/**
* Specifies the Antlr directory containing grammar files.
- *
+ *
* @parameter expression="${basedir}/src/main/antlr"
* @required
*/
@@ -63,14 +65,14 @@
/**
* A set of patterns matching files from the sourceDirectory that
* should be processed as grammers.
- *
+ *
* @parameter
*/
Set includes = new HashSet();
/**
* Set of exclude patterns
- *
+ *
* @parameter
*/
Set excludes = new HashSet();
@@ -78,21 +80,21 @@
/**
* Enables ANTLR-specific network debugging. Requires a tool able to
* talk this protocol e.g. ANTLRWorks
- *
+ *
* @parameter
*/
protected boolean debug = false;
/**
* Generate a parser that logs rule entry/exit messages.
- *
+ *
* @parameter
*/
protected boolean trace = false;
/**
* Generate a parser that computes profiling information.
- *
+ *
* @parameter
*/
protected boolean profile = false;
@@ -101,7 +103,7 @@
/**
* Location for generated Java files.
- *
+ *
* @parameter expression="${project.build.directory}/generated-sources/antlr"
* @required
*/
@@ -110,7 +112,7 @@
/**
* The number of milliseconds ANTLR will wait for analysis of each
* alternative in the grammar to complete before giving up.
- *
+ *
* @parameter
*/
private int conversionTimeout;
@@ -121,6 +123,9 @@
*/
private MavenProject project;
+ /**
+ * @see org.apache.maven.plugin.Mojo#execute()
+ */
public void execute() throws MojoExecutionException
{
File f = outputDirectory;
Modified: maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/main/java/org/apache/maven/plugin/antlr3/AntlrHelper.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/main/java/org/apache/maven/plugin/antlr3/AntlrHelper.java?view=diff&rev=542677&r1=542676&r2=542677
==============================================================================
--- maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/main/java/org/apache/maven/plugin/antlr3/AntlrHelper.java (original)
+++ maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/main/java/org/apache/maven/plugin/antlr3/AntlrHelper.java Tue May 29 15:21:36 2007
@@ -1,3 +1,5 @@
+package org.apache.maven.plugin.antlr3;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,19 +19,25 @@
* under the License.
*/
-package org.apache.maven.plugin.antlr3;
-
import java.io.File;
import java.util.Iterator;
import java.util.List;
+/**
+ * @author <a href="mailto:dave@badgers-in-foil.co.uk">David Holroyd</a>
+ * @version $Id $
+ */
public class AntlrHelper
{
/**
* Checks to see if the list of outputFiles all exist, and have
* last-modified timestamps which are later than the last-modified
* timestamp of the grammar file. If these conditions hold, the method
- * returns false, otherwise, it returns true,
+ * returns false, otherwise, it returns true.
+ *
+ * @param grammarFileName
+ * @param outputFiles
+ * @return
*/
public static boolean buildRequired( String grammarFileName, List outputFiles )
{
Modified: maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/site/apt/index.apt?view=diff&rev=542677&r1=542676&r2=542677
==============================================================================
--- maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/site/apt/index.apt (original)
+++ maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/site/apt/index.apt Tue May 29 15:21:36 2007
@@ -1,3 +1,31 @@
+ ------
+ Introduction
+ ------
+ David Holroyd
+ ------
+ May 2007
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/guides/mini/guide-apt-format.html
+
Introduction
The maven-antlr3-plugin will use the {{{http://www.antlr.org}ANTLR tool}}
Modified: maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/site/apt/usage.apt
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/site/apt/usage.apt?view=diff&rev=542677&r1=542676&r2=542677
==============================================================================
--- maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/site/apt/usage.apt (original)
+++ maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/site/apt/usage.apt Tue May 29 15:21:36 2007
@@ -1,3 +1,31 @@
+ ------
+ Usage
+ ------
+ David Holroyd
+ ------
+ May 2007
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/guides/mini/guide-apt-format.html
+
Usage
To enable the plugin, add the following to you project's pom.xml,
@@ -8,7 +36,7 @@
<build>
<plugins>
<plugin>
- <groupId>uk.co.badgersinfoil.maven.plugins</groupId>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antlr3-plugin</artifactId>
<executions>
<execution>
@@ -40,7 +68,7 @@
+-----+
...
<plugin>
- <groupId>uk.co.badgersinfoil.maven.plugins</groupId>
+ <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antlr3-plugin</artifactId>
...
<configuration>
Modified: maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/site/site.xml?view=diff&rev=542677&r1=542676&r2=542677
==============================================================================
--- maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/site/site.xml (original)
+++ maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/site/site.xml Tue May 29 15:21:36 2007
@@ -1,4 +1,41 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
<project>
+ <!-- TODO: To be herited -->
+ <bannerLeft>
+ <name>${project.name}</name>
+ <src>/images/apache-maven-project-2.png</src>
+ <href>http://maven.apache.org/</href>
+ </bannerLeft>
+ <bannerRight>
+ <src>/images/maven-logo-2.gif</src>
+ </bannerRight>
+ <skin>
+ <groupId>org.apache.maven.skins</groupId>
+ <artifactId>maven-stylus-skin</artifactId>
+ </skin>
+ <publishDate format="dd MMM yyyy" position="left" />
+ <version position="left" />
+
<body>
<links>
<item name="ANTLR" href="http://www.antlr.org/"/>
@@ -6,11 +43,8 @@
<menu name="Overview">
<item name="Introduction" href="index.html"/>
- <item name="Installation" href="install.html"/>
<item name="Usage" href="usage.html"/>
<item name="Goals" href="plugin-info.html"/>
</menu>
-
- <menu ref="reports"/>
</body>
</project>
Modified: maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/test/java/org/apache/maven/plugin/antlr3/Antlr3PluginMojoTest.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/test/java/org/apache/maven/plugin/antlr3/Antlr3PluginMojoTest.java?view=diff&rev=542677&r1=542676&r2=542677
==============================================================================
--- maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/test/java/org/apache/maven/plugin/antlr3/Antlr3PluginMojoTest.java (original)
+++ maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/test/java/org/apache/maven/plugin/antlr3/Antlr3PluginMojoTest.java Tue May 29 15:21:36 2007
@@ -1,3 +1,5 @@
+package org.apache.maven.plugin.antlr3;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,15 +19,20 @@
* under the License.
*/
-package org.apache.maven.plugin.antlr3;
-
import java.io.File;
import java.util.Collections;
import org.apache.maven.plugin.antlr3.Antlr3PluginMojo;
import org.apache.maven.plugin.testing.AbstractMojoTestCase;
+/**
+ * @author <a href="mailto:dave@badgers-in-foil.co.uk">David Holroyd</a>
+ * @version $Id $
+ */
public class Antlr3PluginMojoTest extends AbstractMojoTestCase
{
+ /**
+ * @see junit.framework.TestCase#tearDown()
+ */
protected void tearDown() throws Exception
{
// if we don't override this, the superclass implementation is used,
Modified: maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/test/java/org/apache/maven/plugin/antlr3/AntlrHelperTest.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/test/java/org/apache/maven/plugin/antlr3/AntlrHelperTest.java?view=diff&rev=542677&r1=542676&r2=542677
==============================================================================
--- maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/test/java/org/apache/maven/plugin/antlr3/AntlrHelperTest.java (original)
+++ maven/sandbox/trunk/plugins/maven-antlr3-plugin/src/test/java/org/apache/maven/plugin/antlr3/AntlrHelperTest.java Tue May 29 15:21:36 2007
@@ -1,3 +1,5 @@
+package org.apache.maven.plugin.antlr3;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -17,8 +19,6 @@
* under the License.
*/
-package org.apache.maven.plugin.antlr3;
-
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
@@ -28,16 +28,26 @@
import junit.framework.TestCase;
+/**
+ * @author <a href="mailto:dave@badgers-in-foil.co.uk">David Holroyd</a>
+ * @version $Id $
+ */
public class AntlrHelperTest extends TestCase
{
private File tmpDir;
+ /**
+ * @see junit.framework.TestCase#setUp()
+ */
public void setUp() throws IOException
{
tmpDir = new File( System.getProperty( "java.io.tmpdir" ), "maven-antlr3-plugin-test" );
tmpDir.mkdir();
}
+ /**
+ * @see junit.framework.TestCase#tearDown()
+ */
public void tearDown()
{
// delete files (assumes no subdirs created),
@@ -61,7 +71,7 @@
targets.add( fileB );
assertFalse( AntlrHelper.buildRequired( fileA.getPath(), targets ) );
-
+
targets.clear();
targets.add( fileA );
assertTrue( AntlrHelper.buildRequired( fileB.getPath(), targets ) );