ant中如何获取不带扩展名的文件名
我知道如何使用 java 的 ANT 构建工具获取文件的基本名称,但在本例中我想更改文件名以包含构建版本号。不幸的是,该文件的名称是在我导入的另一个 ant 脚本(来自 Android 系统)中设置的,并且我无法设置该文件的属性,或者导入的脚本会抱怨该属性不应已设置。因此,如果我有一个包含 MyApp-release.apk 的属性,并且我想将该值更改为 MyApp-release-1.10.apk,我该怎么做?我知道我可以将 1.10 放在带有基本名称的文件名的开头,这可能就是我会做的,但我宁愿以其他方式进行。
I know how to get the basename for a file with java's ANT build tool, but in this case I want to change the name of a file to include a build version number. Unfortunately the file's name gets set in another ant script (from the android system) which I am importing and I'm not able to set the property for that file or the imported script will complain that the property should not be set already. Thus, if i have a property holding MyApp-release.apk and I want to change the value to MyApp-release-1.10.apk how would I do this? I know I can put the 1.10 at the start of the filename with basename and that's probably what I will do, but I'd rather do it the other way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
表单 http://ant.apache.org/manual/Tasks/basename.html:
Form http://ant.apache.org/manual/Tasks/basename.html: