]> source.dussan.org Git - poi.git/commitdiff
65206 - Migrate ant / maven to gradle build
authorAndreas Beeker <kiwiwings@apache.org>
Sun, 28 Mar 2021 01:12:58 +0000 (01:12 +0000)
committerAndreas Beeker <kiwiwings@apache.org>
Sun, 28 Mar 2021 01:12:58 +0000 (01:12 +0000)
fix distsourcebuild

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1888121 13f79535-47bb-0310-9956-ffa450edef68

integrationtest/build.xml [new file with mode: 0644]
integrationtest/src/test/java/build.xml [deleted file]
jenkins/create_jobs.groovy

diff --git a/integrationtest/build.xml b/integrationtest/build.xml
new file mode 100644 (file)
index 0000000..f1b139a
--- /dev/null
@@ -0,0 +1,148 @@
+<?xml version="1.0"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+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.
+
+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"/>
+
+    <target name="init" depends="">
+    </target>
+
+    <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 built 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>
+
+        <!-- copy over required libs to avoid re-downloading them always -->
+        <mkdir dir="${dirversion}/lib"/>
+        <copy todir="${dirversion}/lib">
+            <fileset dir="../lib"/>
+        </copy>
+
+        <!-- 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="assemble" 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}" quiet="true" failonerror="false"/>
+        <!-- ... try again - on Windows, the JaCoCo ant task seems to keep files open and hence the lib directory can't be removed -->
+        <delete dir="${build}" quiet="true" failonerror="false"/>
+        <mkdir dir="${build}"/>
+
+        <!-- select latest built jar files without scratchpad.jar -->
+        <pathconvert property="jarpackage">
+            <sort>
+                <resources>
+                    <fileset dir="${dist}">
+                        <include name="**/poi-5.*.jar"/>
+                        <include name="**/poi-ooxml-5.*.jar"/>
+                        <include name="**/poi-ooxml-lite-5.*.jar"/>
+                        <exclude name="**/*-javadoc*"/>
+                        <exclude name="**/*-sources*"/>
+                    </fileset>
+                </resources>
+            </sort>
+        </pathconvert>
+
+        <fail message="Did not find jar packages looking in directory ${dist}">
+            <condition>
+                <or>
+                    <equals arg1="${jarpackage}" arg2=""/>
+                    <not>
+                        <isset property="jarpackage"/>
+                    </not>
+                </or>
+            </condition>
+        </fail>
+
+        <echo message="Found jar packages at ${jarpackage}, dist: ${dist}"/>
+        <path id="libs">
+            <fileset dir="../lib/main" includes="*.jar"/>
+            <fileset dir="../lib/ooxml" includes="*.jar"/>
+            <fileset dir="../lib/main-tests">
+                <include name="junit*.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/main/java" destdir="${build}"
+               target="1.8" source="1.8" debug="true"
+               encoding="ASCII" fork="yes" includeantruntime="false"
+               excludes="org/apache/poi/examples/hslf/**,org/apache/poi/examples/hsmf/**,org/apache/poi/examples/hwmf/**,**/EmbeddedObjects.java,**/EmeddedObjects.java,**/LoadEmbedded.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-5.*.jar"/>
+                        <include name="**/poi-ooxml-5.*.jar"/>
+                        <include name="**/poi-ooxml-lite-5.*.jar"/>
+                        <include name="**/poi-scratchpad-5.*.jar"/>
+                        <exclude name="**/*-javadoc*"/>
+                        <exclude name="**/*-sources*"/>
+                    </fileset>
+                </resources>
+            </sort>
+        </pathconvert>
+
+        <echo message="Compiling all examples with the additional scratchpad.jar"/>
+        <javac srcdir="../examples/src/main/java" destdir="${build}"
+               target="1.8" source="1.8" debug="true"
+               encoding="ASCII" fork="yes" includeantruntime="false"
+               classpath="${jarpackagescratchpad}" classpathref="libs">
+        </javac>
+    </target>
+</project>
diff --git a/integrationtest/src/test/java/build.xml b/integrationtest/src/test/java/build.xml
deleted file mode 100644 (file)
index 263a381..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0"?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied.  See the License for the
-specific language governing permissions and limitations
-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.
-
-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"/>
-
-    <target name="init" depends="">
-    </target>
-
-    <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 built 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>
-
-        <!-- copy over required libs to avoid re-downloading them always -->
-        <mkdir dir="${dirversion}/lib"/>
-        <copy todir="${dirversion}/lib">
-            <fileset dir="../../lib"/>
-        </copy>
-
-        <!-- 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="assemble" 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}" quiet="true" failonerror="false"/>
-        <!-- ... try again - on Windows, the JaCoCo ant task seems to keep files open and hence the lib directory can't be removed -->
-        <delete dir="${build}" quiet="true" failonerror="false"/>
-        <mkdir dir="${build}"/>
-
-        <!-- select latest built jar files without scratchpad.jar -->
-        <pathconvert property="jarpackage">
-            <sort>
-                <resources>
-                    <fileset dir="${dist}">
-                        <include name="**/poi-5.*.jar"/>
-                        <include name="**/poi-ooxml-5.*.jar"/>
-                        <include name="**/poi-ooxml-lite-5.*.jar"/>
-                        <exclude name="**/*-javadoc*"/>
-                        <exclude name="**/*-sources*"/>
-                    </fileset>
-                </resources>
-            </sort>
-        </pathconvert>
-
-        <fail message="Did not find jar packages looking in directory ${dist}">
-            <condition>
-                <or>
-                    <equals arg1="${jarpackage}" arg2=""/>
-                    <not>
-                        <isset property="jarpackage"/>
-                    </not>
-                </or>
-            </condition>
-        </fail>
-
-        <echo message="Found jar packages at ${jarpackage}, dist: ${dist}"/>
-        <path id="libs">
-            <fileset dir="../../lib/main" includes="*.jar"/>
-            <fileset dir="../../lib/ooxml" includes="*.jar"/>
-            <fileset dir="../../lib/main-tests">
-                <include name="junit*.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.8" source="1.8" debug="true"
-               encoding="ASCII" fork="yes" includeantruntime="false"
-               excludes="org/apache/poi/examples/hslf/**,org/apache/poi/examples/hsmf/**,org/apache/poi/examples/hwmf/**,**/EmbeddedObjects.java,**/EmeddedObjects.java,**/LoadEmbedded.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-5.*.jar"/>
-                        <include name="**/poi-ooxml-5.*.jar"/>
-                        <include name="**/poi-ooxml-lite-5.*.jar"/>
-                        <include name="**/poi-scratchpad-5.*.jar"/>
-                        <exclude name="**/*-javadoc*"/>
-                        <exclude name="**/*-sources*"/>
-                    </fileset>
-                </resources>
-            </sort>
-        </pathconvert>
-
-        <echo message="Compiling all examples with the additional scratchpad.jar"/>
-        <javac srcdir="../examples/src" destdir="${build}"
-               target="1.8" source="1.8" debug="true"
-               encoding="ASCII" fork="yes" includeantruntime="false"
-               classpath="${jarpackagescratchpad}" classpathref="libs">
-        </javac>
-    </target>
-</project>
index 9161e2bcf7b8ea193a27cc8e7f2e4f1788a9986f..4a667354508acdbbc6bdd0e66bccc0bf716f5c4e 100644 (file)
@@ -455,7 +455,7 @@ poijobs.each { poijob ->
                     }
                     ant {
                         targets(['run'] + (poijob.properties ?: []))
-                        buildFile('src/integrationtest/build.xml')
+                        buildFile('integrationtest/build.xml')
                         // Properties did not work, so I had to use targets instead
                         //properties(poijob.properties ?: '')
                         antInstallation(antRT)
@@ -472,19 +472,19 @@ poijobs.each { poijob ->
                     }
                 }
                 // in archive, junit and jacoco publishers, matches beneath build/*/build/... are for Gradle-build results
-                archiveArtifacts('build/dist/*.tar.gz,build/findbugs.html,build/coverage/**,build/integration-test-results/**,lib/ooxml/**,build/*/build/libs/*.jar')
+                archiveArtifacts('build/dist/*.tar.gz,build/findbugs.html,build/coverage/**,integrationtest/build/test-results/**,*/build/libs/*.jar')
                 warnings(['Java Compiler (javac)', 'JavaDoc Tool'], null) {
                     resolveRelativePaths()
                 }
-                archiveJunit('build/ooxml-test-results/*.xml,build/scratchpad-test-results/*.xml,build/test-results/*.xml,build/excelant-test-results/*.xml,build/integration-test-results/*.xml,build/*/build/test-results/test/TEST-*.xml,build/*/build/test-results/TEST-*.xml') {
+                archiveJunit('*/build/test-results/*.xml') {
                     testDataPublishers {
                         publishTestStabilityData()
                     }
                 }
                 jacocoCodeCoverage {
-                    classPattern('build/classes,build/excelant-classes,build/ooxml-classes,build/scratchpad-classes,build/*/build/classes')
-                    execPattern('build/*.exec,build/*/build/jacoco/*.exec')
-                    sourcePattern('src/java,src/excelant/java,src/ooxml/java,src/scratchpad/src')
+                    classPattern('*/build/classes')
+                    execPattern('*/build/*.exec,*/build/jacoco/*.exec')
+                    sourcePattern('*/src/main/java')
                     exclusionPattern('com/microsoft/**,org/openxmlformats/**,org/etsi/**,org/w3/**,schemaorg*/**,schemasMicrosoft*/**,org/apache/poi/hdf/model/hdftypes/definitions/*.class,org/apache/poi/hwpf/model/types/*.class,org/apache/poi/hssf/usermodel/DummyGraphics2d.class,org/apache/poi/sl/draw/binding/*.class')
                 }