ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# B.34 PropertyTask With `PropertyTask`, you can define `user` properties in your build file. Table B.34:聽Attributes NameTypeDescriptionDefaultRequired`name``String`The name of the Property.n/aYes (unless using `file` or `environment`)`value``String`The value of the Property.n/aYes (unless using `file` or `environment`)`environment``String`Loads properties from the environment with the specified value as prefix. Thus if you specify environment="myenv" you will be able to access OS-specific environment variables via property names "myenv.PATH" or "myenv.TERM".n/aNo`file``String`Path to properties file.n/aNo`override``Boolean`Whether to force override of existing value.`false`No`prefix``String`Used when properites are loaded from file. Prefix is applied to properties loaded from specified file. A "." is appended to the prefix if not specified.n/aNo`refid``String`A reference to a previously defined propertyn/aNo`fallback``String`If a reference cannot be found within the current project scope this attribute specifies a fallback project scope.n/aNo`logoutput``Boolean`Whether to log returned output as MSG\_INFO instead of MSG\_VERBOSE.`true`No`quiet``Boolean`Whether to display a warning if the property file does not exist.`true`No ### Note Important note about scope: when the `<property>` tag is called inside a `<phingcall>` tag, any properties are set in a new local scope. Thus, any properties or other variables set inside that scope will cease to exist (or revert to their previous value) once the parent `<phingcall>` tag completes. B.34.1 Examples ``` <property name="strings.test" value="Harr harr, more power!" /> <echo message="${strings.test}" /> <property name="foo.bar" value="Yet another property..." /> <echo message="${foo.bar}" /> <property file="build.properties" /> <property environment="env" /> <property name="newproperty" value="Hello"> <filterchain> <replaceregexp> <regexp pattern="Hello" replace="World" ignoreCase="true"/> </replaceregexp> </filterchain> </property> ``` B.34.2 Supported Nested Tags: - `filterchain`