You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ju...@apache.org on 2009/03/26 16:37:33 UTC
svn commit: r758688 - in /incubator/pdfbox/fontbox/trunk: build.xml
lib/checkstyle-all-4.2.jar
Author: jukka
Date: Thu Mar 26 15:37:24 2009
New Revision: 758688
URL: http://svn.apache.org/viewvc?rev=758688&view=rev
Log:
PDFBOX-437: Prepare JempBox and FontBox for release
Automatically download Checkstyle when it's not already available. (Can't include it in svn as it's LGPL software).
Removed:
incubator/pdfbox/fontbox/trunk/lib/checkstyle-all-4.2.jar
Modified:
incubator/pdfbox/fontbox/trunk/build.xml
Modified: incubator/pdfbox/fontbox/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/pdfbox/fontbox/trunk/build.xml?rev=758688&r1=758687&r2=758688&view=diff
==============================================================================
--- incubator/pdfbox/fontbox/trunk/build.xml (original)
+++ incubator/pdfbox/fontbox/trunk/build.xml Thu Mar 26 15:37:24 2009
@@ -28,6 +28,7 @@
<property name="website.build.dir" value="${website.dir}/build/site" />
<property name="docs.dir" value="${website.dir}/build/site/javadoc" />
<property name="lib.dir" value="lib" />
+ <property name="tool.dir" value="tools" />
<property name="licenses.dir" value="licenses" />
<property name="dist.dir" value="dist" />
<property name="resources.dir" value="Resources" />
@@ -36,8 +37,16 @@
<property name="project.name" value="fontbox"/>
<property name="project.version" value="0.8.0-incubating-dev" />
- <property name="checkstyle.jar.dir" value="lib" />
- <property name="checkstyle.jar" value="${checkstyle.jar.dir}/checkstyle-all-*.jar" />
+ <property name="maven.repo" value="http://repo2.maven.org/maven2" />
+
+ <property name="checkstyle.url" value="${maven.repo}/checkstyle/checkstyle/4.4/checkstyle-4.4.jar" />
+ <property name="checkstyle.jar" value="${tool.dir}/checkstyle.jar" />
+ <property name="beanutils.url" value="${maven.repo}/commons-beanutils/commons-beanutils-core/1.7.0/commons-beanutils-core-1.7.0.jar" />
+ <property name="beanutils.jar" value="${tool.dir}/commons-beanutils.jar" />
+ <property name="logging.url" value="${maven.repo}/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar" />
+ <property name="logging.jar" value="${tool.dir}/commons-logging.jar" />
+ <property name="antlr.url" value="${maven.repo}/antlr/antlr/2.7.6/antlr-2.7.6.jar" />
+ <property name="antlr.jar" value="${tool.dir}/antlr.jar" />
<property name="junit.jar.dir" value="lib"/>
<property name="junit.jar" value="${junit.jar.dir}/junit.jar" />
@@ -51,6 +60,49 @@
<pathelement path="." />
</path>
+ <path id="checkstyle.classpath">
+ <pathelement path="${checkstyle.jar}" />
+ <pathelement path="${beanutils.jar}" />
+ <pathelement path="${logging.jar}" />
+ <pathelement path="${antlr.jar}" />
+ </path>
+
+ <target name="testexist">
+ <echo message="Testing for ${destfile}" level="debug"/>
+ <available file="${destfile}" property="exist"/>
+ </target>
+ <target name="downloadfile" unless="exist" depends="testexist">
+ <dirname property="destdir" file="${destfile}"/>
+ <mkdir dir="${destdir}"/>
+ <get src="${sourcefile}" dest="${destfile}"/>
+ </target>
+
+ <target name="find.checkstyle">
+ <available property="checkstyle.found"
+ classname="com.puppycrawl.tools.checkstyle.CheckStyleTask"
+ classpathref="checkstyle.classpath"/>
+ </target>
+
+ <target name="get.checkstyle"
+ unless="checkstyle.found" depends="find.checkstyle">
+ <antcall target="downloadfile">
+ <param name="sourcefile" value="${checkstyle.url}"/>
+ <param name="destfile" value="${checkstyle.jar}"/>
+ </antcall>
+ <antcall target="downloadfile">
+ <param name="sourcefile" value="${beanutils.url}"/>
+ <param name="destfile" value="${beanutils.jar}"/>
+ </antcall>
+ <antcall target="downloadfile">
+ <param name="sourcefile" value="${logging.url}"/>
+ <param name="destfile" value="${logging.jar}"/>
+ </antcall>
+ <antcall target="downloadfile">
+ <param name="sourcefile" value="${antlr.url}"/>
+ <param name="destfile" value="${antlr.jar}"/>
+ </antcall>
+ </target>
+
<target name="clean" description="Remove all generated files">
<delete failonerror="false">
<fileset dir="${dest.dir}"/>
@@ -87,22 +139,16 @@
</junit>
</target>
- <target name="checkstyle" depends="compile">
- <!--
- This doesn't work when run from netbeans for some reason-->
+ <target name="checkstyle" depends="compile,get.checkstyle">
+ <!-- This doesn't work when run from netbeans for some reason -->
<taskdef name="checkstyle"
classname="com.puppycrawl.tools.checkstyle.CheckStyleTask"
- classpathref="build.classpath" />
- <checkstyle config="${checkstyle.config}" classpathref="build.classpath" failOnViolation="false">
+ classpathref="checkstyle.classpath" />
+ <checkstyle config="${checkstyle.config}"
+ classpathref="checkstyle.classpath"
+ failOnViolation="false">
<fileset dir="${src.dir}" />
</checkstyle>
- <!--<java fork="yes" failonerror="yes" classname="com.puppycrawl.tools.checkstyle.Main"
- classpathref="build.classpath">
- <arg value="-p" />
- <arg value="${checkstyle.properties}" />
- <arg value="-r" />
- <arg value="${src.dir}" />
- </java>-->
</target>
<target name="package" depends="compile" description="Package fontbox">