]> source.dussan.org Git - poi.git/commitdiff
Do not recompile Version.java unless build.xml (i.e. version) changes
authorDominik Stadler <centic@apache.org>
Fri, 6 Mar 2020 15:22:16 +0000 (15:22 +0000)
committerDominik Stadler <centic@apache.org>
Fri, 6 Mar 2020 15:22:16 +0000 (15:22 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1874901 13f79535-47bb-0310-9956-ffa450edef68

build.xml

index 67a30f42df64e8474b5a24d4535ed805b3d95a28..0d28262dd15c334f701d5b8258ed445c0aedcc84 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -1388,7 +1388,17 @@ under the License.
         </copy-->
     </target>
 
-    <target name="compile-version" depends="init"
+    <target name="-version-java-check">
+               <!-- recompile Version.java from the template whenever source or the version in build.xml changes -->
+        <uptodate property="version.java.notRequired" targetfile="${main.output.dir}/org/apache/poi/Version.class">
+            <srcfiles file="src/resources/version/Version.java.template"/>
+            <srcfiles file="build.xml"/>
+        </uptodate>
+    </target>
+
+    <target name="compile-version" 
+                       unless="version.java.notRequired"
+                       depends="init, -version-java-check"
             description="Compiles the version class">
         <!-- Generate the .java file -->
         <property name="version.java" value="${main.output.dir}/org/apache/poi/Version.java"/>
@@ -1408,6 +1418,7 @@ under the License.
                srcdir="${main.output.dir}"
                encoding="${java.source.encoding}" includeantruntime="false">
         </javac>
+
         <!-- Tidy up -->
         <delete file="${version.java}"/>
     </target>