如果项目属性文件(project.properties)显示为自动生成,我该如何编辑它?

3

我希望放置:

manifestmerger.enabled=true

在我的project.properties文件中(在这里查看原因;从谷歌搜索来看,似乎应该将此行添加到project.properties),然而,在我的project.properties文件顶部,它说:
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!

如果我的project.properties文件是自动生成的,而且我不应该编辑它,那么我应该把manifestmerger.enabled=true语句放在哪里?我一直在找一个明显的地方来放置它或者如何编辑project.properties,使得当文件被自动生成时我的编辑不会被替换。
1个回答

0
你可以将这个设置加入到ant.properties文件中。 ant.properties文件可以由你自己创建。它只能由……编辑。
根据build.xml:
     The ant.properties file can be created by you. It is only edited by the
     'android' tool to add properties to it.
     This is the place to change some Ant specific build properties.
     Here are some properties you may want to change/update:

     source.dir
         The name of the source directory. Default is 'src'.
     out.dir
         The name of the output directory. Default is 'bin'.

     For other overridable properties, look at the beginning of the rules
     files in the SDK, at tools/ant/build.xml

     Properties related to the SDK location or the project target should
     be updated using the 'android' tool with the 'update' action.

     This file is an integral part of the build system for your
     application and should be checked into Version Control Systems.

而且manifestmerger.enabled被列在tools/ant/build.xml中。


真的吗?有趣...Google建议将其放在project.properties中,但我会尝试一下。 - Cornstalks
无法工作。甚至尝试编辑build.xml以覆盖其中的属性,但没有成功。 - lef

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接