Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » DSDP - Mobile Tools for Java (MTJ) » Preprocess BlackBerry Code
Preprocess BlackBerry Code [message #482217] Tue, 25 August 2009 17:35 Go to next message
Eclipse UserFriend
Originally posted by: wawa321.gmx.net

Hello,

I have a problem using MTJ in conjunction with the BlackBerry JDE and
bb-ant-tools. After spending a lot of time to make the whole system of
compilation, debugging, automatic simulator start-up, etc work, I am stuck
with an annoying problem, which is probably easy to solve for the MTJ
developer team:

In order to signal the BlackBerry JDE rapc compiler that a certain file
needs preprocessing, one has to add the line //#preprocess
to the top of the java code file. This works well on the side of
bb-ant-tools and BlackBerry JDE. At the same time, I would like to make
use of the great features that Eclipse/MTJ provide. Unfortunately, MTJ's
preprocessor gets confused about the //#preprocess directive. I get the
following error description:

Error parsing line: //#preprocess

Probably, the easiest way to solve this problem would be to let the
preprocessor ignore the //#preprocess directive --- or possibly all
undefined preprocessor directives. A possible alternative would be to
allow the user to configure ignored directives. Even if that were outside
the GUI in a config file, it would still solve the problem.

By the way, if you think: 'Research in Motion will release the perfect
Eclipse plug-in soon, anyway.' --- I have lost that hope. This little
change would provide the last piece of a perfectly usable IDE for
BlackBerry developers.

What do you think?

Thanks in advance, wandi
Re: Preprocess BlackBerry Code [message #482285 is a reply to message #482217] Wed, 26 August 2009 05:49 Go to previous messageGo to next message
David Lucena is currently offline David LucenaFriend
Messages: 74
Registered: August 2009
Member
The problem is that you want to make some tools compatible with other tools. I was acostumed to use C preprocessor to parse my java files, but of course, I could not use any java editor as it would complain about #include directives.

Did I complained to Eclipse developers or Netbean developers? No, as this would have been a dumb idea.

No offense, please, but I think this complain does not belong here. Of course, if MTJ developers decide that this could be a great idea and simple to develop, it would be nice, but when some one makes a project, it is not his responsability to make it compatible with other projects, as long as it is not required by some writen rule.

And really, if you plan to use MTJ, then get rid of the other tools as I have got rid of CPP, Makefiles and so on...

Regards.

David Lucena.
Re: Preprocess BlackBerry Code [message #482374 is a reply to message #482285] Wed, 26 August 2009 11:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wawa321.gmx.net

Hello David,

thank you for your answer. My previous post was not meant to sound like a
complaint. I do not say that the preprocessor does not work in the way it
should. I simply suggest this as a feature for compatibility and
flexibility.

Your example is quite extreme but I think I understand the point: using
different tools together that were not built to be used together should be
avoided where possible.

I would like to give you a short explanation of why the challenges of
developing BlackBerry software represent a special case: the source code
is written in Java, but the file that is installed on the device is not a
JAD/JAR pair but a so called COD file. This file can only be built with
the original compiler. The bb-ant-tools work perfectly within the Eclipse
environment to connect with the BlackBerry tools.

If I were to follow the rule to not use tools together that are not meant
be used together I would have to stop using Eclipse and switch to the
BlackBerry JDE. This piece of legacy software is on the level of IDEs of
the early 90s, which makes writing code a terrible experience. Research in
Motion (RIM) has released an Eclipse plug-in by the end of last year,
which does not work properly. This tool produces some random
preverification errors when the application is started on the device, if
the COD file exceeds a certain size.

So for a developer who wishes to create complex (large COD) software for
BlackBerry there is no real choice to use other tools. Of course I hope
that RIM will soon provide their long promised tools for Pulsar/MTJ.
Unfortunately, when I look at how thing went in the past I am not very
confident.

I think the point is, whether the MTJ team decides to support this special
case of BlackBerry development or to leave this problem to RIM. Of course,
this probably cannot be the decision of a single developer but is a
strategic decision. I just point out that the solution might be a snip of
a finger away.

If you think this post does not fit into the MTJ newsgroup, could you
please tell me a newsgroup or forum, which is more adequat? I have posted
this here because my suggestion concerns the MTJ preprocessor.

With my best greetings, Wandi
Re: Preprocess BlackBerry Code [message #482394 is a reply to message #482374] Wed, 26 August 2009 12:48 Go to previous messageGo to next message
David Lucena is currently offline David LucenaFriend
Messages: 74
Registered: August 2009
Member
I really think that it should be a way of integrating the build tools from blackberry without the MTJ need to adapt the //#preprocessor directive. Anyway, I think that the fact of ignoring //#preprocessor directive is not part of MTJ really, but antenna preprocessor itself. Maybe there could be a possibility for the antenna preprocessor to add ignored tokens, but at the moment I cannot tell you certaint.

I have the source code of antenna preprocessor, because I want to solve some issue with the //#include directive. If I could have time to solve this problem, then I would see if ther should be the possibility of implementing what you want.

Anyway, that solution (both your needs and mines) would be only a patch, not yet "legally" aproved by Eclipse, so we also would need some tweak in the exlipse subdirectory substituting one library preprocessor by other.

Anyway, as I have at the moment too much work in my job, both of the needs will be just smoke.

But really try to see if someone has tried to adapt the bb-ant tools to MTJ, as I think it would be possible.
Re: Preprocess BlackBerry Code [message #483161 is a reply to message #482394] Mon, 31 August 2009 12:36 Go to previous messageGo to next message
David Lucena is currently offline David LucenaFriend
Messages: 74
Registered: August 2009
Member
I already have a new version of the preprocessor, accepting //#preprocess directive, but I cannot use it in eclipse due to the package containing an RSA key that of course I cannot generate for the new package.

Maybe Diego could help, although I don't really know if the ones from eclipse will accept this "patch" as a requirement for MTJ.

Anyway, whoever whants the modified source code, I'm willing to send it without problems.

David Lucena.
Re: Preprocess BlackBerry Code [message #576608 is a reply to message #482217] Wed, 26 August 2009 05:49 Go to previous messageGo to next message
David Lucena is currently offline David LucenaFriend
Messages: 74
Registered: August 2009
Member
The problem is that you want to make some tools compatible with other tools. I was acostumed to use C preprocessor to parse my java files, but of course, I could not use any java editor as it would complain about #include directives.

Did I complained to Eclipse developers or Netbean developers? No, as this would have been a dumb idea.

No offense, please, but I think this complain does not belong here. Of course, if MTJ developers decide that this could be a great idea and simple to develop, it would be nice, but when some one makes a project, it is not his responsability to make it compatible with other projects, as long as it is not required by some writen rule.

And really, if you plan to use MTJ, then get rid of the other tools as I have got rid of CPP, Makefiles and so on...

Regards.

David Lucena.
Re: Preprocess BlackBerry Code [message #576778 is a reply to message #576608] Wed, 26 August 2009 11:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wawa321.gmx.net

Hello David,

thank you for your answer. My previous post was not meant to sound like a
complaint. I do not say that the preprocessor does not work in the way it
should. I simply suggest this as a feature for compatibility and
flexibility.

Your example is quite extreme but I think I understand the point: using
different tools together that were not built to be used together should be
avoided where possible.

I would like to give you a short explanation of why the challenges of
developing BlackBerry software represent a special case: the source code
is written in Java, but the file that is installed on the device is not a
JAD/JAR pair but a so called COD file. This file can only be built with
the original compiler. The bb-ant-tools work perfectly within the Eclipse
environment to connect with the BlackBerry tools.

If I were to follow the rule to not use tools together that are not meant
be used together I would have to stop using Eclipse and switch to the
BlackBerry JDE. This piece of legacy software is on the level of IDEs of
the early 90s, which makes writing code a terrible experience. Research in
Motion (RIM) has released an Eclipse plug-in by the end of last year,
which does not work properly. This tool produces some random
preverification errors when the application is started on the device, if
the COD file exceeds a certain size.

So for a developer who wishes to create complex (large COD) software for
BlackBerry there is no real choice to use other tools. Of course I hope
that RIM will soon provide their long promised tools for Pulsar/MTJ.
Unfortunately, when I look at how thing went in the past I am not very
confident.

I think the point is, whether the MTJ team decides to support this special
case of BlackBerry development or to leave this problem to RIM. Of course,
this probably cannot be the decision of a single developer but is a
strategic decision. I just point out that the solution might be a snip of
a finger away.

If you think this post does not fit into the MTJ newsgroup, could you
please tell me a newsgroup or forum, which is more adequat? I have posted
this here because my suggestion concerns the MTJ preprocessor.

With my best greetings, Wandi
Re: Preprocess BlackBerry Code [message #576826 is a reply to message #482374] Wed, 26 August 2009 12:48 Go to previous messageGo to next message
David Lucena is currently offline David LucenaFriend
Messages: 74
Registered: August 2009
Member
I really think that it should be a way of integrating the build tools from blackberry without the MTJ need to adapt the //#preprocessor directive. Anyway, I think that the fact of ignoring //#preprocessor directive is not part of MTJ really, but antenna preprocessor itself. Maybe there could be a possibility for the antenna preprocessor to add ignored tokens, but at the moment I cannot tell you certaint.

I have the source code of antenna preprocessor, because I want to solve some issue with the //#include directive. If I could have time to solve this problem, then I would see if ther should be the possibility of implementing what you want.

Anyway, that solution (both your needs and mines) would be only a patch, not yet "legally" aproved by Eclipse, so we also would need some tweak in the exlipse subdirectory substituting one library preprocessor by other.

Anyway, as I have at the moment too much work in my job, both of the needs will be just smoke.

But really try to see if someone has tried to adapt the bb-ant tools to MTJ, as I think it would be possible.
Re: Preprocess BlackBerry Code [message #576978 is a reply to message #576826] Mon, 31 August 2009 12:36 Go to previous message
David Lucena is currently offline David LucenaFriend
Messages: 74
Registered: August 2009
Member
I already have a new version of the preprocessor, accepting //#preprocess directive, but I cannot use it in eclipse due to the package containing an RSA key that of course I cannot generate for the new package.

Maybe Diego could help, although I don't really know if the ones from eclipse will accept this "patch" as a requirement for MTJ.

Anyway, whoever whants the modified source code, I'm willing to send it without problems.

David Lucena.
Previous Topic:Problem with svn and jmunit exclusions
Next Topic:Errors during source build
Goto Forum:
  


Current Time: Fri Apr 19 21:14:39 GMT 2024

Powered by FUDForum. Page generated in 0.02754 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top