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

Reply
Contributor
heynow
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!

 

Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
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
Please use plain text.
Contributor
heynow
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!

Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
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
Please use plain text.
Contributor
heynow
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.

 

Please use plain text.