在 referencing 之后只是一个few other questions ,我发现这些答案都不适用于我的项目。将 jars 放入每个单独模块的/libs 文件夹中,ant 构建正确运行并产生输出。在删除所有/libs 文件夹并在我需要的每个模块中包含一个 ant.properties
文件(又名 build.properties
)后,ant 构建已停止工作。
Ant 属性:
# 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
构建.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>
据我所知,文件编写正确 - 相对于 ant.properties 文件的路径都是正确的,jar 位于它们应该在的位置,模块使用所有正确的类和部分,等等。
想法?
最佳答案
根据其他答案,这是我对 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>
由于使用了
关于java - jar.libs.dir 没有被正确覆盖吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11637852/