1 <?xml version="1.0" encoding="UTF-8"?>
2 <project name="common" default="default">
4 <!-- add compiler argument to use UTF-8 encoding for all source files
5 and add default argument to remove stupid Ant warning -->
6 <presetdef name="javac">
7 <javac encoding="UTF-8" includeantruntime="false" />
10 <target name="default">
11 <echo level="error" message="This buildfile should not be called directly."/>
14 <target name="buildnumber" unless="build.number">
15 <buildnumber file="../Build/build-number.properties"/>
18 <target name="jar" depends="build,jar-prepare,jar-main,jar-nomain" description="create jar file from compiled classes">
19 <echo message="${file.output.jar}: Implementation-Version: ${version.number}-b${build.number}"/>
22 <target name="jar-prepare">
23 <path id="path.classpath.build.thirdparty" refid="${ant.project.name}.classpath"/>
25 <pathconvert property="dir.libraries.basedir">
27 <pathelement location="${Libraries.location}"/>
31 <pathconvert property="path.classpath.jar" pathsep=" ">
32 <path refid="path.classpath.build.thirdparty"/>
33 <!-- The mapper removes absolute paths and filters out
34 references to source files -->
36 <!-- this should catch all JARs built by other projects
37 (path.classpath.build.project) -->
38 <globmapper from="${basedir}/*.jar" to="*.jar"/>
39 <!-- this should catch all thirdparty JARs -->
40 <globmapper from="${dir.libraries.basedir}/*" to="Libraries/*"/>
44 <mkdir dir="${dir.dist.jar}"/>
47 <target name="jar-main" if="jar.main.class">
48 <jar destfile="${dir.dist.jar}/${file.output.jar}" basedir="${classdir}">
50 <attribute name="Main-Class" value="${jar.main.class}"/>
51 <attribute name="Class-Path" value="${jar.classpath.jars} ${path.classpath.jar}"/>
52 <attribute name="Sealed" value="true"/>
53 <attribute name="Implementation-Version"
54 value="${version.number}-b${build.number}"/>
59 <target name="jar-nomain" unless="jar.main.class">
60 <jar destfile="${dir.dist.jar}/${file.output.jar}" basedir="${classdir}">
62 <attribute name="Class-Path" value="${jar.classpath.jars} ${path.classpath.jar}"/>
63 <attribute name="Sealed" value="true"/>
64 <attribute name="Implementation-Version"
65 value="${version.number}-b${build.number}"/>
71 <echo level="error" message="This target should be overridden by generated buildfile"/>