Phi*_*itt 2 java xml ant android
之后引用短短几个 其他 的问题,我发现没有这些问题的答案在我的项目都在工作.将jar放入每个单独模块的/ libs文件夹中,ant build正确运行并产生输出.删除所有/ libs文件夹并在我需要的每个模块中包含一个ant.properties文件(aka build.properties)后,ant build已停止工作.
ant.properties:
# This file is used to override default values used by the Ant build system.
#
# This file must be checked in Version Control Systems, as it is
# integral to the build system of your project.
# This file is only used by the Ant script.
# You can use this to override default values such as
# 'source.dir' for the location of your java source folder and
# 'out.dir' for the location of your output folder.
jar.libs.dir=../ExternalJars/libs
Run Code Online (Sandbox Code Playgroud)
在build.xml
<property file="ant.properties" />
<loadproperties srcFile="project.properties" />
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />
<target name="full-debug" depends="debug">
</target>
<target name="full-release" depends="clean,release">
</target>
Run Code Online (Sandbox Code Playgroud)
据我所知,这些文件都是正确编写的 - 相对于ant.properties文件,路径都是正确的,jars是应该的位置,模块使用所有正确的类和部件等.
思考?
基于另一个答案,这是我为build.xml脚本实现的,以支持jar.libs.dir属性:
<target name="-pre-compile">
<property name="project.all.jars.path.temp" value="${toString:project.all.jars.path}" />
<path id="project.all.jars.path">
<path path="${project.all.jars.path.temp}"/>
<fileset dir="${jar.libs.dir}">
<include name="*.jar"/>
</fileset>
</path>
</target>
Run Code Online (Sandbox Code Playgroud)
由于使用了<path path ="..."/>,因此即使默认情况下向路径元素添加了多个JAR文件,它看起来也足够安全.
| 归档时间: |
|
| 查看次数: |
2272 次 |
| 最近记录: |