使用ANT编译J2ME [英] Compiling j2me using ANT

查看:222
本文介绍了使用ANT编译J2ME的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经提到这篇文章<一后创建一个J2ME项目href=\"http://www.securitypronews.com/it/applicationdevelopment/spn-19-20030611J2MEUsingAntwithJ2ME.html\"相对=nofollow> J2MEUsingAntwithJ2ME 。现在,我有在增加资源问题(如图像)和库(如JAR和ZIP文件)。
我在 RES 文件夹复制的资源,本文中出现的,但是当我提取的.jar 文件,它没有任何资源。

I have created a J2ME project after referring to this article J2MEUsingAntwithJ2ME. Now I am having problems in adding resources (such as images) and libraries (such as jar and zip files). I have copied the resources in the res folder as shown in this article but when I extract the .jar file, it does not have any resources.

感谢

推荐答案

从该示例:

<jar basedir="${build}/preverifiedobf"
     jarfile="${build}/bin/${program_name}.jar"
     manifest="bin/MANIFEST.MF">
  <fileset dir="${top}/${res}">
    <include name="${package_name}/*.png"/>
  </fileset>
</jar>

这将只包括 *。PNG 文件,这是在 / RES 文件夹中。如果您想包括更多种类,添加更多的&LT;包括&GT; 线或包括$ {包名} / **

This will only include *.png files which are in /res folder. If you want to include more types, add more <include> lines or include "${package_name}/**".

如果您要包括现有的.jar文件的内容,您可以不能解压缩他们是这样的:

If you want to include the content of existing .jar files, you can unjar them like this:

<mkdir dir="${build}/libs"/>
<unjar src="yourlibrary.jar" dest="${build}/libs" />

然后你可以再坛子里起来:

Then you can jar them up again:

<jar basedir="${build}/preverifiedobf"
     jarfile="${build}/bin/${program_name}.jar"
     manifest="bin/MANIFEST.MF">
  <fileset dir="${top}/${res}">
    <include name="${package_name}/*.png"/>
  </fileset>
  <fileset dir="${build}/libs">
    <include name="**/*"/>
  </fileset>
</jar>

借助的Apache Ant手册包含所有支持的标记有很多的例子。

The Apache Ant manual contains a lot of examples for all the supported tags.

这篇关于使用ANT编译J2ME的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆