diff options
author | mattinger <[email protected]> | 2006-07-06 21:53:00 +0000 |
---|---|---|
committer | mattinger <[email protected]> | 2006-07-06 21:53:00 +0000 |
commit | 1159111b7a71b72eb04326df33211e1733f7e742 (patch) | |
tree | f0a80c384f633e521649654ab78e6239cf5e0d6f /test/resources/property |
Initial addition into subversion with build script changes
git-svn-id: file:///home/sven/projects/JOGL/temp/ant-contrib/svn/ant-contrib-code/trunk/ant-contrib@5 32d7a393-a5a9-423c-abd3-5d954feb1f2f
Diffstat (limited to 'test/resources/property')
-rw-r--r-- | test/resources/property/pathtofileset.xml | 45 | ||||
-rw-r--r-- | test/resources/property/propertycopy.xml | 33 | ||||
-rw-r--r-- | test/resources/property/propertyselector.properties | 7 | ||||
-rw-r--r-- | test/resources/property/propertyselector.xml | 34 | ||||
-rw-r--r-- | test/resources/property/variabletest.xml | 82 |
5 files changed, 201 insertions, 0 deletions
diff --git a/test/resources/property/pathtofileset.xml b/test/resources/property/pathtofileset.xml new file mode 100644 index 0000000..b330cdf --- /dev/null +++ b/test/resources/property/pathtofileset.xml @@ -0,0 +1,45 @@ +<project default="simple"> + <taskdef resource="net/sf/antcontrib/antcontrib.properties"> + <classpath location="${antcontrib.jar}"/> + </taskdef> + + <target name="cleanup"> + <delete quiet ="yes" dir="${test.dir}"/> + </target> + + <target name="init"> + <property name="test.dir" value="pathtofilesset"/> + <mkdir dir="${test.dir}/0/0"/> + <mkdir dir="${test.dir}/0/1"/> + <mkdir dir="${test.dir}/1/0"/> + <mkdir dir="${test.dir}/1/1"/> + <touch file="${test.dir}/0/0/0.java"/> + <touch file="${test.dir}/0/1/1.java"/> + <touch file="${test.dir}/1/0/2.java"/> + <touch file="${test.dir}/1/1/3.java"/> + </target> + + <target name="simple" depends="init"> + <path id="simple"> + <fileset dir="${test.dir}/0" includes="**/*.java"/> + <fileset dir="${test.dir}/1" includes="**/*.java"/> + </path> + <pathtofileset dir="${test.dir}/0" pathrefid="simple" + ignoreNonRelative="yes" name="simple.0.fileset"/> + <pathconvert targetos="unix" refid="simple.0.fileset" property="simple.0.property"/> + + <pathtofileset dir="${test.dir}/1" pathrefid="simple" + ignoreNonRelative="yes" name="simple.1.fileset"/> + <pathconvert targetos="unix" refid="simple.1.fileset" property="simple.1.property"/> + </target> + + <target name="simple-exception" depends="init"> + <path id="simple"> + <fileset dir="${test.dir}/0" includes="**/*.java"/> + <fileset dir="${test.dir}/1" includes="**/*.java"/> + </path> + <pathtofileset dir="${test.dir}/0" pathrefid="simple" + name="simple.0.fileset"/> + </target> + +</project> diff --git a/test/resources/property/propertycopy.xml b/test/resources/property/propertycopy.xml new file mode 100644 index 0000000..9425416 --- /dev/null +++ b/test/resources/property/propertycopy.xml @@ -0,0 +1,33 @@ +<project default="invalid"> + <target name="invalid"> + <fail>Don't call this file directly.</fail> + </target> + + <target name="setup"> + <taskdef resource="net/sf/antcontrib/antcontrib.properties"> + <classpath location="${antcontrib.jar}"/> + </taskdef> + </target> + + <target name="missingName" depends="setup"> + <propertycopy from="foo"/> + </target> + + <target name="missingFrom" depends="setup"> + <propertycopy name="foo"/> + </target> + + <target name="nonSilent" depends="setup"> + <propertycopy name="foo" from="bar"/> + </target> + + <target name="silent" depends="setup"> + <propertycopy name="foo" from="bar" silent="true"/> + </target> + + <target name="normal" depends="setup"> + <property name="org" value="MyOrg" /> + <property name="org.MyOrg.DisplayName" value="My Organiziation" /> + <propertycopy name="displayName" from="org.${org}.DisplayName" /> + </target> +</project>
\ No newline at end of file diff --git a/test/resources/property/propertyselector.properties b/test/resources/property/propertyselector.properties new file mode 100644 index 0000000..8df9c0e --- /dev/null +++ b/test/resources/property/propertyselector.properties @@ -0,0 +1,7 @@ +#Module 1 Properties +module.Module1.id=1 +module.Module1.name=Module 1 + +#Module 2 Properties +module.Module2.id=2 +module.Module2.name=Module 2 diff --git a/test/resources/property/propertyselector.xml b/test/resources/property/propertyselector.xml new file mode 100644 index 0000000..d03eea0 --- /dev/null +++ b/test/resources/property/propertyselector.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project name="Project" default="build" basedir="."> + + <taskdef resource="net/sf/antcontrib/antcontrib.properties" /> + + <property file="propertyselector.properties" /> + + <target name="init"> + <taskdef resource="net/sf/antcontrib/antcontrib.properties"> + <classpath location="${antcontrib.jar}"/> + </taskdef> + <property file="propertyselector.properties" /> + </target> + + <target name="select.test.grouping.0" depends="init"> + <propertyselector property="module.list" + match="module\.([^\.]*)\.id" + delimiter="," + casesensitive="false" /> + + <echo message="${module.list}" /> + </target> + + <target name="select.test.grouping.1" depends="init"> + <propertyselector property="module.list" + match="module\.([^\.]*)\.id" + select="\1" + delimiter="," + casesensitive="false" /> + + <echo message="${module.list}" /> + </target> + +</project> diff --git a/test/resources/property/variabletest.xml b/test/resources/property/variabletest.xml new file mode 100644 index 0000000..534743e --- /dev/null +++ b/test/resources/property/variabletest.xml @@ -0,0 +1,82 @@ +<?xml version="1.0"?> + +<project name="variabletest" basedir="." default="test1"> + <description> + test build file for the Variable task + </description> + + <taskdef resource="net/sf/antcontrib/antcontrib.properties"> + <classpath location="${antcontrib.jar}"/> + </taskdef> + + <!-- use like a standard property --> + <target name="test1"> + <var name="x" value="6" /> + </target> + + <!-- use like a standard property --> + <target name="test2"> + <var name="x" value="12" /> + </target> + + <!-- can append to itself --> + <target name="test3"> + <var name="x" value="12" /> + <var name="x" value="6 + ${x}" /> <!-- 6 + 12 --> + </target> + + <!-- property can't override --> + <target name="test4"> + <var name="x" value="6" /> + <property name="x" value="12" /> + </target> + + <!-- can append multiple times --> + <target name="test5"> + <var name="str" value="I" /> + <var name="str" value="${str} am" /> + <var name="str" value="${str} a" /> + <var name="str" value="${str} string." /> + <!-- I am a string. --> + </target> + + <!-- property can't override --> + <target name="test6"> + <var name="x" value="blue" /> + <tstamp> + <format property="x" pattern="EEEE" /> + </tstamp> + <var name="x" value="Today is ${x}."/> + <!-- Today is blue. --> + </target> + + <!-- can override property --> + <target name="test7"> + <property name="x" value="12" /> + <var name="x" value="6" /> + </target> + + <!-- TODO: uses the Antelope <if>, need to adjust to use ant-contrib <if> + <target name="test8"> + <var name="x" value="6"/> + <if name="x" value="6"> + <var name="x" value="12"/> + <else> + <var name="x" value="13"/> + </else> + </if> + <echo>${x}</echo> + </target> + --> + + <target name="test9"> + <property name="i" value="2"/> + <var name="i" unset="true"/> + </target> + + <target name="test10"> + <var name="x" value="test"/> + <var name="x" unset="true"/> + <property name="x" value="xxx"/> + </target> +</project> |