Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
Set and check for Java version 1.7.
Browse files Browse the repository at this point in the history
  • Loading branch information
henning-gerhardt committed Oct 4, 2016
1 parent 655ca49 commit a3087f5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions build.properties.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This file is part of Kitodo.ContentServer

#java.source=1.7
#java.target=1.7
tomcat.dir.lib=/usr/share/tomcat7/lib
24 changes: 23 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

<property name="build.dir" value="build" />

<property name="build.javac.target" value="1.7"/>
<property name="build.javac.source" value="1.7"/>

<property name="build.dist.name" value="ics" />
<property name="build.dist.version" value="1.1.5" />

Expand Down Expand Up @@ -41,7 +44,24 @@
</condition>
</target>

<target name="checkConditions" depends="checkServletApi" />
<target name="checkConditions" depends="checkJavaVersion, checkServletApi" />

<!-- check for Java version 1.7 -->
<target name="checkJavaVersion">
<fail message="Build required at least version 1.7 of the Java compiler ">
<condition>
<and>
<contains string="${java.version}" substring="1.0"/>
<contains string="${java.version}" substring="1.1"/>
<contains string="${java.version}" substring="1.2"/>
<contains string="${java.version}" substring="1.3"/>
<contains string="${java.version}" substring="1.4"/>
<contains string="${java.version}" substring="1.5"/>
<contains string="${java.version}" substring="1.6"/>
</and>
</condition>
</fail>
</target>

<target name="checkServletApi" depends="checkServletClassPath" unless="servletapi.present">
<echo>Servlet API not found on classpath!</echo>
Expand All @@ -67,6 +87,8 @@
<echo>compile sources</echo>
<javac destdir="build"
includeAntRuntime="false"
source="${build.javac.source}"
target="${build.javac.target}"
encoding="UTF-8"
debug="true"
debuglevel="lines,vars,source"
Expand Down

0 comments on commit a3087f5

Please sign in to comment.