*** empty log message ***
[thera-pi.git] / Build / build-common.xml
blob7e60f47ccb845aa781f5a86f86df7cbfe424974d
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" />
8         </presetdef>
10     <target name="default">
11         <echo level="error" message="This buildfile should not be called directly."/>
12     </target>
14         <target name="buildnumber" unless="build.number">
15                 <buildnumber file="../Build/build-number.properties"/>
16         </target>
17         
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}"/>
20         </target>
22         <target name="jar-prepare">
23                 <path id="path.classpath.build.thirdparty" refid="${ant.project.name}.classpath"/>
24                 
25                 <pathconvert property="dir.libraries.basedir">
26                         <path>
27                                 <pathelement location="${Libraries.location}"/>
28                         </path>
29                 </pathconvert>
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 -->
35                         <mapper>
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/*"/>
41                         </mapper>
42                 </pathconvert>
43                                         
44         <mkdir dir="${dir.dist.jar}"/>
45         </target>
46                 
47         <target name="jar-main" if="jar.main.class">
48         <jar destfile="${dir.dist.jar}/${file.output.jar}" basedir="${classdir}">
49                 <manifest>
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}"/> 
55                 </manifest>
56         </jar>
57         </target>
58                 
59         <target name="jar-nomain" unless="jar.main.class">
60         <jar destfile="${dir.dist.jar}/${file.output.jar}" basedir="${classdir}">
61                 <manifest>
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}"/> 
66                 </manifest>
67         </jar>
68         </target>
69                 
70         <target name="build">
71                 <echo level="error" message="This target should be overridden by generated buildfile"/>
72         </target>
73         
74 </project>