mind serializer and weblog
[ start | index | login ]
start > eclipseME and Antenna

eclipseME and Antenna

Created by case. Last edited by case, 2 years and 208 days ago. Viewed 729 times. #6
[diff] [history] [edit] [rdf]
labels
attachments

using eclipseME and Antenna for preprocessing

Based on eclipseME 1.3.2 and Anteanna 0.9.13

First setup eclipseME and >>Anteanna as described in eclipseME docs. Now use Export Antenna Build Files to create the intial build file setup.

To successfully run the build.xml, be sure to put the jdk's bin directory into the path. Otherwise an error like [wtkpackage] JAR file creation failed with error -1 will indicate problems during preverification.

To do preprocessing in java, just add the //#if and //#endif directives (see also >>http://antenna.sourceforge.net/#preprocess ) to the java file. To prevent compilation problems on doubled code lines, just also mark the one excluded during you programming wiht //#. Antenna will comment these lines in, also, if they are within a valid if/endif section.

I had to add the preprocesser task to my build.xml file (and also used the same sourcedir/destdir - so know, what you are doing...). It was also necessary to inclue the taskdef from anteanna's jar file, so that the wtkpreprocess is defined.

<!-- Preprocess any source file. -->
<target name="-preprocess" description="preprocess the source files">
	<echo message="preprocessing for symbols: ${preprocessor.symbols}" />
	<taskdef resource="antenna.properties">
	     <classpath location="${path.antenna.jar}"/>
	</taskdef>
	<wtkpreprocess srcdir="${basedir}/src" destdir="${basedir}/src" symbols="${preprocessor.symbols}">
	</wtkpreprocess>
</target>

Of course, the preprocess task needs to be called before build and build.xml was changed accordingly.

<!-- Build the classes that make up the midlet -->
<target name="build" depends="-initialize,-preprocess,-eclipseme-build"
	description="Builds the classes that make up the project">
</target>

As you can see, the ant task uses ${preprocessor.symbols}. Just define them in the user-build.properites:

preprocessor.symbols=MIDP2,Nokia

Now go for your java sources and you may include something like

//#if MIDP2
//# setFullScreenMode(true);
//#endif

Code Page settings

There is a know code page/encoding issue with antenna and content of the jad-file. Also be sure to have UTF-8 encoding on or adjust the build-task of antenna to use your encoding to have proper class files created (within eclipse, the container code page is used instead UTF-8).
Please login to post a comment.
Quick Links
WhatIsThis about?
Midlets (mobile apps)
TimeLine
Charley a dog's life
MovieReview
Impressum
Project (internal)

Logged in Users: (2)
… and 9 Guests.

< October 2008 >
SunMonTueWedThuFriSat
1234
567891011
12131415161718
19202122232425
262728293031

Icon-Snip more changes...

Blogs
>>++ vox.machina ++
>>Zitate - Sprüche - Aphorismen
>>Wil Wheaton
>>Mathematische Kleinigkeiten
>>William Gibson
>>instant-thinking
>>Over heard in NY

nearby  sites
link=http://www.mozilla.org/products/firefox/central.html
link=http://www.nutellausa.com/
link=http://snipsnap.org
link=http://www.amazon.de/exec/obidos/registry/wishlist/ref=cs_nav_top_2/028-7651535-0049343
RSS Feed RSS Feed
post to del.icio.us

Stats: 1179 snips by 16 users
created 5 years and 271 days ago

Powered by
>>SnipSnap 1.0b2-uttoxeter
with SnipScale 1.1.0



This work is licensed under a
>>Creative Commons License.

SEARCH