Skip to content

Commit

Permalink
Move plsql into own sub-module
Browse files Browse the repository at this point in the history
  • Loading branch information
adangel committed Oct 4, 2014
1 parent a8ef0ec commit 802af05
Show file tree
Hide file tree
Showing 98 changed files with 271 additions and 59 deletions.
File renamed without changes.
185 changes: 185 additions & 0 deletions pmd-plsql/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>pmd-plsql</artifactId>
<name>PMD PL/SQL</name>

<parent>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-aggregate</artifactId>
<version>5.1.4-SNAPSHOT</version>
</parent>

<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<useDefaultDelimiters>false</useDefaultDelimiters>
<delimiters>
<delimiter>${*}</delimiter>
</delimiters>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<inherited>true</inherited>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<target>
<ant antfile="src/main/ant/alljavacc.xml">
<property name="target" value="${project.build.directory}/generated-sources/javacc" />
<property name="javacc.jar" value="${settings.localRepository}/net/java/dev/javacc/javacc/${javacc.version}/javacc-${javacc.version}.jar" />
</ant>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-javacc-generated-sources</id>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources/javacc</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>

<!-- As Clover can be quite an hassle, know that you can skip
it by using the following option when running mvn: $ mvn clean -Dmaven.clover.skip=true
site -->
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-clover2-plugin</artifactId>
<configuration>
<jdk>${java.version}</jdk>
<licenseLocation>${basedir}/../pmd/licences/clover2.license</licenseLocation>
</configuration>
<executions>
<execution>
<phase>pre-site</phase>
<goals>
<goal>instrument</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<configuration>
<xdocDirectory>${project.build.directory}/generated-xdocs</xdocDirectory>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-test</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-testutil</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<exclusions>
<exclusion>
<artifactId>xercesImpl</artifactId>
<groupId>xerces</groupId>
</exclusion>
<exclusion>
<artifactId>xalan</artifactId>
<groupId>xalan</groupId>
</exclusion>
<exclusion>
<artifactId>icu4j</artifactId>
<groupId>com.ibm.icu</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.beust</groupId>
<artifactId>jcommander</artifactId>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
</dependency>
<dependency>
<groupId>net.sourceforge.saxon</groupId>
<artifactId>saxon</artifactId>
</dependency>
<dependency>
<groupId>net.sourceforge.saxon</groupId>
<artifactId>saxon</artifactId>
<classifier>dom</classifier>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.java.dev.javacc</groupId>
<artifactId>javacc</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
82 changes: 82 additions & 0 deletions pmd-plsql/src/main/ant/alljavacc.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<project name="pmd" default="alljavacc" basedir="../../">

<property name="javacc-home.path" value="target/lib" />

<target name="alljavacc"
description="Generates all JavaCC aspects within PMD"
depends="checkUpToDate,init,plsqljjtree,cleanup" />

<target name="checkUpToDate">
<uptodate property="javaccBuildNotRequired" targetfile="${target}/last-generated-timestamp">
<srcfiles dir="etc/grammar" includes="*.jj*"/>
</uptodate>
<echo message="up to date check: javaccBuildNotRequired=${javaccBuildNotRequired}"/>
</target>

<target name="init" unless="javaccBuildNotRequired">
<mkdir dir="${javacc-home.path}" />
<copy file="${javacc.jar}" tofile="${javacc-home.path}/javacc.jar" />

<mkdir dir="${target}"/>
<touch file="${target}/last-generated-timestamp"/>
</target>

<target name="cleanup">
<delete dir="${javacc-home.path}" />
</target>

<target name="plsqljjtree" description="Generates the PlSQL parser and AST source files" unless="javaccBuildNotRequired">
<delete dir="${target}/net/sourceforge/pmd/lang/plsql/ast" />
<mkdir dir="${target}/net/sourceforge/pmd/lang/plsql/ast" />
<jjtree target="etc/grammar/PldocAST.jjt"
outputdirectory="${target}/net/sourceforge/pmd/lang/plsql/ast"
javacchome="${javacc-home.path}" />
<!-- Ensure generated using CharStream interface -->
<javacc static="false"
usercharstream="false"
target="${target}/net/sourceforge/pmd/lang/plsql/ast/PldocAST.jj"
outputdirectory="${target}/net/sourceforge/pmd/lang/plsql/ast"
javacchome="${javacc-home.path}" />

<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/SimpleNode.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/Node.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/SimpleCharStream.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/TokenMgrError.java" />

<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTArguments.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTDatatype.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTFormalParameter.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTIfStatement.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTInput.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTMethodDeclaration.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTMethodDeclarator.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTName.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTPackageBody.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTPackageSpecification.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTPrimaryPrefix.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTPrimarySuffix.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTProgramUnit.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTTriggerTimingPointSection.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTTriggerUnit.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTTypeMethod.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTTypeSpecification.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTVariableOrConstantDeclaratorId.java" />

<replace file="${target}/net/sourceforge/pmd/lang/plsql/ast/PLSQLParserVisitor.java"
token="SimpleNode"
value="PLSQLNode" />
<replace file="${target}/net/sourceforge/pmd/lang/plsql/ast/PLSQLParserTokenManager.java"
token="class PLSQLParserTokenManager"
value="class PLSQLParserTokenManager extends net.sourceforge.pmd.lang.ast.AbstractTokenManager" />
<replace file="${target}/net/sourceforge/pmd/lang/plsql/ast/JJTPLSQLParserState.java">
<replacetoken>public class</replacetoken>
<replacevalue><![CDATA[import net.sourceforge.pmd.lang.ast.Node;
public class]]></replacevalue>
</replace>
<replace file="${target}/net/sourceforge/pmd/lang/plsql/ast/ParseException.java"
token="extends Exception"
value="extends net.sourceforge.pmd.lang.ast.ParseException" />

</target>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
net.sourceforge.pmd.lang.plsql.PLSQLLanguageModule
57 changes: 1 addition & 56 deletions pmd/src/main/ant/alljavacc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<target name="alljavacc"
description="Generates all JavaCC aspects within PMD"
depends="checkUpToDate,init,dummyjjtree,jspjjtree,cppjavacc,plsqljjtree,cleanup" />
depends="checkUpToDate,init,dummyjjtree,jspjjtree,cppjavacc,cleanup" />

<target name="checkUpToDate">
<uptodate property="javaccBuildNotRequired" targetfile="${target}/last-generated-timestamp">
Expand Down Expand Up @@ -102,61 +102,6 @@

</target>

<target name="plsqljjtree" description="Generates the PlSQL parser and AST source files" unless="javaccBuildNotRequired">
<delete dir="${target}/net/sourceforge/pmd/lang/plsql/ast" />
<mkdir dir="${target}/net/sourceforge/pmd/lang/plsql/ast" />
<jjtree target="etc/grammar/PldocAST.jjt"
outputdirectory="${target}/net/sourceforge/pmd/lang/plsql/ast"
javacchome="${javacc-home.path}" />
<!-- Ensure generated using CharStream interface -->
<javacc static="false"
usercharstream="false"
target="${target}/net/sourceforge/pmd/lang/plsql/ast/PldocAST.jj"
outputdirectory="${target}/net/sourceforge/pmd/lang/plsql/ast"
javacchome="${javacc-home.path}" />

<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/SimpleNode.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/Node.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/SimpleCharStream.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/TokenMgrError.java" />

<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTArguments.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTDatatype.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTFormalParameter.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTIfStatement.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTInput.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTMethodDeclaration.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTMethodDeclarator.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTName.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTPackageBody.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTPackageSpecification.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTPrimaryPrefix.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTPrimarySuffix.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTProgramUnit.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTTriggerTimingPointSection.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTTriggerUnit.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTTypeMethod.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTTypeSpecification.java" />
<delete file="${target}/net/sourceforge/pmd/lang/plsql/ast/ASTVariableOrConstantDeclaratorId.java" />

<replace file="${target}/net/sourceforge/pmd/lang/plsql/ast/PLSQLParserVisitor.java"
token="SimpleNode"
value="PLSQLNode" />
<replace file="${target}/net/sourceforge/pmd/lang/plsql/ast/PLSQLParserTokenManager.java"
token="class PLSQLParserTokenManager"
value="class PLSQLParserTokenManager extends net.sourceforge.pmd.lang.ast.AbstractTokenManager" />
<replace file="${target}/net/sourceforge/pmd/lang/plsql/ast/JJTPLSQLParserState.java">
<replacetoken>public class</replacetoken>
<replacevalue><![CDATA[import net.sourceforge.pmd.lang.ast.Node;
public class]]></replacevalue>
</replace>
<replace file="${target}/net/sourceforge/pmd/lang/plsql/ast/ParseException.java"
token="extends Exception"
value="extends net.sourceforge.pmd.lang.ast.ParseException" />

</target>

<target name="jspjjtree" description="Generates the JSP parser and AST source files" unless="javaccBuildNotRequired">
<delete dir="${target}/net/sourceforge/pmd/lang/jsp/ast/" />
<mkdir dir="${target}/net/sourceforge/pmd/lang/jsp/ast/" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import net.sourceforge.pmd.lang.LanguageRegistry;
import net.sourceforge.pmd.lang.LanguageVersion;
import net.sourceforge.pmd.lang.ast.ParseException;
import net.sourceforge.pmd.lang.plsql.PLSQLLanguageModule;
import net.sourceforge.pmd.util.viewer.model.ViewerModel;
import net.sourceforge.pmd.util.viewer.model.ViewerModelEvent;
import net.sourceforge.pmd.util.viewer.model.ViewerModelListener;
Expand Down Expand Up @@ -138,7 +137,7 @@ private LanguageVersion getLanguageVersion() {
} else if (jdk17MenuItem.isSelected()) {
return LanguageRegistry.getLanguage(javaName).getVersion("1.7");
} else if (plsqlMenuItem.isSelected()) {
return LanguageRegistry.getLanguage(PLSQLLanguageModule.NAME).getDefaultVersion();
return LanguageRegistry.getLanguage("PLSQL").getDefaultVersion();
}
return LanguageRegistry.getLanguage(javaName).getVersion("1.5");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ net.sourceforge.pmd.lang.cpp.CppLanguageModule
net.sourceforge.pmd.lang.fortran.FortranLanguageModule
net.sourceforge.pmd.lang.jsp.JspLanguageModule
net.sourceforge.pmd.lang.php.PhpLanguageModule
net.sourceforge.pmd.lang.plsql.PLSQLLanguageModule
net.sourceforge.pmd.lang.ruby.RubyLanguageModule
net.sourceforge.pmd.lang.xml.XmlLanguageModule
net.sourceforge.pmd.lang.xsl.XslLanguageModule
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@
<module>pmd-java</module>
<module>pmd-javascript</module>
<module>pmd-vm</module>
<module>pmd-plsql</module>
<module>pmd-dist</module>
</modules>
</project>

0 comments on commit 802af05

Please sign in to comment.