You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2005/01/29 00:56:25 UTC

svn commit: r148954 - /jakarta/commons/sandbox/feedparser/trunk/build.xml

Author: burton
Date: Fri Jan 28 15:56:24 2005
New Revision: 148954

URL: http://svn.apache.org/viewcvs?view=rev&rev=148954
Log:
accepted patches to refactor build.xml with Joseph Ottingers patches ...
Modified:
   jakarta/commons/sandbox/feedparser/trunk/build.xml

Modified: jakarta/commons/sandbox/feedparser/trunk/build.xml
Url: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/feedparser/trunk/build.xml?view=diff&rev=148954&p1=jakarta/commons/sandbox/feedparser/trunk/build.xml&r1=148953&p2=jakarta/commons/sandbox/feedparser/trunk/build.xml&r2=148954
==============================================================================
--- jakarta/commons/sandbox/feedparser/trunk/build.xml	(original)
+++ jakarta/commons/sandbox/feedparser/trunk/build.xml	Fri Jan 28 15:56:24 2005
@@ -1,21 +1,6 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 
-<project name="feedparser" default="jakarta-feedparser.jar" basedir=".">
-
-    <property environment="env"/>
-
-    <property file="build.properties"/>
-
-    <property name="project" value="feedparser"/>
-
-    <property name="version.major" value="0"/>
-    <property name="version.minor" value="5"/>
-    <property name="version.sub" value="0"/>
-    <property name="version.desc" value="beta"/>
-
-    <property name="docs.dest" value="./site"/>
-    <property name="docs.src" value="./xdocs"/>
-
+<project name="feedparser" default="jar" basedir=".">
     <property name="jakarta.site2.home" location="../jakarta-site2"/>
 
     <path id="anakia.classpath">
@@ -25,158 +10,157 @@
     </path>
 
     <path id="project.classpath">
-
         <fileset dir="lib">
-
-             <include name="*.jar"/>
-
-        </fileset>
-
-        <!-- This is not a good idea.  These libs should go in the ant home dir
-             
-        <fileset dir="${ext.lib.path}">
-             <include name="*.jar"/>
+            <include name="*.jar"/>
         </fileset>
-         -->
+    </path>
 
-        <fileset dir="${ant.home}/lib">
+    <path id="junit.classpath">
+        <path refid="project.classpath"/>
+        <fileset dir="build">
             <include name="*.jar"/>
         </fileset>
-
     </path>
 
-    <!-- ant-contrib tasks path http://ant-contrib.sourceforge.net;
-         this includes custom tags, such as an 'if' tag -->
-    <property name="ant-contrib.jar" value="./lib/ant-contrib-0.6.jar"/>
-    <taskdef resource="net/sf/antcontrib/antcontrib.properties">
-        <classpath>
-            <pathelement location="${ant-contrib.jar}"/>
-        </classpath>
-    </taskdef>
-
-    <taskdef name="junit"
-             classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask"/>
-
-    <target name="compile">
-
-        <mkdir dir="compile"/>
-
-        <javac srcdir="src/java/"
-               classpathref="project.classpath"
-               destdir="compile"
-               debug="true"/>
-
-    </target>
-    
-    <target name="clean">
-        <delete dir="compile"/>
-    </target>
-
-    <target name="clobber">
-        <delete dir="compile"/>
-    </target>
-
-    <target name="jakarta-feedparser.jar" depends="compile">
-
-        <mkdir dir="lib"/>
-
-        <jar compress="yes" jarfile="lib/jakarta-feedparser.jar">
-
-            <fileset dir="compile">
-
-                <include name="org/**"/>
-                <include name="feedparser/**"/>
-                <include name="*.class"/>
-
+    <target name="init">
+        <available property="junit.available" classname="junit.framework.TestCase"/>
+        <property name="compile.dir" value="compile"/>
+        <property name="dist.dir" value="dist"/>
+        <property name="junit.dir" value="junit"/>
+        <property name="src.dir" value="src"/>
+        <property environment="env"/>
+        <property file="build.properties"/>
+        <property name="project" value="feedparser"/>
+        <property name="version.major" value="0"/>
+        <property name="version.minor" value="5"/>
+        <property name="version.sub" value="0"/>
+        <property name="version.desc" value="beta"/>
+        <property name="docs.dest" value="./site"/>
+        <property name="docs.src" value="./xdocs"/>
+    </target>
+
+    <target name="prep" depends="init">
+        <mkdir dir="${dist.dir}"/>
+        <mkdir dir="${compile.dir}"/>
+        <mkdir dir="${junit.dir}"/>
+    </target>
+
+    <target name="compile.main" depends="prep">
+        <javac srcdir="${src.dir}/java/"
+            classpathref="project.classpath"
+            destdir="${compile.dir}"
+            debug="true"
+            excludes="org/apache/commons/feedparser/test/**">
+        </javac>
+    </target>
+
+    <target name="compile.test" depends="prep" if="junit.available">
+        <javac srcdir="${src.dir}/java/"
+            classpathref="junit.classpath"
+            destdir="${junit.dir}"
+            debug="true"
+            includes="org/apache/commons/feedparser/test/**">
+        </javac>
+    </target>
+
+    <target name="clean" depends="init">
+        <delete dir="${dist.dir}"/>
+        <delete dir="${compile.dir}"/>
+        <delete dir="${junit.dir}"/>
+    </target>
+
+    <target name="jar" depends="compile.main">
+        <mkdir dir="${dist.dir}"/>
+        <jar compress="yes" jarfile="${dist.dir}/jakarta-feedparser.jar">
+            <fileset dir="${compile.dir}">
             </fileset>
-
         </jar>
 
     </target>
 
     <target name="run-example" description="Runs the example feed parser class"
-            depends="jakarta-feedparser.jar">
-       <java classpathref="project.classpath"
-             classname="org.apache.commons.feedparser.example.HelloFeedParser"
-             fork="true"
-             failonerror="true">
-       </java>
+        depends="jar">
+        <java classpathref="project.classpath"
+            classname="org.apache.commons.feedparser.example.HelloFeedParser"
+            fork="true"
+            failonerror="true">
+        </java>
     </target>
 
     <target name="debug-feed" description="Debugs a feed"
-            depends="jakarta-feedparser.jar">
-       <java classpathref="project.classpath"
-             classname="org.apache.commons.feedparser.Main"
-             fork="true"
-             failonerror="true">
-          <arg value="${feed-url}"/>
-       </java>
+        depends="jar">
+        <java classpathref="project.classpath"
+            classname="org.apache.commons.feedparser.Main"
+            fork="true"
+            failonerror="true">
+            <arg value="${feed-url}"/>
+        </java>
     </target>
 
     <target name="test-autodiscover" description="Runs the testing class for autodiscovery"
-            depends="jakarta-feedparser.jar">
+        depends="jar">
 
-       <java classpathref="project.classpath"
-             classname="org.apache.commons.feedparser.locate.TestFeedLocator"
-             fork="true"
-             failonerror="true">
+        <java classpathref="project.classpath"
+            classname="org.apache.commons.feedparser.locate.TestFeedLocator"
+            fork="true"
+            failonerror="true">
 
             <sysproperty key="feedparser.home" value="${feedparser.home}"/>
 
-       </java>
+        </java>
 
     </target>
 
     <target name="test-probing" description="Runs the testing class for aggresive probing"
-                depends="jakarta-feedparser.jar">
+        depends="jar">
 
-       <java classpathref="project.classpath"
-             classname="org.apache.commons.feedparser.test.TestProbeLocator"
-             fork="true"
-             failonerror="true">
+        <java classpathref="project.classpath"
+            classname="org.apache.commons.feedparser.test.TestProbeLocator"
+            fork="true"
+            failonerror="true">
 
-          <sysproperty key="feedparser.home" value="${feedparser.home}"/>
+            <sysproperty key="feedparser.home" value="${feedparser.home}"/>
 
-       </java>
+        </java>
 
     </target>
 
-    <target name="test" depends="jakarta-feedparser.jar" description="Run junit tests.">
+    <target name="test" depends="jar,compile.test" description="Run junit tests." if="junit.available">
         <junit printsummary="withOutAndErr"
-               fork="true"
-               filtertrace="true"
-               haltonfailure="true"
-               haltonerror="true">
+            fork="true"
+            filtertrace="true"
+            haltonfailure="true"
+            haltonerror="false">
             <sysproperty key="feedparser.home" value="${feedparser.home}"/>
-            <classpath refid="project.classpath"/>
+            <classpath>
+                <path refid="project.classpath"/>
+                <pathelement location="${compile.dir}"/>
+                <pathelement location="${junit.dir}"/>
+            </classpath>
             <formatter type="plain" usefile="false"/>
-            <test name="org.apache.commons.feedparser.test.TestFeedFilter"/>
-            <test name="org.apache.commons.feedparser.test.TestAtom"/>
-            <test name="org.apache.commons.feedparser.test.TestFeedParserUTF8"/>
-            <test name="org.apache.commons.feedparser.test.TestFeedLocator"
-                  unless="test.only.local"/>
-            <test name="org.apache.commons.feedparser.test.TestProbeLocator"
-                  unless="test.only.local"/>
+            <batchtest>
+                <fileset dir="${src.dir}/java">
+                    <include name="**/Test*.java"/>
+                    <exclude name="**/Test.java" />
+                </fileset>
+            </batchtest>
         </junit>
     </target>
 
-    <target name="javadoc">
+    <target name="javadoc" depends="init">
 
         <mkdir dir="${build.dir}/docs/api"/>
 
-        <!-- FIXME: this isn't building subpackages for the feedparser -->
-        <!-- FIXME: this isn't building subpackages for the feedparser -->
-        <!-- FIXME: this isn't building subpackages for the feedparser -->
         <javadoc sourcepath="src/java"
-                 packagenames="org.apache.commons.feedparser.*"
-                 destdir="docs/api"
-                 author="true"
-                 version="true"
-                 use="true"
-                 link="${javadoc.link}"
-                 windowtitle="${Name} ${version} API"
-                 doctitle="${Name} ${version} API"
-                 bottom="Copyright &amp;copy; ${year} Apache Software Foundation.  All Rights Reserved.">
+            packagenames="org.apache.commons.feedparser.*"
+            destdir="docs/api"
+            author="true"
+            version="true"
+            use="true"
+            link="${javadoc.link}"
+            windowtitle="${Name} ${version} API"
+            doctitle="${Name} ${version} API"
+            bottom="Copyright &amp;copy; ${year} Apache Software Foundation.  All Rights Reserved.">
         </javadoc>
     </target>
 
@@ -185,20 +169,20 @@
         <!-- anakia config borrowed from Lucene -->
 
         <taskdef name="anakia"
-                 classname="org.apache.velocity.anakia.AnakiaTask"
-                 classpathref="anakia.classpath">
+            classname="org.apache.velocity.anakia.AnakiaTask"
+            classpathref="anakia.classpath">
 
         </taskdef>
 
         <anakia basedir="xdocs"
-                destdir="docs/"
-                extension=".html"
-                style="./site.vsl"
-                projectFile="stylesheets/project.xml"
-                excludes="**/stylesheets/** empty.xml"
-                includes="**/*.xml"
-                lastModifiedCheck="true"
-                templatePath="${jakarta.site2.home}/xdocs/stylesheets"/>
+            destdir="docs/"
+            extension=".html"
+            style="./site.vsl"
+            projectFile="stylesheets/project.xml"
+            excludes="**/stylesheets/** empty.xml"
+            includes="**/*.xml"
+            lastModifiedCheck="true"
+            templatePath="${jakarta.site2.home}/xdocs/stylesheets"/>
 
     </target>
 
@@ -265,6 +249,6 @@
         <echo message="JARs are located that are not bundled with the "/>
         <echo message="Jakarta Feed Parser, such as junit.jar."/>
 
-      </target>
+    </target>
 
 </project>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org