如何从ant生成黑莓资源包?

发布于 2024-09-16 11:49:28 字数 727 浏览 7 评论 0原文

在我的 BlackBerry eclipse 项目中,我使用资源包。所以我有一对文件...

Application.rrc
Application.rrh

这些文件是由 Eclipse 中名为 BlackBerry Resources Builder 的构建器编译的。

这是作为预编译步骤完成的,因为它创建了一个名为 的新文件夹

.locale_interfaces

,其中包含生成的 java 类的以下路径......

\.locale_interfaces\<package>\ApplicationResource.java

我在代码中引用它来访问资源。

我的问题是如何从 ant 生成此文件?

我正在使用 bb-ant-tools 包,但是当我调用 rapc 编译我的代码时,我收到错误,抱怨缺少 ApplicationResource.java 文件。

显然,我缺少一个步骤,因为未生成 .locale_interfaces 文件夹和其中的 ApplicationResource.java 类。我将 Application.rrc 文件与其他源一起提供给 rapc,但这似乎没有什么区别。

有谁成功地从 ant 构建了这样的资源包吗?

任何帮助将不胜感激。

谢谢!

In my BlackBerry 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.

My question is how do I generate this 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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

岁月苍老的讽刺 2024-09-23 11:49:28

您不需要做任何特殊的事情来让它们从 ant 任务正确编译。只要 .rrc 和 .rr 文件都在中即可。标记在 rapc 任务中,它应该正确编译它。这就是我们在 ant build.xml 文件中所做的事情,它工作得很好。

You shouldn't need to do anything special to have them compile properly from the ant task. As long as both the .rrc and .rrh files are in the <src> tag in the rapc task, it should compile it properly. This is what we do in our ant build.xml file and it works fine.

一片旧的回忆 2024-09-23 11:49:28

Ant 不会创建 .locale_interfaces 文件夹。它应该自动编译这些东西。一种解决方法是创建一个名为“ApplicationResource.java”的接口。使其根据哪个整数引用哪个字符串来反映 .rr 文件。
例如:

MENU_TEXT#0=0;

翻译为

int MENU_TEXT = 0;

将在您的界面中 。这将允许编译。当您运行程序时,一切都应该正常工作。希望这有帮助。

Ant doesn't create the .locale_interfaces folder. It should compile those things automatically. One work around is to create an interface titled "ApplicationResource.java". Make it reflect the .rrh file in terms of what integer refers to what string.
For Example:

MENU_TEXT#0=0;

would translate to

int MENU_TEXT = 0;

in your interface. This will allow things to compile. When you run your program, things should just work. Hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文