|
1 <!-- |
|
2 # |
|
3 # Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
4 # All rights reserved. |
|
5 # This component and the accompanying materials are made available |
|
6 # under the terms of "Eclipse Public License v1.0" |
|
7 # which accompanies this distribution, and is available |
|
8 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
9 # |
|
10 # Initial Contributors: |
|
11 # Nokia Corporation - initial contribution. |
|
12 # |
|
13 # Contributors: |
|
14 # |
|
15 # Description: |
|
16 # |
|
17 --> |
|
18 |
|
19 <!-- |
|
20 This is the template for the build.xml files of Java components. Copy |
|
21 this file into the build directory of your component and rename it to |
|
22 "build.xml". Create also a .pro file in order to get the byte code |
|
23 rommized into a native DLL. |
|
24 |
|
25 Please remember to remove all the unused parts and comments. Also remember |
|
26 to document properly all non-trivial constucts used (especially overrides |
|
27 of targets like 'compile' and 'init.component.properties', and properties |
|
28 like 'bootclasspath'). |
|
29 --> |
|
30 |
|
31 <!-- |
|
32 Replace the name "mycomponent" with the name of your component. Use only |
|
33 lower case letters. By default, the basename of the resulting DLL uses |
|
34 the same name. |
|
35 |
|
36 The default target is 'deploy' which builds the component in a single |
|
37 build phase (sufficient for most of the components). In this phase, all |
|
38 the classes of the component are built using one Java configuration, |
|
39 the default being CLDC. The generic java sources are assumed to be in the |
|
40 directory javasrc and any platform dependent sources in the directories |
|
41 javasrc.s60 and javasrc.linux. |
|
42 |
|
43 If the component contains e.g. classes that need both CLDC and CDC |
|
44 configuration in order to be built, you must define the default target as |
|
45 'deploy.dual'. In this case, there are two built phases - the first one |
|
46 being like described above for the target 'deploy'. The second phase uses |
|
47 by default CDC configuration. The generic sources are assumed to be in the |
|
48 directory javasrc.cdc and any platorm dependent sources in the |
|
49 directories javasrc.s60.cdc and javasrc.linux.cdc. |
|
50 --> |
|
51 <project name="mycomponent" default="deploy" basedir="."> |
|
52 |
|
53 <!-- Import utilities.xml from the directory ${JAVA_SRC_ROOT}/build/. |
|
54 Unfortunately, the property '${JAVA_SRC_ROOT}' can't be used in this |
|
55 phase so use the "../" construct to reach the root build directory. |
|
56 --> |
|
57 <import file="../../../../build/utilities.xml"/> |
|
58 |
|
59 |
|
60 <!-- In the first build phase the system expects to find all Java sources |
|
61 from the directory ../javasrc and from the platform dependent |
|
62 directories javasrc.s60 and javasrc.linux. If not all the classes are |
|
63 in these directories, define the property 'java.src.paths' to point to |
|
64 the correct location(s). If there are multiple directories containing |
|
65 Java sources, use the character ':' as the separator. |
|
66 --> |
|
67 <property name="java.src.paths" value="../myjavasrc:../myjavasrc2"/> |
|
68 |
|
69 <!-- The property 'java.src.second.paths' is for the second build phase. |
|
70 The behavior is the same as with the property 'java.src.paths' except |
|
71 that the default directories are javasrc.cdc, javasrc.s60.cdc and |
|
72 javasrc.linux.cdc. |
|
73 --> |
|
74 <property name="java.src.second.paths" value="../myjavasrc:../myjavasrc2"/> |
|
75 |
|
76 <!-- In the first build phase the system sets the bootclasspath to include |
|
77 CLDC libraries. If this is not proper settings for your component, |
|
78 define with the property 'bootclasspath' the appropriate libraries. If |
|
79 multiple libraries are needed, use the character ':' as the separator. |
|
80 The system provides a predefined property '${bootclasspath.cdc}' |
|
81 for CDC. |
|
82 --> |
|
83 <property name="bootclasspath" value="${bootclasspath.cdc}"/> |
|
84 |
|
85 <!-- In the second build phase the system sets the bootclasspath to include |
|
86 CDC libraries. If this is not proper settings for your component, |
|
87 define with the property 'bootclasspath.second' the appropriate |
|
88 libraries. If multiple libraries are needed, use the character ':' as |
|
89 the separator.The system provides a predefined property |
|
90 '${bootclasspath.cldc}' for CLDC. |
|
91 --> |
|
92 <property name="bootclasspath.second" value="${bootclasspath.cldc}"/> |
|
93 |
|
94 <!-- The base name of the native DLL containing the rommized Java code is |
|
95 by default equal to the name of this project (in this template |
|
96 'mycomponent'). If this is not right, define the property |
|
97 'native.dll.name' to set the name to something else. |
|
98 --> |
|
99 <property name="native.dll.name" value="mydefinedlibname"/> |
|
100 |
|
101 |
|
102 <!-- The property 'javah.classnames' is used to list the Java classes |
|
103 containing native methods for which the 'javah' tool must be run |
|
104 to generate the corresponding JNI header files. The value is |
|
105 a list of fully qualified class names, with the character '.' as the |
|
106 package separator and the character ',' as the class separator. |
|
107 --> |
|
108 <property name="javah.classnames" |
|
109 value="com.nokia.mj.impl.midpruntime.JavaUi, |
|
110 com.nokia.mj.impl.midpruntime.MidletLifeCycle, |
|
111 com.nokia.mj.impl.midpruntime.ApplicationInfoImpl"/> |
|
112 |
|
113 <!-- If the Java component introduces new system properties, override |
|
114 the target 'system.properties' providing a list of the system property |
|
115 names and values as shown below. |
|
116 --> |
|
117 <target name="system.properties"> |
|
118 <properties> |
|
119 microedition.hostname=localhost |
|
120 microedition.jtwi.version=1.0 |
|
121 wireless.messaging.mms.mmsc=:mms.DynamicPropertyHandler |
|
122 </properties> |
|
123 </target> |
|
124 |
|
125 |
|
126 <!-- If the Java component provides internal APIs to other components, |
|
127 override the target 'create.internal.api.jar' and use one of the |
|
128 formats shown in the following examples to list the class(es). |
|
129 By default, no classes are published to other components. |
|
130 --> |
|
131 |
|
132 <!-- Example 1. All the classes of the component are published for |
|
133 the other components |
|
134 --> |
|
135 <target name="create.internal.api.jar"> |
|
136 <omj.internal.apis/> |
|
137 </target> |
|
138 |
|
139 <!-- Example 2. All the classes except the listed ones are published |
|
140 for the other components. Use the character '/' as the package |
|
141 separator, append the ".class" extension to each class name, |
|
142 and separate the classes with the character ','. |
|
143 --> |
|
144 <target name="create.internal.api.jar"> |
|
145 <omj.internal.apis excludes= |
|
146 "javax/microedition/midlet/MIDlet.class, |
|
147 javax/microedition/midlet/MIDletStateChangeException.class"/> |
|
148 </target> |
|
149 |
|
150 <!-- Example 3. Only the explicitly listed classes are published for |
|
151 the other components. Use the character '/' as the package |
|
152 separator, append the ".class" extension to each class name, |
|
153 and separate the classes with the character ','. |
|
154 --> |
|
155 <target name="create.internal.api.jar"> |
|
156 <omj.internal.apis includes= |
|
157 "com/nokia/mj/impl/rt/DynamicSystemProperty.class, |
|
158 com/nokia/mj/impl/rt/SystemProperty.class"/> |
|
159 </target> |
|
160 |
|
161 |
|
162 |
|
163 <!-- If the Java component provides public APIs to the application |
|
164 developers, override the target 'create.public.api.jar' and use one of |
|
165 the formats shown in the following examples to list the class(es). |
|
166 By default, no classes are published to the application developers. |
|
167 |
|
168 When listing classes, use the character '/' as the package |
|
169 separator, append the ".class" extension to each class name, and |
|
170 separate the classes with the character ','. |
|
171 |
|
172 Use wildcard "*" (single file/directory) or "**" (multiple |
|
173 directories). |
|
174 --> |
|
175 |
|
176 <!-- Example 1. All the classes of the component are published for |
|
177 the application developers. |
|
178 --> |
|
179 <target name="create.public.api.jar"> |
|
180 </target> |
|
181 |
|
182 <!-- Example 2. All the classes except the listed ones are published |
|
183 for the application developers. |
|
184 --> |
|
185 <target name="create.public.api.jar"> |
|
186 <omj.public.apis excludes= |
|
187 "com/nokia/mj/impl/rt/DynamicSystemProperty.class, |
|
188 com/nokia/mj/impl/rt/SystemProperty.class, |
|
189 com/nokia/mj/impl/internal/**/*.class"/> |
|
190 </target> |
|
191 |
|
192 <!-- Example 3. Only the explicitly listed classes are published for |
|
193 the application developers. |
|
194 --> |
|
195 <target name="create.public.api.jar"> |
|
196 <omj.public.apis includes= |
|
197 "javax/microedition/midlet/MIDlet.class, |
|
198 javax/microedition/midlet/MIDletStateChangeException.class, |
|
199 org/eclipse/**/*.class" /> |
|
200 </target> |
|
201 |
|
202 |
|
203 <!-- If there is a need to modify the behavior of the 'javac' tool in the |
|
204 first build phase, override the target 'compile' and modify the |
|
205 predefined parameters as needed. |
|
206 --> |
|
207 <target name="compile"> |
|
208 <omj.javac excludes="**/PermissionGranter.java **/SecurityPolicy*.java"/> |
|
209 </target> |
|
210 |
|
211 <!-- As above (target 'compile') but for the second build phase. |
|
212 --> |
|
213 <target name="compile.second"> |
|
214 <omj.javac |
|
215 excludes="com/nokia/mj/impl/installer/Install*.java, |
|
216 com/nokia/mj/impl/installer/pushregistrator/Push*.java, |
|
217 com/nokia/mj/impl/installer/utils/InstallerMain.java"> |
|
218 </omj.javac> |
|
219 </target> |
|
220 |
|
221 |
|
222 <!-- Sometimes it is necessary to finetune some properties based on e.g. the |
|
223 target platform. This is possible in a safe way by overriding the |
|
224 target 'init.component.properties'. In the example below, the property |
|
225 'java.src.paths' is defined differently according to used platform. |
|
226 --> |
|
227 <target name="init.component.properties"> |
|
228 <condition property="java.src.second.paths" |
|
229 value="../javasrc:../javasrc.s60" |
|
230 else="../javasrc:../javasrc.linux"> |
|
231 <isset property="target.s60" /> |
|
232 </condition> |
|
233 </target> |
|
234 |
|
235 </project> |