You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ca...@apache.org on 2006/01/06 14:52:10 UTC

svn commit: r366503 - in /maven/plugins/trunk/maven-antrun-plugin/src/it/test6: ./ build.xml calc.g pom.xml

Author: carlos
Date: Fri Jan  6 05:52:02 2006
New Revision: 366503

URL: http://svn.apache.org/viewcvs?rev=366503&view=rev
Log:
Test for plugin classpath references and optional ant tasks

Added:
    maven/plugins/trunk/maven-antrun-plugin/src/it/test6/
    maven/plugins/trunk/maven-antrun-plugin/src/it/test6/build.xml   (with props)
    maven/plugins/trunk/maven-antrun-plugin/src/it/test6/calc.g   (with props)
    maven/plugins/trunk/maven-antrun-plugin/src/it/test6/pom.xml   (with props)

Added: maven/plugins/trunk/maven-antrun-plugin/src/it/test6/build.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-antrun-plugin/src/it/test6/build.xml?rev=366503&view=auto
==============================================================================
--- maven/plugins/trunk/maven-antrun-plugin/src/it/test6/build.xml (added)
+++ maven/plugins/trunk/maven-antrun-plugin/src/it/test6/build.xml Fri Jan  6 05:52:02 2006
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<project name="test6">
+
+    <target name="test">
+
+        <!-- <taskdef name="antlr" classname="org.apache.tools.ant.taskdefs.optional.ANTLR"/> -->
+
+        <antlr target="calc.g" outputdirectory="target">
+            <classpath refid="maven.plugin.classpath"/>
+        </antlr>
+
+    </target>
+
+</project>

Propchange: maven/plugins/trunk/maven-antrun-plugin/src/it/test6/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-antrun-plugin/src/it/test6/build.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-antrun-plugin/src/it/test6/calc.g
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-antrun-plugin/src/it/test6/calc.g?rev=366503&view=auto
==============================================================================
--- maven/plugins/trunk/maven-antrun-plugin/src/it/test6/calc.g (added)
+++ maven/plugins/trunk/maven-antrun-plugin/src/it/test6/calc.g Fri Jan  6 05:52:02 2006
@@ -0,0 +1,60 @@
+class CalcParser extends Parser;
+options {
+	buildAST = true;	// uses CommonAST by default
+}
+
+expr
+	:	mexpr (PLUS^ mexpr)* SEMI!
+	;
+
+mexpr
+	:	atom (STAR^ atom)*
+	;
+
+atom:	INT
+	;
+
+class CalcLexer extends Lexer;
+
+WS	:	(' '
+	|	'\t'
+	|	'\n'
+	|	'\r')
+		{ _ttype = Token.SKIP; }
+	;
+
+LPAREN:	'('
+	;
+
+RPAREN:	')'
+	;
+
+STAR:	'*'
+	;
+
+PLUS:	'+'
+	;
+
+SEMI:	';'
+	;
+
+protected
+DIGIT
+	:	'0'..'9'
+	;
+
+INT	:	(DIGIT)+
+	;
+
+class CalcTreeWalker extends TreeParser;
+
+expr returns [float r]
+{
+	float a,b;
+	r=0;
+}
+	:	#(PLUS a=expr b=expr)	{r = a+b;}
+	|	#(STAR a=expr b=expr)	{r = a*b;}
+	|	i:INT			{r = (float)Integer.parseInt(i.getText());}
+	;
+

Propchange: maven/plugins/trunk/maven-antrun-plugin/src/it/test6/calc.g
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-antrun-plugin/src/it/test6/calc.g
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-antrun-plugin/src/it/test6/pom.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-antrun-plugin/src/it/test6/pom.xml?rev=366503&view=auto
==============================================================================
--- maven/plugins/trunk/maven-antrun-plugin/src/it/test6/pom.xml (added)
+++ maven/plugins/trunk/maven-antrun-plugin/src/it/test6/pom.xml Fri Jan  6 05:52:02 2006
@@ -0,0 +1,53 @@
+<?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.apache.maven.plugins.antrun</groupId>
+  <artifactId>test6</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <name>Test for plugin classpath references and optional ant tasks</name>
+  <description>Ensure that maven.plugin.classpath reference is set and optional tasks work</description>
+ 
+  <dependencies>
+  </dependencies>
+  
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>compile</id>
+            <phase>compile</phase>
+            <configuration>
+              <tasks>
+                <ant antfile="${basedir}/build.xml" inheritRefs="true">
+                  <target name="test"/>
+                </ant>
+              </tasks>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+        <dependencies>
+          <dependency>
+            <groupId>ant</groupId>
+            <artifactId>ant-antlr</artifactId>
+            <version>1.6.5</version>
+          </dependency>
+          <dependency>
+            <groupId>antlr</groupId>
+            <artifactId>antlrall</artifactId>
+            <version>2.7.4</version>
+          </dependency>
+        </dependencies>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>

Propchange: maven/plugins/trunk/maven-antrun-plugin/src/it/test6/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-antrun-plugin/src/it/test6/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"