如何从ant生成黑莓资源包?
在我的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您不需要做任何特殊的事情来让它们从 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.
Ant 不会创建 .locale_interfaces 文件夹。它应该自动编译这些东西。一种解决方法是创建一个名为“ApplicationResource.java”的接口。使其根据哪个整数引用哪个字符串来反映 .rr 文件。
例如:
翻译为
将在您的界面中 。这将允许编译。当您运行程序时,一切都应该正常工作。希望这有帮助。
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:
would translate to
in your interface. This will allow things to compile. When you run your program, things should just work. Hope this helps.