]> source.dussan.org Git - poi.git/commitdiff
Bug 57904: Add full source build from dist-packages to CI builds
authorDominik Stadler <centic@apache.org>
Sun, 31 May 2015 20:11:28 +0000 (20:11 +0000)
committerDominik Stadler <centic@apache.org>
Sun, 31 May 2015 20:11:28 +0000 (20:11 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1682786 13f79535-47bb-0310-9956-ffa450edef68

src/integrationtest/build.xml [new file with mode: 0644]

diff --git a/src/integrationtest/build.xml b/src/integrationtest/build.xml
new file mode 100644 (file)
index 0000000..1a5e940
--- /dev/null
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>
+<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>
+    
+    <property name="dist" value="../../build/dist"/>
+    <property name="build" value="../../build/distsourcebuild"/>
+    
+    <target name="init" depends="">
+    </target>
+    
+    <target name="run" depends="init">
+        <!-- clean out old stuff in build-dir -->
+        <delete dir="${build}"/>
+        <mkdir dir="${build}"/>
+
+        <!-- select latest biult source zip -->
+        <pathconvert property="srcpackage">
+            <last>
+                <sort>
+                    <date xmlns="antlib:org.apache.tools.ant.types.resources.comparators"/>
+                    <resources>
+                        <fileset dir="${dist}">
+                            <include name="poi-src-*.zip" />
+                        </fileset>
+                    </resources>
+                </sort>
+            </last>
+        </pathconvert>
+
+        <echo message="Found source package at ${srcpackage}"/>
+        <unzip src="${srcpackage}" dest="${build}" failOnEmptyArchive="true"/>
+
+        <!-- look for name of sub-dir, do this dynamically as it changes with every (beta|rc)-release -->
+        <pathconvert property="dirversion">
+            <dirset dir="${build}">
+                <include name="*" />
+            </dirset>
+        </pathconvert>
+
+        <!-- finally call Ant on the extracted source to check if we can build the packages -->
+        <echo message="Building in temporary dir ${dirversion}/"/>
+        <ant dir="${dirversion}" target="jar" inheritAll="false" inheritRefs="false" useNativeBasedir="true"/>
+    </target>
+</project>