蚂蚁警告/故障时,文件/ build.properties不见了? [英] Ant warning/failure when file / build.properties is missing?

查看:194
本文介绍了蚂蚁警告/故障时,文件/ build.properties不见了?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的团队Ant任务中从 build.properties 文件具体开发商拉的信息:

My teams ant task pulls in developer specific info from a build.properties file by using the property file tag:

<property file="${user.home}/build.properties.txt" />

然而,当这个文件丢失蚂蚁无论继续。后来在构建过程中,就会试图访问还没有被定义的属性,并试图登录到SVN服务器 $ {user.name} 及其他类似的错误。这些错误是调试相当困难,因为一些我以前没有给出有用的错误消息的Ant任务。

However, when this file is missing ant continues regardless. Later on in the build process it then tries to access properties that have not been defined and tries to log into the svn server as ${user.name} and other similar errors. These errors were quite difficult to debug, as some of the ant tasks I used did not give useful error messages.

我的主要问题是:有没有办法问蚂蚁快速失败的,如果找不到属性文件

推荐答案

我觉得你可以结合使用和失败:

I think you can combine available and fail:

设置属性,如果文件是present

Sets the property if File is present

<available file="${user.home}/build.properties.txt" property="build.properties.present"/>

如果失败属性没有设置

Fails if property is not set

<fail unless="build.properties.present"/>

这篇关于蚂蚁警告/故障时,文件/ build.properties不见了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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