Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
157 kaklik 1
<project basedir="." default="jar">
2
 
3
   <echo message="*********************************************"/>
4
   <echo message="** ${ant.version} "/>
5
   <echo message="** Ant Java Version: ${ant.java.version} "/>
6
   <echo message="** Java VM Version: ${java.vm.version} "/>
7
   <echo message="*********************************************"/>
8
 
9
   <tstamp>
10
      <format property="TODAY" pattern="MM/dd/yyyy HH:mm:ss" />
11
   </tstamp>
12
 
13
   <property name="build.major" value="01"/>
14
   <property name="build.minor" value="07"/>
15
 
16
   <property name="src" location="src"/>
17
   <property name="classes" location="classes"/>
18
   <property name="doc" location="doc"/>
19
 
20
   <property name="rpm" location="rpm"/>
21
   <property name="rpm.sources" value="${rpm}/SOURCES"/>
22
   <property name="rpm.specs" value="${rpm}/SPECS"/>
23
   <property name="rpm.build" value="${rpm}/BUILD"/>
24
   <property name="rpm.srpms" value="${rpm}/SRPMS"/>
25
   <property name="rpm.rpms" value="${rpm}/RPMS"/>
26
   <property name="avrcam.spec" value="AVRcam.spec"/>
27
 
28
   <property name="comm.jar" location="lib/linux/comm.jar"/>
29
   <property name="jdom.jar" location="lib/jdom.jar"/>
30
   <property name="jar.file" value="AVRcamVIEW.jar"/>
31
   <property name="jar.main.class" value="avr.swing.JAVRCamFrame"/>
32
 
33
   <property name="build.property.file" value="avr.properties"/>
34
   <property name="build.property.file.location" location="${classes}/avr/resource/${build.property.file}"/>
35
 
36
   <property name="javac.source" value="${ant.java.version}"/>
37
   <property name="javac.target" value="${ant.java.version}"/>
38
 
39
   <filterset id="build.properties">
40
      <filter token="DATE" value="${TODAY}" />
41
      <filter token="MAJOR" value="${build.major}" />
42
      <filter token="MINOR" value="${build.minor}" />
43
   </filterset>
44
 
45
   <condition property="isUnix">
46
      <os family="unix"/>
47
   </condition>
48
 
49
   <target name="testOS" unless="isUnix">
50
      <fail message="This build can only run on Unix Platforms"/>
51
   </target>
52
 
53
   <target name="init" depends="testOS">
54
      <mkdir dir="${classes}"/>
55
      <mkdir dir="${doc}"/>
56
      <mkdir dir="${rpm}"/>
57
      <mkdir dir="${rpm.sources}"/>
58
      <mkdir dir="${rpm.specs}"/>
59
      <mkdir dir="${rpm.build}"/>
60
      <mkdir dir="${rpm.srpms}"/>
61
      <mkdir dir="${rpm.rpms}"/>
62
   </target>
63
 
64
   <target name="check-uptodate">
65
      <uptodate property="src-uptodate" targetfile="${build.property.file.location}">
66
         <srcfiles dir="${src}" includes="avr/**"/>
67
      </uptodate>
68
   </target>
69
 
70
   <target name="compile" depends="init,check-uptodate" unless="src-uptodate">
71
      <javac source="${javac.source}"
72
             target="${javac.target}"
73
             srcdir="${src}"
74
             destdir="${classes}"
75
             debug="off"
76
             optimize="yes"
77
             listfiles="yes">
78
 
79
         <!-- if compiling with JDK 1.4 or lessor, the following line MUST be uncommented
80
              because the JNewColorMapPanel contains JDK 5.0 specific code. -->
81
         <!-- <exclude name="**/JNewColorMapPanel.java"/> -->
82
 
83
<!--
84
         <classpath>
85
            <pathelement location="${comm.jar}"/>
86
            <pathelement location="${jdom.jar}"/>
87
         </classpath>
88
-->
89
         <!-- print all warnings -->
90
         <!-- <compilerarg value="-Xlint"/> -->
91
      </javac>
92
      <copy todir="${classes}" overwrite="yes">
93
    <filterset refid="build.properties" />
94
         <fileset dir="${src}">
95
            <include name="**/*.properties*"/>
96
         </fileset>
97
      </copy>
98
   </target>
99
 
100
   <target name="doc" depends="compile">
101
      <javadoc destdir="${doc}" sourcepath="${src}" packagenames="avr.*">
102
         <link href="http://java.sun.com/j2se/1.5.0/docs/api"/>
103
         <classpath path="${classes}"/>
104
      </javadoc>
105
   </target>
106
 
107
   <target name="jar" depends="compile">
108
      <jar destfile="${jar.file}" basedir="${classes}" includes="avr/**">
109
         <manifest>
110
            <attribute name="Main-Class" value="${jar.main.class}"/>
111
         </manifest>
112
      </jar>
113
   </target>
114
 
115
   <target name="clean-src" depends="check-uptodate" unless="src-uptodate">
116
 
117
      <property name="prefix" value="AVRcamVIEW-${build.major}.${build.minor}"/>
118
      <property name="tar.file" location="${rpm.sources}/${prefix}.tar.gz"/>
119
 
120
      <delete file="${tar.file}" />
121
 
122
   </target>
123
 
124
   <target name="zip-src" depends="clean-src">
125
 
126
      <property name="prefix" value="AVRcamVIEW-${build.major}.${build.minor}"/>
127
      <property name="tar.file" location="${rpm.sources}/${prefix}.tar.gz"/>
128
 
129
      <tar compression="gzip" destfile="${tar.file}">
130
         <tarfileset prefix="${prefix}" dir=".">
131
            <exclude name="**/CVS/**" />
132
            <include name="src/**/*" />
133
            <include name="${build.property.file}" />
134
            <include name="build.linux.xml" />
135
            <include name="AVRcamVIEW.sh" />
136
            <include name="jre/**/*" />
137
         </tarfileset>
138
      </tar>
139
   </target>
140
 
141
   <target name="rpm" depends="init, zip-src">
142
      <copy file="${avrcam.spec}" todir="${rpm.specs}"/>
143
      <rpm topDir="${rpm}" specFile="${avrcam.spec}" />
144
   </target>
145
 
146
   <target name="clean" depends="clean-classes, clean-doc, clean-jar">
147
   </target>
148
 
149
   <target name="clean-classes">
150
      <delete dir="${classes}"/>
151
   </target>
152
 
153
   <target name="clean-doc">
154
      <delete dir="${doc}"/>
155
   </target>
156
 
157
   <target name="clean-jar">
158
      <delete file="${jar.file}"/>
159
   </target>
160
 
161
   <target name="rebuild-all" depends="clean, jar" />
162
 
163
</project>