09-15-2009 11:00 AM
Hi everyone. I am trying to use one source tree and make two apps for the same device but branded slightly different. I am using the rapc preprocessor to modify the source based on the distribution along with ant and Eclipse (with bb plugin). For the most part I have it working. The problem is when I am simulating only one app will work since they are fighting over the persistant store. I tried just renaming the apps based on their brand but that just gets them onto the simulator.
The only fix I can see is to use the preprocessor to conditionally name the package. Is there some other way such as some jad magic? I have to say that the Eclipse plugin is quickly becoming usless for any real project.
Solved! Go to Solution.
09-15-2009 12:20 PM
I've found it easier to use the c++ preprocessor but in any case you can use on single persistent hashtable with fixed guid and make a different
entry for each app. Alternatively, it maybe better to just define a symbol to use as the po guid. I'm not sure what
the rapc preprocessor supports but they have uses beyond build variants (#if RIM_OS_TGT>40300) etc and I routinely
use __LINE__ in place of stack trace info and use the c++ TIMESTAMP( IIRC, cant remember exactly) for keeping
track of builds.
09-15-2009 02:02 PM
Good idea about the c preprocessor. I used to use the c preprocessor when doing Playstation 2 assembly. Man I would have thought that there would be a better way in this day and age. Even C# has methods for conditional compiles. I am tempted to just drop the whole Eclipse thing and use an editor but it's hard to leave refactoring and code completionbehind
Thanks for the responses.
09-15-2009 02:05 PM
09-15-2009 02:15 PM
Unless I am mistaken, they may support a preprocessor to a certain point, but they don't allow for build configurations. Right now my defines are stored in ant files as properties and get included based on targets. The Eclipse plugin has no way of knowing which defines are active. Also Eclipse doesn't know anything about the preprocessor as all the directives start with comments, so Eclipse ignores them and can show false errors in the code.
Antenna has been the closest thing I have found since it will comment the original code on the fly in Eclipse but there is not support for build configurations.
09-15-2009 02:20 PM
09-15-2009 09:45 PM
Does anyone have an ant target that calls a preprocessor (gcc or vc) per source file? I am new to ant and I am having some trouble with it.
<target name="preprocess"> <apply executable="cl.exe" dest="D:/temp" parallel="false"> <arg value="-E"/> <srcfile/> <arg value=">"/> <targetfile/> <fileset refid="source.files"/> <mapper type="glob" from="*.java" to="*.jxx"/> </apply> </target>