pmd (build): Add javacc as a dependency, tweak Ant script to use the Maven 2 repository (delete lib/*.jar are they no longer needed)

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7543 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Romain Pelisse
2011-12-07 00:15:12 +00:00
parent 97ded9b854
commit 2d1647774d
10 changed files with 16 additions and 60 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,57 +0,0 @@
<project name="Saxon repackaging" default="disable-saxon-transformerfactory" basedir=".">
<target name="disable-saxon-transformerfactory">
<description>
Re-jar Saxon to only exclude the file which allows Saxon to be the default TransformerFactory.
The reason to do this is that the open source versio of Saxon we are using is not Schema aware.
This causes problems for JUnit tests, and perhaps for anyone elese which is using PMD.
</description>
<antcall target="extract-saxon" />
<delete file="saxon9-temp.jar" />
<jar jarfile="saxon9-temp.jar">
<fileset dir="temp">
<include name="**" />
<exclude name="META-INF/services/javax.xml.transform.TransformerFactory" />
</fileset>
</jar>
<move file="saxon9-temp.jar" tofile="saxon9.jar" />
<antcall target="clean" />
</target>
<target name="minimize-saxon">
<description>
Re-jar Saxon to be as small as possible, only including those parts which are needed by PMD.
PMD only uses Saxon as an XPath engine, not as a full blown XSLT engine.
</description>
<antcall target="extract-saxon" />
<jar jarfile="saxon9.jar">
<fileset dir="temp">
<include name="**/saxon/Configuration*.class" />
<!--
<include name="**/saxon/OutputURIResolver.class" />
-->
<include name="**/saxon/SourceResolver*.class" />
<include name="**/saxon/expr/**" />
<include name="**/saxon/event/Receiver*.class" />
<include name="**/saxon/evpull/PullEvent*.class" />
<include name="**/saxon/functions/**" />
<include name="**/saxon/om/**" />
<include name="**/saxon/pattern/NodeTest*.class" />
<include name="**/saxon/trans/XPathException*.class" />
<include name="**/saxon/type/**" />
<include name="**/saxon/value/**" />
</fileset>
</jar>
<antcall target="clean" />
</target>
<target name="extract-saxon">
<antcall target="clean" />
<unjar src="saxon9.jar" dest="temp" />
</target>
<target name="clean">
<delete dir="temp" />
</target>
</project>

Binary file not shown.

View File

@@ -230,6 +230,7 @@
<url>http://pmd.sourceforge.net/</url>
</organization>
<properties>
<javacc.version>4.1</javacc.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!--
This value actually differs to maven default expectation(src/site/xdoc/) as
@@ -295,6 +296,7 @@
</copy>
<ant antfile="src/main/ant/alljavacc.xml">
<property name="src" value="${project.build.sourceDirectory}"/>
<property name="javacc.jar" value="${settings.localRepository}/net/java/dev/javacc/javacc/${javacc.version}/javacc-${javacc.version}.jar"/>
</ant>
</tasks>
</configuration>
@@ -495,6 +497,11 @@
<type>jar</type>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>net.java.dev.javacc</groupId>
<artifactId>javacc</artifactId>
<version>${javacc.version}</version>
</dependency>
</dependencies>
<reporting>

View File

@@ -5,9 +5,15 @@
<target name="alljavacc" description="Generates all JavaCC aspects within PMD" depends="dummyjjtree,javajjtree,jspjjtree,cppjavacc"/>
<target name="dummyjjtree" description="Generates the reusable JavaCC aspects">
<delete dir="${src}/net/sourceforge/pmd/lang/ast/dummy" />
<mkdir dir="${src}/net/sourceforge/pmd/lang/ast/dummy" />
<target name="dummyjjtree" description="Generates the reusable JavaCC aspects">
<property name="javacc-home.path" value="${basedir}/javacchome"/>
<mkdir dir="${javacc-home.path}"/>
<copy file="${javacc.jar}" tofile="${javacc-home.path}/javacc.jar"/>
<delete dir="${src}/net/sourceforge/pmd/lang/ast/dummy" />
<mkdir dir="${src}/net/sourceforge/pmd/lang/ast/dummy" />
<echo>Using JavaCC home:"${javacc-home.path}</echo>
<jjtree target="etc/grammar/dummy.jjt" outputdirectory="${src}/net/sourceforge/pmd/lang/ast/dummy" javacchome="${javacc-home.path}" />
<!-- Generate CharStream interface -->