Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Contributor
Posts: 23
Registered: ‎09-23-2009
My Device: Not Specified
Accepted Solution

Compiling .rrc files from ant

In my eclipse project I use resource bundles. So I have a pair of files...

 

Application.rrc

Application.rrh

 

These files are compiled by a builder called BlackBerry Resources Builder in eclipse.

 

This is done as a pre-compile step as it creates a new folder called

 

.locale_interfaces

 

which contains the following path to a generated java class....

 

\.locale_interfaces\<package>\ApplicationResource.java

 

which I reference in my code to access resources. Eclipse generates this before compiling the rest of the sources since those sources reference this generated file.

 

 

My question is how do I generate this .locale_interfaces/<package>/ApplicationResource.java file from ant?

 

I am using the bb-ant-tools package but when I call rapc to compile my code I get errors complaining about the missing ApplicationResource.java file.

 

Apparently there is a step I am missing as the .locale_interfaces folder and the ApplicationResource.java class within are not being generated. I am feeding the Application.rrc file to rapc along with the other sources but that seems to make no difference.

 

Does anyone have any success building such resource bundles from ant?

 

Any help would be appreciated.

 

Thanks!

 

Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Compiling .rrc files from ant

i use eclipse without the plugin. in my project there is an ApplicationResource.java interface (with all values as 0).

it is not included in the jde project as the jde creates it on compile time (as you have noticed)

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
Posts: 23
Registered: ‎09-23-2009
My Device: Not Specified

Re: Compiling .rrc files from ant

I don't understand. If you have a stub file with all values as 0 then how do you find your resources in the built product? I need to build entirely without eclipse, i.e. for automated builds, so  I need the real values in that interface. Can you explain a bit more?

 

Thanks!

Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Compiling .rrc files from ant

the (real) interface is created by the compiler, i think.

i use it only as a dummy interface to allow eclipse to handle the resource strings.

the resource file has to be named AppNameResource and must include a long BUNDLE_ID and a String BUNDLE_NAME.

 

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
Posts: 23
Registered: ‎09-23-2009
My Device: Not Specified

Re: Compiling .rrc files from ant

My problem was I needed to add both the .rrc and .rrh as extensions to my <src> tag. I had previously only had .rrc added.

 

    <path id="src.files">
        <fileset dir="${basedir}/src">
            <include name="**/*.java" />
            <include name="**/*.rrc" />
            <include name="**/*.rrh" />
        </fileset>
    </path>

 

It compiles fine now.