如何在 Ant 目标中使用文件大小 [英] How to use size of file inside Ant target

查看:24
本文介绍了如何在 Ant 目标中使用文件大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在用 Ant 构建脚本替换我的自制构建脚本.

I'm currently in the process of replacing my homebrewn build script by an Ant build script.

现在我需要用特定文件的大小替换各种标记.我知道如何通过 <length> 任务获取以字节为单位的大小并将其存储在属性中,但我也需要以千字节和兆字节为单位的大小.

Now I need to replace various tokens by the size of a specific file. I know how to get the size in bytes via the <length> task and store in in a property, but I need the size in kilobytes and megabytes too.

如何访问其他表示形式(KB、MB)的文件大小或从 Ant 目标中计算这些值并将它们存储在属性中?

How can I access the file size in other representations (KB, MB) or compute these values from within the Ant target and store them in a property?

在我发现

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆