git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@794666 13f79535-47bb-0310-9956-ffa450edef68master
@@ -237,7 +237,7 @@ is equivalent to the following properties: | |||||
<h5>default loading (semanticAttributes=true)</h5> | <h5>default loading (semanticAttributes=true)</h5> | ||||
<p>This entry in a build file: | <p>This entry in a build file: | ||||
<pre> <xmlproperty file="somefile.xml" | |||||
<pre> <xmlproperty file="somefile.xml" keepRoot="false" | |||||
semanticAttributes="true"/></pre> | semanticAttributes="true"/></pre> | ||||
is equivalent to the following entries in a build file: | is equivalent to the following entries in a build file: | ||||
<pre> | <pre> | ||||
@@ -246,22 +246,22 @@ is equivalent to the following entries in a build file: | |||||
<property name="build.classes" location="${build.folder}/classes" id="build.classes"/> | <property name="build.classes" location="${build.folder}/classes" id="build.classes"/> | ||||
<property name="build.reference" refid="build.classes"/> | <property name="build.reference" refid="build.classes"/> | ||||
<property name="run-time.jars" value="*.jar/> | |||||
<property name="run-time.jars" value="*.jar"/> | |||||
<classpath id="compile.classpath"> | |||||
<path id="compile.classpath"> | |||||
<pathelement location="${build.classes}"/> | <pathelement location="${build.classes}"/> | ||||
</classpath> | |||||
</path> | |||||
<classpath id="run-time.classpath"> | |||||
<path id="run-time.classpath"> | |||||
<path refid="compile.classpath"/> | <path refid="compile.classpath"/> | ||||
<pathelement path="${run-time.jars}"/> | <pathelement path="${run-time.jars}"/> | ||||
</classpath> | |||||
</path> | |||||
</pre> | </pre> | ||||
<h5>includeSemanticAttribute="true"</h5> | <h5>includeSemanticAttribute="true"</h5> | ||||
<p>This entry in a build file: | <p>This entry in a build file: | ||||
<pre> <xmlproperty file="somefile.xml" | <pre> <xmlproperty file="somefile.xml" | ||||
semanticAttributes="true" | |||||
semanticAttributes="true" keepRoot="false" | |||||
includeSemanticAttribute="true"/> | includeSemanticAttribute="true"/> | ||||
</pre> | </pre> | ||||
is equivalent to the following entries in a build file: | is equivalent to the following entries in a build file: | ||||
@@ -269,18 +269,18 @@ is equivalent to the following entries in a build file: | |||||
<property name="version.value" value="0.0.1"/> | <property name="version.value" value="0.0.1"/> | ||||
<property name="build.folder" value="build"/> | <property name="build.folder" value="build"/> | ||||
<property name="build.classes.location" location="${build.folder}/classes"/> | <property name="build.classes.location" location="${build.folder}/classes"/> | ||||
<property name="build.reference.refid" refid="build.location"/> | |||||
<property name="build.reference.refid" refid="build.classes"/> | |||||
<property name="run-time.jars" value="*.jar/> | |||||
<property name="run-time.jars" value="*.jar"/> | |||||
<classpath id="compile.classpath"> | |||||
<path id="compile.classpath"> | |||||
<pathelement location="${build.classes}"/> | <pathelement location="${build.classes}"/> | ||||
</classpath> | |||||
</path> | |||||
<classpath id="run-time.classpath"> | |||||
<path id="run-time.classpath"> | |||||
<path refid="compile.classpath"/> | <path refid="compile.classpath"/> | ||||
<pathelement path="${run-time.jars}"/> | <pathelement path="${run-time.jars}"/> | ||||
</classpath> | |||||
</path> | |||||
</pre> | </pre> | ||||
@@ -15,8 +15,11 @@ | |||||
See the License for the specific language governing permissions and | See the License for the specific language governing permissions and | ||||
limitations under the License. | limitations under the License. | ||||
--> | --> | ||||
<project xmlns:au="antlib:org.apache.ant.antunit"> | |||||
<project default="antunit" xmlns:au="antlib:org.apache.ant.antunit"> | |||||
<description/> | <description/> | ||||
<import file="../antunit-base.xml" /> | |||||
<target name="test-empty"> | <target name="test-empty"> | ||||
<xmlproperty file="xmlproperty-test.xml"/> | <xmlproperty file="xmlproperty-test.xml"/> | ||||
<au:assertTrue> | <au:assertTrue> | ||||
@@ -64,5 +67,78 @@ | |||||
</condition> | </condition> | ||||
</fail> | </fail> | ||||
</target> | </target> | ||||
<target name="createDocExample"> | |||||
<mkdir dir="${input}"/> | |||||
<echoxml file="${input}/example.xml"> | |||||
<root-tag> | |||||
<version value="0.0.1"/> | |||||
<build folder="build"> | |||||
<classes id="build.classes" location="${build.folder}/classes"/> | |||||
<reference refid="build.classes"/> | |||||
</build> | |||||
<compile> | |||||
<classpath pathid="compile.classpath"> | |||||
<pathelement location="${build.classes}"/> | |||||
</classpath> | |||||
</compile> | |||||
<run-time> | |||||
<jars>*.jar</jars> | |||||
<classpath pathid="run-time.classpath"> | |||||
<path refid="compile.classpath"/> | |||||
<pathelement path="${run-time.jars}"/> | |||||
</classpath> | |||||
</run-time> | |||||
</root-tag> | |||||
</echoxml> | |||||
</target> | |||||
<target name="testSemanticLoadingDocExample" depends="createDocExample"> | |||||
<xmlproperty file="${input}/example.xml" semanticAttributes="true" | |||||
keepRoot="false"/> | |||||
<au:assertPropertyEquals name="version" value="0.0.1"/> | |||||
<au:assertPropertyEquals name="build.folder" value="build"/> | |||||
<property name="b.c" location="${build.folder}/classes"/> | |||||
<au:assertPropertyEquals name="build.classes" value="${b.c}"/> | |||||
<au:assertReferenceSet refid="build.classes"/> | |||||
<property name="b.c.r" refid="build.classes"/> | |||||
<au:assertPropertyEquals name="b.c.r" value="${b.c}"/> | |||||
<au:assertPropertyEquals name="build.reference" value="${b.c}"/> | |||||
<au:assertPropertyEquals name="run-time.jars" value="*.jar"/> | |||||
<au:assertReferenceIsType refid="compile.classpath" type="path"/> | |||||
<au:assertReferenceIsType refid="run-time.classpath" type="path"/> | |||||
<property name="c.c" refid="compile.classpath"/> | |||||
<au:assertPropertyEquals name="c.c" value="${b.c}"/> | |||||
<property name="rt.c" refid="run-time.classpath"/> | |||||
<property name="glob.dot.jar" location="*.jar"/> | |||||
<au:assertPropertyEquals name="rt.c" | |||||
value="${b.c}${path.separator}${glob.dot.jar}"/> | |||||
</target> | |||||
<target name="testIncludeSemanticDocExample" depends="createDocExample"> | |||||
<xmlproperty file="${input}/example.xml" semanticAttributes="true" | |||||
keepRoot="false" includeSemanticAttribute="true"/> | |||||
<au:assertPropertyEquals name="version.value" value="0.0.1"/> | |||||
<au:assertPropertyEquals name="build.folder" value="build"/> | |||||
<property name="b.c" location="${build.folder}/classes"/> | |||||
<au:assertPropertyEquals name="build.classes.location" value="${b.c}"/> | |||||
<au:assertReferenceSet refid="build.classes"/> | |||||
<property name="b.c.r" refid="build.classes"/> | |||||
<au:assertPropertyEquals name="b.c.r" value="${b.c}"/> | |||||
<au:assertPropertyEquals name="build.reference" value="${b.c}"/> | |||||
<au:assertPropertyEquals name="run-time.jars" value="*.jar"/> | |||||
<au:assertReferenceIsType refid="compile.classpath" type="path"/> | |||||
<au:assertReferenceIsType refid="run-time.classpath" type="path"/> | |||||
<property name="c.c" refid="compile.classpath"/> | |||||
<!-- not set at all because property's name is build.classes.refid now --> | |||||
<property name="b.c.loc" location="${build.classes}"/> | |||||
<au:assertPropertyEquals name="c.c" value="${b.c.loc}"/> | |||||
<property name="rt.c" refid="run-time.classpath"/> | |||||
<property name="glob.dot.jar" location="*.jar"/> | |||||
<au:assertPropertyEquals name="rt.c" | |||||
value="${b.c.loc}${path.separator}${glob.dot.jar}"/> | |||||
</target> | |||||
</project> | </project> | ||||