Issue 465, remove reference to libs/ as it is not used
[zxing.git] / rim / build.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!--
4  Copyright 2007 ZXing authors
5
6  Licensed under the Apache License, Version 2.0 (the "License");
7  you may not use this file except in compliance with the License.
8  You may obtain a copy of the License at
9
10       http://www.apache.org/licenses/LICENSE-2.0
11
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  See the License for the specific language governing permissions and
16  limitations under the License.
17 -->
18
19 <project name="rim" default="build">
20
21   <property file="../build.properties"/>
22   <property name="rim-api-jar" value="${BB-JDK-home}/lib/net_rim_api.jar"/>
23
24   <target name="init">
25     <tstamp/>
26     <fail message="Please set 'BB-JDK-home' in build.properties">
27       <condition>
28         <not>
29           <available file="${BB-JDK-home}" type="dir"/>
30         </not>
31       </condition>
32     </fail>
33     <fail message="Please set 'WTK-home' in build.properties">
34       <condition>
35         <not>
36           <available file="${WTK-home}" type="dir"/>
37         </not>
38       </condition>
39     </fail>
40     <fail message="Please build 'core' first">
41       <condition>
42         <not>
43           <available file="../core/core.jar" type="file"/>
44         </not>
45       </condition>
46     </fail>
47     <fail message="Please build 'javame' first">
48       <condition>
49         <not>
50           <available file="../javame/javame.jar" type="file"/>
51         </not>
52       </condition>
53     </fail>
54   </target>
55
56   <target name="build" depends="init">
57
58     <mkdir dir="build"/>
59     <javac srcdir="src"
60            destdir="build"
61            source="1.2"
62            target="1.2"
63            bootclasspath="${rim-api-jar}"
64            optimize="true"
65            debug="true"
66            deprecation="true"
67            fork="true">
68       <classpath>
69         <pathelement location="../core/core.jar"/>
70         <pathelement location="../javame/javame.jar"/>
71       </classpath>
72     </javac>
73
74     <unzip src="../core/core.jar" dest="build"/>
75     <unzip src="../javame/javame.jar" dest="build"/>
76
77     <mkdir dir="build-j2me"/>
78     <exec executable="${WTK-home}/bin/preverify1.1" failonerror="true">
79       <arg line="-classpath '${rim-api-jar}' -d build-j2me build"/>
80     </exec>
81
82     <copy todir="build-j2me">
83       <fileset dir=".">
84         <include name="res/**"/>
85       </fileset>
86     </copy>
87
88     <copy file="BarcodeReader.jad.template" tofile="BarcodeReader.jad" overwrite="true">
89       <filterset>
90         <filter token="VERSION" value="${version}"/>
91       </filterset>
92     </copy>
93     <copy file="BarcodeReader.alx.template" tofile="BarcodeReader.alx" overwrite="true">
94       <filterset>
95         <filter token="VERSION" value="${version}"/>
96       </filterset>
97     </copy>
98
99     <jar jarfile="temp.jar" basedir="build-j2me"/>
100     <java jar="${BB-JDK-home}/bin/rapc.jar" fork="true">
101       <arg value="-quiet"/>
102       <arg value="import=${rim-api-jar}"/>
103       <arg value="jad=BarcodeReader.jad"/>
104       <arg value="codename=BarcodeReader"/>
105       <arg value="temp.jar"/>
106     </java>
107
108     <echo>Remember to sign the .cod file!</echo>
109
110   </target>
111
112   <target name="clean">
113     <delete dir="build"/>
114     <delete dir="build-j2me"/>    
115     <delete file="temp.jar"/>
116     <delete file="BarcodeReader.cod"/>
117     <delete file="BarcodeReader.csl"/>
118     <delete file="BarcodeReader.cso"/>
119     <delete file="BarcodeReader.debug"/>
120     <delete file="BarcodeReader.jad"/>        
121     <delete file="BarcodeReader.jar"/>
122     <delete file="LogFile.txt"/>        
123   </target>
124
125 </project>