简体   繁体   English

如何在Android中使用ant来构建没有依赖关系的jar(库jar)?

[英]How to build a jar without dependencies (library jars) using ant in android?

My library project include several library jars. 我的图书馆项目包括几个图书馆罐子。

I want to publish a jar without dependencies of my library project. 我想发布一个不依赖我的图书馆项目的jar。

How to build it using ant? 如何使用ant构建它?

Thank you 谢谢

You need generate module_name_of_project.xml and include jar on target, below screen-shots works on Mac OS and Intellij IDEA . 您需要生成module_name_of_project.xml并在目标上包含jar,下面的屏幕截图适用于Mac OSIntellij IDEA

— First step generate module_name_of_project.xml —第一步生成module_name_of_project.xml

1个

— Write your output module name —写下您的输出模块名称

1个

— Second step write on new generated file, between: —第二步,写入新生成的文件,介于:

<target name="compile.module.MODULE_NAME.production" ... </target>

this: 这个:

<jar destfile="${MODULE_NAME.output.dir}/JAR_NAME.jar"
             basedir="${MODULE_NAME.output.dir}"/>

After you need just write ant on terminal (console), also you need be in project folder. 在只需要在终端 (控制台)上写ant之后,也需要在项目文件夹中。

Can be useful: How install ant 可能有用: 如何安装ant

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM