Updated Branches: refs/heads/develop a1265c5ae -> 97312efd1
values are expanded when reading from a properties file, and 654 is reduced to a single $ and not expanded Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/b289eff0 Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/b289eff0 Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/b289eff0 Branch: refs/heads/develop Commit: b289eff072c6adcc39dcf300bd2b29a25fbafd61 Parents: a1265c5 Author: Alex Harui <[email protected]> Authored: Wed Jan 15 15:16:55 2014 -0800 Committer: Alex Harui <[email protected]> Committed: Wed Jan 15 15:16:55 2014 -0800 ---------------------------------------------------------------------- ant_on_air/src/org/apache/flex/ant/Ant.as | 5 ++ .../src/org/apache/flex/ant/tags/Property.as | 4 +- ant_on_air/tests/test.properties | 24 ++++++++ ant_on_air/tests/testpropertiesfile.xml | 58 ++++++++++++++++++++ 4 files changed, 89 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b289eff0/ant_on_air/src/org/apache/flex/ant/Ant.as ---------------------------------------------------------------------- diff --git a/ant_on_air/src/org/apache/flex/ant/Ant.as b/ant_on_air/src/org/apache/flex/ant/Ant.as index 11e05a5..289d132 100644 --- a/ant_on_air/src/org/apache/flex/ant/Ant.as +++ b/ant_on_air/src/org/apache/flex/ant/Ant.as @@ -195,6 +195,11 @@ package org.apache.flex.ant } } } + else if (i > 0 && input.charAt(i - 1) == "$") + { + input = input.substring(0, i - 1) + input.substring(i); + i++; + } i++; i = input.indexOf("${", i); } http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b289eff0/ant_on_air/src/org/apache/flex/ant/tags/Property.as ---------------------------------------------------------------------- diff --git a/ant_on_air/src/org/apache/flex/ant/tags/Property.as b/ant_on_air/src/org/apache/flex/ant/tags/Property.as index d6076c3..1b52893 100644 --- a/ant_on_air/src/org/apache/flex/ant/tags/Property.as +++ b/ant_on_air/src/org/apache/flex/ant/tags/Property.as @@ -98,7 +98,7 @@ package org.apache.flex.ant.tags val = StringUtil.trim(val); val = val.replace(/\\n/g, "\n"); if (!context.hasOwnProperty(key)) - context[key] = val; + context[key] = ant.getValue(val, context); } continue; } @@ -119,7 +119,7 @@ package org.apache.flex.ant.tags val = val.substr(0, val.length - 1); } else if (!context.hasOwnProperty(key)) - context[key] = StringUtil.trim(val); + context[key] = ant.getValue(StringUtil.trim(val), context); } } http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b289eff0/ant_on_air/tests/test.properties ---------------------------------------------------------------------- diff --git a/ant_on_air/tests/test.properties b/ant_on_air/tests/test.properties new file mode 100644 index 0000000..5c1893f --- /dev/null +++ b/ant_on_air/tests/test.properties @@ -0,0 +1,24 @@ +<?xml version="1.0"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +--> + +test1=basedir +test2=${basedir} +test3=$${basedir} +test4=Foo is $${basedir} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/b289eff0/ant_on_air/tests/testpropertiesfile.xml ---------------------------------------------------------------------- diff --git a/ant_on_air/tests/testpropertiesfile.xml b/ant_on_air/tests/testpropertiesfile.xml new file mode 100644 index 0000000..016fe78 --- /dev/null +++ b/ant_on_air/tests/testpropertiesfile.xml @@ -0,0 +1,58 @@ +<?xml version="1.0"?> +<!-- + + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +--> + +<project name="ant_on_air_test" basedir="." default="test"> + + <!--location of property file --> + <property file="${basedir}/test.properties" description="Properties for Ant On AIR project" /> + + <target name="test" > + <echo>${test1}</echo> + <fail message="test1 was not 'basedir'"> + <condition> + <not> + <equals arg1="basedir" arg2="${test1}" /> + </not> + </condition> + </fail> + <echo>${test2}</echo> + <fail message="test2 was not expanded"> + <condition> + <not> + <equals arg1="${basedir}" arg2="${test2}" /> + </not> + </condition> + </fail> + <echo>${test3}</echo> + <fail message="test3 was expanded"> + <condition> + <equals arg1="${basedir}" arg2="${test3}" /> + </condition> + </fail> + <echo>${test4}</echo> + <fail message="test4 was expanded"> + <condition> + <not> + <equals arg1="Foo is $${basedir}" arg2="${test4}" /> + </not> + </condition> + </fail> + </target> +</project>
