Author: centic
Date: Tue Jun 16 05:42:36 2015
New Revision: 1685705

URL: http://svn.apache.org/r1685705
Log:
Bug 57963: Add a task to the integration-test build which verifies that most 
examples can be built without scratchpad.jar

Modified:
    poi/trunk/src/integrationtest/build.xml

Modified: poi/trunk/src/integrationtest/build.xml
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/integrationtest/build.xml?rev=1685705&r1=1685704&r2=1685705&view=diff
==============================================================================
--- poi/trunk/src/integrationtest/build.xml (original)
+++ poi/trunk/src/integrationtest/build.xml Tue Jun 16 05:42:36 2015
@@ -19,7 +19,12 @@ under the License.
 -->
 <project name="POI Testbuild" default="run" basedir=".">
 
-    <description>Test-Ant file which verifies that the Apache POI distribution 
build sources can be compiled successfully.</description>
+    <description>Test-Ant file which verifies that the Apache POI distribution 
build sources can be compiled successfully.
+       
+       Before running this, you should execute the "assemble" target in the 
main build.xml to have the packaged files
+       created correctly.
+
+    </description>
     
     <property name="dist" value="../../build/dist"/>
     <property name="build" value="../../build/distsourcebuild"/>
@@ -27,12 +32,14 @@ under the License.
     <target name="init" depends="">
     </target>
     
-    <target name="run" depends="init">
+    <target name="run" depends="init,runSourceBuild,runCompileTest"/>
+       
+    <target name="runSourceBuild" depends="init">
         <!-- clean out old stuff in build-dir -->
         <delete dir="${build}"/>
         <mkdir dir="${build}"/>
 
-        <!-- select latest biult source zip -->
+        <!-- select latest built source zip -->
         <pathconvert property="srcpackage">
             <last>
                 <sort>
@@ -60,4 +67,79 @@ under the License.
         <echo message="Building in temporary dir ${dirversion}/"/>
         <ant dir="${dirversion}" target="jar" inheritAll="false" 
inheritRefs="false" useNativeBasedir="true"/>
     </target>
+
+    <target name="runCompileTest" depends="init" description="Verify that we 
can compile most examples without including excelant or scratchpad jars">
+        <!-- clean out old stuff in build-dir -->
+        <delete dir="${build}"/>
+        <mkdir dir="${build}"/>
+               
+        <!-- select latest built jar files without scratchpad.jar -->
+        <pathconvert property="jarpackage">
+                       <sort>
+                               <resources>
+                                       <fileset dir="${dist}">
+                                               <include name="poi-3.*.jar" />
+                                               <include 
name="poi-ooxml-3.*.jar" />
+                                               <include 
name="poi-ooxml-schemas-3.*.jar" />
+                                               <exclude name="*-javadocs-*" />
+                                               <exclude name="*-sources-*" />
+                                       </fileset>
+                               </resources>
+                       </sort>
+        </pathconvert>
+
+        <echo message="Found jar packages at ${jarpackage}"/>
+
+               <path id="libs">
+                       <fileset dir="../../lib">
+                               <include name="junit*.jar" />
+                       </fileset>
+                       <fileset dir="../../ooxml-lib">
+                               <include name="ooxml-schemas-*.jar" />
+                               <include name="xmlbeans-*.jar" />
+                               <exclude name="xmlbeans-2.3.*.jar" />
+                       </fileset>
+               </path>
+
+               <echo message="Compiling examples without linking to 
scratchpad.jar to ensure that only some specific ones require this jar" />
+               <javac srcdir="../examples/src" destdir="${build}"
+                       target="1.6"
+            source="1.6"
+            debug="trye"
+            encoding="ASCII"
+            fork="yes"
+            includeantruntime="false"
+                       
excludes="org/apache/poi/hslf/**,org/apache/poi/hsmf/**,**/EmbeddedObjects.java,**/EmeddedObjects.java,**/Word2Forrest.java"
+                       classpath="${jarpackage}"
+                       classpathref="libs">
+        </javac>
+               
+        <!-- select latest built jar files with additionally scratchpad.jar -->
+        <pathconvert property="jarpackagescratchpad">
+                       <sort>
+                               <resources>
+                                       <fileset dir="${dist}">
+                                               <include name="poi-3.*.jar" />
+                                               <include 
name="poi-ooxml-3.*.jar" />
+                                               <include 
name="poi-ooxml-schemas-3.*.jar" />
+                                               <include 
name="poi-scratchpad-3.*.jar" />
+                                               <exclude name="*-javadocs-*" />
+                                               <exclude name="*-sources-*" />
+                                       </fileset>
+                               </resources>
+                       </sort>
+        </pathconvert>
+
+               <echo message="Compiling all examples with the additinal 
scratchpad.jar" />
+               <javac srcdir="../examples/src" destdir="${build}"
+                       target="1.6"
+            source="1.6"
+            debug="trye"
+            encoding="ASCII"
+            fork="yes"
+            includeantruntime="false"
+                       classpath="${jarpackagescratchpad}"
+                       classpathref="libs">
+        </javac>
+    </target>
 </project>



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to