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
   <property name="src" location="src"/>
16
   <property name="classes" location="classes"/>
17
   <property name="doc" location="doc"/>
18
   <property name="debug" value="off"/>
19
 
20
   <!--
21
     the comm.jar file can point to either of the linux or win32 versions..
22
     the API is the same, but the implementation is different
23
   -->
24
   <property name="comm.jar" location="lib/win32/comm.jar"/>
25
   <property name="jdom.jar" location="lib/jdom.jar"/>
26
<!--   <property name="jdom.jar" location="F:/java/lib/jdom-1.0/build/jdom.jar"/> -->
27
   <property name="jar.file" value="AVRcamVIEW.jar"/>
28
   <property name="jar.main.class" value="avr.swing.JAVRCamFrame"/>
29
   <property name="build.property.file" value="avr.properties"/>
30
   <property name="build.property.file.location" location="${classes}/avr/resource/${build.property.file}"/>
31
   <property name="javac.source" value="${ant.java.version}"/>
32
   <property name="javac.target" value="${ant.java.version}"/>
33
 
34
   <filterset id="build.properties">
35
      <filter token="DATE" value="${TODAY}"/>
36
      <filter token="MAJOR" value="${build.major}"/>
37
      <filter token="MINOR" value="${build.minor}"/>
38
   </filterset>
39
 
40
   <condition property="isWin32">
41
      <os family="windows"/>
42
   </condition>
43
 
44
   <target name="testOS" unless="isWin32">
45
      <fail message="This build can only run on Windows Platforms"/>
46
   </target>
47
 
48
   <target name="init" depends="testOS">
49
      <mkdir dir="${classes}"/>
50
      <mkdir dir="${doc}"/>
51
   </target>
52
   <target name="check-uptodate">
53
      <uptodate property="src-uptodate" targetfile="${build.property.file.location}">
54
         <srcfiles dir="${src}" includes="avr/**"/>
55
      </uptodate>
56
   </target>
57
 
58
   <target name="compile" depends="init,check-uptodate" unless="src-uptodate">
59
      <javac source="${javac.source}"
60
             target="${javac.target}"
61
             srcdir="${src}"
62
             destdir="${classes}"
63
             debug="${debug}"
64
             optimize="yes"
65
             listfiles="yes">
66
 
67
         <!-- if compiling with JDK 1.4 or lessor, the following line MUST be uncommented
68
              because the JNewColorMapPanel contains JDK 5.0 specific code. -->
69
         <!-- <exclude name="**/JNewColorMapPanel.java"/> -->
70
 
71
         <classpath>
72
            <pathelement location="${comm.jar}"/>
73
            <pathelement location="${jdom.jar}"/>
74
         </classpath>
75
         <!-- print all warnings -->
76
         <!-- <compilerarg value="-Xlint"/> -->
77
      </javac>
78
      <copy todir="${classes}" overwrite="yes">
79
         <filterset refid="build.properties"/>
80
         <fileset dir="${src}">
81
            <include name="**/*.properties*"/>
82
         </fileset>
83
      </copy>
84
   </target>
85
 
86
   <target name="doc" depends="compile">
87
      <javadoc destdir="${doc}" sourcepath="${src}" packagenames="avr.*">
88
         <link href="http://java.sun.com/j2se/1.5.0/docs/api"/>
89
         <classpath path="${classes}"/>
90
      </javadoc>
91
   </target>
92
 
93
   <target name="jar" depends="compile">
94
      <jar destfile="${jar.file}" basedir="${classes}" includes="avr/**">
95
         <manifest>
96
            <attribute name="Main-Class" value="${jar.main.class}"/>
97
         </manifest>
98
      </jar>
99
   </target>
100
 
101
   <target name="zip-src">
102
      <tar compression="gzip" destfile="AVRcamVIEW-${build.major}.${build.minor}.tar.gz">
103
         <tarfileset dir="${src}" prefix="src">
104
            <include name="**/*.java"/>
105
            <include name="**/*.properties"/>
106
            <exclude name="**/*CVS*"/>
107
         </tarfileset>
108
         <tarfileset dir=".">
109
            <include name="*.xml" />
110
            <include name="AVRcamVIEW.sh" />
111
            <include name="AVRcam.spec" />
112
         </tarfileset>
113
      </tar>
114
   </target>
115
 
116
   <target name="clean" depends="clean-classes, clean-doc, clean-jar">   </target>
117
 
118
   <target name="clean-classes">
119
      <delete dir="${classes}"/>
120
   </target>
121
 
122
   <target name="clean-doc">
123
      <delete dir="${doc}"/>
124
   </target>
125
 
126
   <target name="clean-jar">
127
      <delete file="${jar.file}"/>
128
   </target>
129
 
130
   <target name="rebuild-all" depends="clean, jar" />
131
 
132
</project>