ANT 读取现有的 MANIFEST 版本并附加到它 [英] ANT read existing MANIFEST version and append to it
问题描述
我需要编写一个 ant 构建脚本,该构建脚本从 META-INF/manifest.mf 文件中读取现有版本并将其附加到该文件中.
I need to script an ant build which reads in the existing version from a META-INF/manifest.mf file and appends to it.
应该可以使用 ANT manifest 任务进行更新,但是我无法阅读现有版本.
The updating should be possible using the ANT manifest task, however I've had trouble reading the existing version.
由于清单条目使用 key: value 而不是 key= value 我无法读取它们使用 ANT 的 loadproperties 任务.
As the manifest entries are use key: value rather than key= value I cant read them in using ANT's loadproperties task.
有人这样做过/有什么想法吗?
Has anyone done this/ have any ideas?
谢谢
推荐答案
任务应该完全符合您的要求.它将新的 Manifest key=value 对附加到现有的 Manifest.知道为什么你不能使用它吗?
The <manifest>
task should do exactly what you want. It will append new Manifest key=value pairs to an existing Manifest. Any idea why you can't use it?
您可以将
任务与各种过滤器阅读器一起使用,然后使用
任务加载结果.它需要一些肘部润滑脂,但它可能是一种以这种方式读取损坏 Manifest 文件的方法,获取值,然后用这些旧值重写一个新的 Manifest 文件.
You can use the <concat>
task with the various filter readers, and then load the result with the <loadproperties>
task. It takes a bit of elbow grease, but it might be a way to read in your damaged Manifest file this way, get the values, and then rewrite a new Manifest file with those old values.
我必须查看您现有 Manifest 的示例以及您要向其中添加的内容,以便准确确定您需要什么.
I'd have to see a sample of your existing Manifest and what you want to add to it in order to figure out exactly what you need.
这篇关于ANT 读取现有的 MANIFEST 版本并附加到它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!