velocity-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cbris...@apache.org
Subject svn commit: r1861507 - /velocity/engine/branches/parser_experiments/velocity-custom-parser-example/pom.xml
Date Mon, 17 Jun 2019 12:29:14 GMT
Author: cbrisson
Date: Mon Jun 17 12:29:14 2019
New Revision: 1861507

URL: http://svn.apache.org/viewvc?rev=1861507&view=rev
Log:
[engine][VELOCITY-917] Extend custom parser package handling to all generated parser files

Modified:
    velocity/engine/branches/parser_experiments/velocity-custom-parser-example/pom.xml

Modified: velocity/engine/branches/parser_experiments/velocity-custom-parser-example/pom.xml
URL: http://svn.apache.org/viewvc/velocity/engine/branches/parser_experiments/velocity-custom-parser-example/pom.xml?rev=1861507&r1=1861506&r2=1861507&view=diff
==============================================================================
--- velocity/engine/branches/parser_experiments/velocity-custom-parser-example/pom.xml (original)
+++ velocity/engine/branches/parser_experiments/velocity-custom-parser-example/pom.xml Mon
Jun 17 12:29:14 2019
@@ -97,6 +97,7 @@
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
             </plugin>
+
             <!-- extract raw parser grammar from velocity jar -->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -116,6 +117,7 @@
                     </execution>
                 </executions>
             </plugin>
+
             <!-- generate custom grammar file -->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -143,6 +145,7 @@
                     </execution>
                 </executions>
             </plugin>
+
             <!-- run javacc -->
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
@@ -158,7 +161,7 @@
                     <debugTokenManager>${parser.debug}</debugTokenManager>
                     <jdkVersion>${maven.compiler.target}</jdkVersion>
                     <nodeUsesParser>true</nodeUsesParser>
-                    <nodePackage>org.apache.velocity.runtime.parser.node</nodePackage>
+                    <nodePackage>${parser.package}.node</nodePackage>
                     <sourceDirectory>${project.build.directory}/parser/org/apache/velocity/runtime/parser</sourceDirectory>
                     <tokenManagerUsesParser>true</tokenManagerUsesParser>
                 </configuration>
@@ -177,6 +180,7 @@
                     </execution>
                 </executions>
             </plugin>
+
             <!-- Remove extra generated files we don't want -->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -215,6 +219,35 @@
                     </execution>
                 </executions>
             </plugin>
+
+            <!-- add missing imports to some parser generated files -->
+            <plugin>
+                <groupId>com.google.code.maven-replacer-plugin</groupId>
+                <artifactId>replacer</artifactId>
+                <executions>
+                    <execution>
+                        <id>patch-parser-files</id>
+                        <phase>process-sources</phase>
+                        <goals>
+                            <goal>replace</goal>
+                        </goals>
+                        <configuration>
+                            <includes>
+                                <include>${project.build.directory}/generated-sources/jjtree/**/JJT${parser.basename}ParserState.java</include>
+                                <include>${project.build.directory}/generated-sources/jjtree/**/${parser.basename}ParserVisitor.java</include>
+                            </includes>
+                            <replacements>
+                                <replacement>
+                                    <token>import ${parser.package}.*;</token>
+                                    <value>import ${parser.package}.*;
+import org.apache.velocity.runtime.parser.node.*;</value>
+                                </replacement>
+                            </replacements>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            
             <!-- tests -->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -249,20 +282,6 @@
                         </property>
                     </systemProperties>
                 </configuration>
-                <!--
-                <executions>
-                    <execution>
-                        <id>integration-test</id>
-                        <phase>integration-test</phase>
-                        <goals>
-                            <goal>test</goal>
-                        </goals>
-                        <configuration>
-                            <skip>false</skip>
-                        </configuration>
-                    </execution>
-                </executions>
-                -->
             </plugin>
         </plugins>
     </build>



Mime
View raw message