root/trunk/buildcalendar.xml

Revision 564, 8.4 KB (checked in by team4, 9 years ago)

*** empty log message ***

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1<?xml version="1.0"  encoding="utf-8"?>
2<!-- Rapla build-file
3Copyright (C) 2001-2003 Christopher Kohlhaas                                 
4                                                                         
5This programm is free software; you can redistribute it and/or modify   
6it under the terns of the GNU General Public License as published by the
7Free Software Foundation. A copy of the license has been included with   
8these distribution in the COPYING file, if not go to www.fsf.org .       
9
10As a special exception, you are granted the permission to link this   
11program with every library, of wich license fullfills the Open Source 
12Definition as published by the Open Source Initiative (OSI).           
13-->
14
15<project name="Rapla" default="build" basedir=".">
16  <!-- set global properties for this build -->
17  <property name="build.compiler.emacs" value="on"/>
18  <property name="build.compiler.warnings" value="true"/>
19  <property name="build.compiler.pedantic" value="true"/>
20  <property name="build.compiler.depend" value="true"/>
21  <property name="build.compiler.fulldepend" value="true"/>
22  <property name="target" value="dist-bin"/>
23
24  <!-- This is for the crlf-fix -->
25  <patternset id="text-files" >
26     <include name="**"/>
27     <exclude name="**/*.class"/>
28     <exclude name="**/*.jar"/>
29     <exclude name="**/*.war"/>
30     <exclude name="**/*.ear"/>
31     <exclude name="**/*.zip"/>
32     <exclude name="**/*.tar.gz"/>
33     <exclude name="**/*.gz"/>
34     <exclude name="**/*.gif"/>
35     <exclude name="**/*.png"/>
36     <exclude name="**/*.jpg"/>
37     <exclude name="**/*.jpeg"/>
38  </patternset>
39
40  <property name="main.dir" value="${basedir}" /> 
41
42  <target name="init">
43
44    <condition property="newjdk">
45      <and>
46        <available classname="java.awt.event.MouseWheelListener"/>
47      </and>
48    </condition>
49
50    <!-- Create the time stamp -->
51    <tstamp/>
52    <property name="doc.properties" value="doc-calendar.properties"/>
53    <property file="${main.dir}/${build.properties}"/>
54    <property file="${main.dir}/${doc.properties}"/>
55
56
57    <!-- Information about the compiler -->
58    <!-- property name="build.compiler" value="javac1.3"/-->
59    <property name="debug"          value="on"/>
60    <property name="optimize"       value="off"/>
61    <property name="deprecation"    value="on"/>
62    <property name="verbose"        value="no"/>
63    <property name="packages"       value="org.*"/>
64
65    <!-- The rapla-directories -->
66    <property name="doc.dir" value="${main.dir}/xdocs" />
67    <property name="src.dir" value="${main.dir}/src/" />
68    <property name="build.dir" value="${main.dir}/build" />
69    <property name="dist.dir" value="${main.dir}/dist" />
70    <property name="tarball.name" value="calendar-${doc.version}"/>
71    <property name="dist-calendar.dir" value="${main.dir}/dist/${tarball.name}" />
72    <property name="build.src" value="${build.dir}/src" />
73    <property name="testsrc.dir" value="${main.dir}/test-src"/>
74    <property name="package.path" value="org/rapla/components/calendar/"/>
75    <property name="build.javadocs" value="javadocs"/>
76
77    <property name="build.dest" value="${build.dir}/classes" />
78    <property name="build.test" value="${build.dir}/test/classes" />
79
80    <property name="main.lib" value="calendar.jar" />
81    <!-- The class and properties file to start rapla from the command-line.
82         This poperties are necessary for the start scripts-->
83    <property name="start.class" value="org.rapla.components.calendar.RaplaCalendarExample"/>
84  </target>
85
86 <!-- =================================================================== -->
87 <!--   The Targets prepare,compile,compile-resources and build are for   -->
88 <!--   creating the ${main.lib}                                            -->
89 <!-- =================================================================== -->
90  <target name="prepare" depends="init"> 
91    <mkdir dir="${build.dir}" />
92    <mkdir dir="${build.dest}" />
93    <mkdir dir="${build.test}" />
94  </target>
95
96  <target name="compile" depends="prepare">
97    <!-- Compile the java code from ${src} into ${build.dir} -->
98    <javac srcdir="${src.dir}" 
99           destdir="${build.dest}" 
100           debug="${debug}"
101           optimize="${optimize}"
102           deprecation="${deprecation}"
103                      verbose="${verbose}">
104        <include name="${package.path}/*" />
105        <exclude name="${package.path}/jdk14adapter/AWTAdapterFactoryImpl.java" unless="newjdk"/>
106    </javac>
107    <javac srcdir="${testsrc.dir}" 
108           destdir="${build.test}" 
109           debug="${debug}"
110           optimize="${optimize}"
111           verbose="${verbose}">
112        <classpath>
113          <pathelement path="${build.dest}" />
114        </classpath>
115        <include name="${package.path}/**" />
116    </javac>
117  </target>
118
119
120  <target name="build" depends="compile"
121    description="Build a new calendar.jar in the build folder">
122    <mkdir dir="${build.src}"/>
123    <uptodate property="manifest.needupdate">
124       <srcfiles dir="${build.src}" includes="Manifest.mf"/>
125       <mapper type="merge" to="${main.dir}/${build.properties}"/>
126    </uptodate>
127    <delete>
128       <fileset dir="${build.src}">
129         <include name="Manifest.mf" if="manifest.needupdate"/>
130       </fileset>
131    </delete>
132
133    <copy tofile="${build.src}/Manifest.mf" file="${src.dir}/manifest">
134      <filterset>
135        <filter token="libraries_jar_manifest" value=""/>
136        <filter token="start_class" value="${start.class}"/>
137      </filterset>
138    </copy>
139
140    <jar jarfile="${build.dir}/${main.lib}"
141         manifest="${build.src}/Manifest.mf"
142         >         
143        <fileset dir="${build.dest}"> 
144           <include name="${package.path}/**" />
145        </fileset>
146        <fileset dir="${build.test}"> 
147           <include name="${package.path}/**" />
148        </fileset>
149    </jar> 
150  </target>
151
152  <!-- =================================================================== -->
153  <!-- Creates the API documentation                                       -->
154  <!-- =================================================================== -->
155  <target name="javadocs" depends="prepare"
156      unless="javadocs.notrequired"
157      description="Generate the API documentation">
158    <!-- Filter-Information for the java-doc generator and the rapla-language-files-->
159    <copy todir="${build.src}">
160       <fileset dir="${src.dir}">
161          <include name="${package.path}/**/*.java" />
162          <include name="**/package.html" />
163          <include name="**/overview.html" />
164       </fileset>
165       <filterset>
166          <filtersfile file="${main.dir}/${doc.properties}"/>
167       </filterset>
168    </copy>
169    <mkdir dir="${build.javadocs}" />
170    <javadoc packagenames="${packages}"
171             sourcepath="${build.src}"
172             destdir="${build.javadocs}"
173             author="true"
174             version="true"
175             use="false"
176             noindex="true"
177             windowtitle="${doc.name} API (${doc.version})"
178             bottom="Copyright &#169; ${doc.year} ${doc.copyright}. All Rights Reseserved."
179      >
180      <link href="http://java.sun.com/j2se/1.4.1/docs/api/"/>
181    </javadoc>
182  </target>
183
184 <!-- =================================================================== -->
185 <!--     Create the calendar distribution                               -->
186 <!-- =================================================================== -->
187  <target name="dist" depends="build">
188    <mkdir dir="${dist-calendar.dir}" />
189    <copy file="${main.dir}/buildcalendar.xml" tofile="${dist-calendar.dir}/build.xml"/>
190    <copy todir="${dist-calendar.dir}">
191        <fileset dir="${build.dir}" >
192           <include name="${main.lib}" />
193        </fileset>
194        <fileset dir="${main.dir}">
195           <include name="src/${package.path}/**" />
196           <include name="src/manifest" />
197           <include name="doc-calendar.properties" />
198           <include name="test-src/${package.path}/**" />
199        </fileset>
200    </copy> 
201  </target>
202
203
204 <!-- =================================================================== -->
205 <!-- Packages the distribution as .zip                                   -->
206 <!-- =================================================================== -->
207  <target name="zip" depends="dist">
208       <fixcrlf srcdir="${dist-calendar.dir}" eol="crlf">
209         <patternset refid="text-files"/>
210       </fixcrlf>
211       <zip zipfile="${dist.dir}/${tarball.name}.zip">
212            <!-- This is a workaround until tarfileset supports the prefix-->
213         <zipfileset dir="${dist.dir}/${tarball.name}" prefix="${tarball.name}"/>
214       </zip>
215  </target>
216
217</project>
Note: See TracBrowser for help on using the browser.