From b9421dc80af485591a9c50cc8921f912e0def11e Mon Sep 17 00:00:00 2001 From: Ashlee Young Date: Fri, 23 Oct 2015 10:05:40 -0700 Subject: Removing sources to replace with download links instead. Change-Id: Ie28789a725051aec0d1b04dd291b7690a7898668 Signed-off-by: Ashlee Young --- .../apache-ant-1.9.6/manual/Tasks/conditions.html | 1087 -------------------- 1 file changed, 1087 deletions(-) delete mode 100644 framework/src/ant/apache-ant-1.9.6/manual/Tasks/conditions.html (limited to 'framework/src/ant/apache-ant-1.9.6/manual/Tasks/conditions.html') diff --git a/framework/src/ant/apache-ant-1.9.6/manual/Tasks/conditions.html b/framework/src/ant/apache-ant-1.9.6/manual/Tasks/conditions.html deleted file mode 100644 index 814072ec..00000000 --- a/framework/src/ant/apache-ant-1.9.6/manual/Tasks/conditions.html +++ /dev/null @@ -1,1087 +0,0 @@ - - - - - - -Conditions Task - - - - -

Conditions

-

Conditions are nested elements of the -<condition> and -<waitfor> tasks. - There are core conditions and custom conditions. Custom - conditions are described in - - Custom Conditions. - Core Conditions are described below. -

-

Core Conditions

- -

These are the nested elements that can be used as conditions in the -<condition> and -<waitfor> tasks.

- -

not

-

The <not> element expects exactly one other -condition to be nested into this element, negating the result of the -condition. It doesn't have any attributes and accepts all nested -elements of the condition task as nested elements as well.

- -

and

-The <and> element doesn't have any attributes and -accepts an arbitrary number of conditions as nested elements - all -nested elements of the condition task are supported. This condition -is true if all of its contained conditions are, conditions will be -evaluated in the order they have been specified in the build file.

-

The <and> condition has the same shortcut -semantics as the Java && operator, as soon as one of the -nested conditions is false, no other condition will be evaluated.

- -

or

-The <or> element doesn't have any attributes and -accepts an arbitrary number of conditions as nested elements - all -nested elements of the condition task are supported. This condition -is true if at least one of its contained conditions is, conditions -will be evaluated in the order they have been specified in the build -file.

The <or> condition has the same -shortcut semantics as the Java || operator, as soon as one of the -nested conditions is true, no other condition will be evaluated.

- -

xor

-

The <xor> element performs an exclusive -or on all nested elements, similar to the ^ operator -in Java. It only evaluates to true if an odd number of nested conditions -are true. There is no shortcutting of evaluation, unlike the <and> -and <or> tests. -It doesn't have any attributes and accepts all nested -elements of the condition task as nested elements as well.

- -

available

-

This condition is identical to the Available task, all attributes and nested -elements of that task are supported, the property and value attributes -are redundant and will be ignored.

- -

uptodate

-

This condition is identical to the Uptodate task, all attributes and nested -elements of that task are supported, the property and value attributes -are redundant and will be ignored.

- -

os

-

Test whether the current operating system is of a given type. Each -defined attribute is tested and the result is true only if all -the tests succeed. -

- - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
familyThe name of the operating system family to expect.No
nameThe name of the operating system to expect.No
archThe architecture of the operating system to expect.No
versionThe version of the operating system to expect.No
-

Supported values for the family attribute are: -

- -

equals

-

Tests whether the two given values are equal.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
arg1First value to test.Yes
arg2Second value to test.Yes
casesensitivePerform a case sensitive comparison. Default is - true.No
trimTrim whitespace from arguments before comparing - them. Default is false.No
forcestringForce string comparison of arg1/arg2. - Default is false. Since Apache Ant 1.8.1 - No
- -

isset

-

Test whether a given property has been set in this project.

- - - - - - - - - - - -
AttributeDescriptionRequired
propertyThe name of the property to test.Yes
- -

checksum

-

This condition is identical to the Checksum -task, all attributes and nested elements of that task are supported, -the property and overwrite attributes are redundant and will be -ignored.

- -

http

-

The http condition checks for a valid response from a -web server of the specified url. By default, HTTP responses errors -of 400 or greater are viewed as invalid.

- - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
urlThe full URL of the page to request. The web server must - return a status code below the value of errorsBeginAtYes.
errorsBeginAtThe lowest HTTP response code that signals an error; - by default '400'; server errors, not-authorized, not-found and the like - are detectedNo
requestMethodThe HTTP method to be used when issuing the request. - Any of GET, POST, HEAD, OPTIONS, PUT, DELETEm and TRACE - are valid, subject to protocol restrictions. The default if not - specified is "GET".
- since Ant 1.8.0
No
- -

socket

-

The socket condition checks for the existence of a -TCP/IP listener at the specified host and port.

- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
serverThe DNS name or IP address of the server.Yes.
portThe port number to connect to.Yes.
- -

filesmatch

-

Test two files for matching. Nonexistence of one file results in "false", -although if neither exists they are considered equal in terms of content. -This test does a byte for byte comparison, so test time scales with -byte size. NB: if the files are different sizes, one of them is missing -or the filenames match the answer is so obvious the detailed test is omitted. - -

- - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
file1First file to testYes
file2Second file to testYes
textfileWhether to ignore line endings when comparing - files; defaults to false which triggers a binary - comparison. Since Ant 1.7 - No
- -

contains

-

Tests whether a string contains another one.

- - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
stringThe string to search in.Yes
substringThe string to search for.Yes
casesensitivePerform a case sensitive comparison. Default is - true.No
- -

istrue

-

Tests whether a string equals any of the ant definitions of true, -that is "true","yes", or "on"

- - - - - - - - - - - -
AttributeDescriptionRequired
valuevalue to testYes
-
-<istrue value="${someproperty}"/>
-<istrue value="false"/>
-
- -

isfalse

-

Tests whether a string is not true, the negation of <istrue> -

- - - - - - - - - - - -
AttributeDescriptionRequired
valuevalue to testYes
-
-<isfalse value="${someproperty}"/>
-<isfalse value="false"/>
-
- -

isreference

- -

Test whether a given reference has been defined in this project and -- optionally - is of an expected type.

- -

This condition has been added in Apache Ant 1.6.

- - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
refidThe id of the reference to test.Yes
typeName of the data type or task this reference is - expected to be.No
- -

issigned

-

- Test whether a jarfile is signed. - If the name of the - signature is passed, the file is checked for presence of that - particular signature; otherwise the file is checked for the - existence of any signature. It does not perform rigorous - signature validation; it only looks for the presence of a signature. -

-

- This condition was added in Apache Ant 1.7. -

- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
file - The jarfile that is to be tested for the presence - of a signature. - Yes
name The signature name to check for.No
- -

isfileselected

-

- Test whether a file passes an embedded - selector. -

-

- This condition was added in Apache Ant 1.6.3. -

- - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
file - The file to check if is passes the embedded selector. - Yes
basedirThe base directory to use for name based selectors. It this is not set, - the project's basedirectory will be used.No
-

- Example usage: -

-
-<isfileselected file="a.xml">
-  <date datetime="06/28/2000 2:02 pm" when="equal"/>
-</isfileselected>
-
- -

typefound

- -

Test whether a given type is defined, and that -its implementation class can be loaded. Types include -tasks, datatypes, scriptdefs, macrodefs and presetdefs.

- -

This condition was added in Apache Ant 1.7.

- - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
namename of the typeYes
uri - The uri that this type lives in. - No
- -

- Example usages: -

-
-<typefound name="junit"/>
-<typefound uri="antlib:org.apache.maven.artifact.ant" name="artifact"/>
-
- -

scriptcondition

- -

Evaluate a condition based on a script in any -Apache BSF - or - JSR 223 -supported language. -

-

-See the Script task for -an explanation of scripts and dependencies. -

- -

This condition was added in Apache Ant 1.7.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
languagescript languageYes
manager - The script engine manager to use. - See the script task - for using this attribute. - No - default is "auto"
valuedefault boolean valueNo -default is "false"
srcfilename of script sourceNo
setbeanswhether to have all properties, references and targets as - global variables in the script. since Ant 1.8.0No, default is "true".
classpath - The classpath to pass into the script. - No
classpathrefThe classpath to use, given as a - reference to a path defined elsewhere. - No
-
Parameters specified as nested elements
-
classpath
-

- See the script task - for using this nested element. -

-
Description
-

-The script supports script language inline, this script has access to the -same beans as the <script> task, and to the self bean, -which refers back to the condition itself. If the script evaluates to a boolean result, -this is the result of the condition's evaluation (since Ant 1.7.1). -Alternatively, self.value can be used to set the evaluation result. -

-

-Example: -

-
-<scriptcondition language="javascript"
-        value="true">
-    self.setValue(false);
-</scriptcondition>
-
- -Sets the default value of the condition to true, then in the script, -sets the value to false. This condition always evaluates to "false" - -

parsersupports

- -

Tests whether Ant's XML parser supports a given -feature or property, as per the SAX/JAXP specifications, by -attempting to set the appropriate property/feature/

- -

This condition was added in Apache Ant 1.7.

- - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
propertyproperty to setone of property or feature
featurefeature to setone of property or feature
valuestring (property) or boolean (feature)For property tests, but not for feature tests
- -
-<parsersupports feature="http://xml.org/sax/features/namespaces"/>
-
-Check for namespace support. All SAX2 parsers should have this. -
-<or>
-  <parsersupports
-    feature="http://apache.org/xml/features/validation/schema"/>
-  <parsersupports
-    feature="http://java.sun.com/xml/jaxp/properties/schemaSource"/>
-</or>
-
- -Check for XML Schema support. - -
-<parsersupports
-  property="http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation"
-  value="document.xsd"/>
-
- -Check for Xerces-specific definition of the location of the no namespace schema. - -

isreachable

- -

Uses Java1.5+ networking APIs to probe for a (remote) system being -reachable. Exactly what probe mechanisms are used is an implementation -feature of the JVM. They may include ICMP "ping" packets, UDP or TCP connections -to port 7 "echo service" or other means. On Java1.4 and earlier, being able -to resolve the hostname is considered success. This means that if DNS is not -working or a URL/hostname is bad, the test will fail, but otherwise succeed -even if the remote host is actually absent. - -

-

-This condition turns unknown host exceptions into false conditions. This is -because on a laptop, DNS is one of the first services when the network goes; you -are implicitly offline. -

-

- If a URL is supplied instead of a host, the hostname is extracted - and used in the test - all other parts of the URL are discarded. -

-

-The test may not work through firewalls, that is, something may be reachable -using a protocol such as HTTP, while the lower level ICMP packets get dropped -on the floor. Similarly, a host may detected as reachable with ICMP, but -not reachable on other ports (i.e. port 80), because of firewalls. -

-

- -This condition was added in Apache Ant 1.7.

- - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
hosthost to check forone of url or host
urlURL containing hostnameone of url or host
timeouttimeout in secondsno, default is 30s
- -
-<condition property="offline">
-  <isreachable url="http://ibiblio.org/maven/" />
-</condition>
-
- -

-Probe for the maven repository being reachable. -

- -
-<condition property="offline">
-  <isreachable host="ibiblio.org" timeout="10" />
-</condition>
-
- -

-Probe for the maven repository being reachable using the hostname, ten second timeout.. -

- -

length

-

This condition is a facet of the Length task. - It is used to test the length of a string or one or more files. - Since Ant 1.6.3 -

- -
-<length string=" foo " trim="true" length="3" />
-
-

Verify a string is of a certain length.

- -
-<length file="foo" when="greater" length="0" />
-
-

Verify that file foo is not empty.

- -

isfailure

- -

Test the return code of an executable (see the -Exec task) for failure. Since Ant 1.7

- - - - - - - - - - - - -
AttributeDescriptionRequired
codeThe return code to test.Yes
- -

resourcecount

-

This condition is a facet of the - ResourceCount task. - It is used to test the size of a - resource collection. - Since Ant 1.7 -

- -
-<resourcecount refid="myresourcecollection" when="greater" count="0" />
-
-

Verify that a resource collection is not empty.

- -

resourcesmatch

-

Test resources for matching. Nonexistence of one or more resources results in -"false", although if none exists they are considered equal in terms of content. -By default this test does a byte for byte comparison, so test time scales with -byte size. NB: if the files are different sizes, one of them is missing -or the filenames match the answer is so obvious the detailed test is omitted. -The resources to check are specified as nested -resource collections, -meaning that more than two resources can be checked; in this case all resources -must match. Since Ant 1.7 -

- - - - - - - - - - - -
AttributeDescriptionRequired
astextWhether to ignore line endings - when comparing resource content; defaults to false, - while true triggers a binary comparison. - No
- -

resourcecontains

-

Tests whether a resource contains a given (sub)string.

-

The resources to check are specified via references or - in the - case of file resources via the resource attribute. Since Ant 1.7.1 -

- - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
resourceName of a file that is the resource to test. - One of the two
refidReference to a resource defined inside the project.
substringThe string to search for.Yes
casesensitivePerform a case sensitive comparison. Default is - true.No
- -

hasmethod

- -

Tests for a class having a method or field. If the class is not found - or fails to load, the build fails. - - Since Ant 1.7 -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
classnamename of the class to loadyes
fieldname of a field to look forone of field or method
methodname of a method to look forone of field or method
ignoreSystemClassesshould system classes be ignored?No -default is false
classpatha class pathNo
classpathrefreference to a class pathNo
- -

- There is also a nested <classpath> element, which can be used to specify - a classpath. -

-
-<hasmethod classname="java.util.ArrayList" method="trimToSize"  />
-
- -

Looks for the method trimToSize in the ArrayList class.

- -

matches

- -

- Test if the specified string matches the specified regular - expression pattern. - Since Ant 1.7

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
stringThe string to test.Yes
patternThe regular expression pattern used to test.Yes, unless there is a nested - <regexp> element.
casesensitivePerform a case sensitive match. Default is - true.No
multiline - Perform a multi line match. - Default is false.No
singleline - This allows '.' to match new lines. - SingleLine is not to be confused with multiline, SingleLine is a perl - regex term, it corresponds to dotall in java regex. - Default is false.No
- -

- There is also an optional <regexp> element, which can be used to specify - a regular expression instead of the "pattern" attribute. - See Regexp Type for the description - of the nested element regexp and of - the choice of regular expression implementation. -

-

- An example: -

-
-<condition property="legal-password">
-  <matches pattern="[1-9]" string="${user-input}"/>
-</condition>
-<fail message="Your password should at least contain one number"
-      unless="legal-password"/>
-
-

- The following example sets the property "ok" if - the property "input" is three characters long, starting - with 'a' and ending with 'b'. -

-
-<condition property="ok">
-  <matches string="${input}" pattern="^a.b$"/>
-</condition>
-
-

- The following defines a reference regular expression for - matching dates and then uses antunit to check if the - property "today" is in the correct format: -

-
-<regexp id="date.pattern" pattern="^[0123]\d-[01]\d-[12]\d\d\d$"/>
-
-<au:assertTrue xmlns:au="antlib:org.apache.ant.antunit">
-  <matches string="${today}">
-    <regexp refid="date.pattern"/>
-  </matches>
-</au:assertTrue>
-
-

- The following example shows the use of the singleline and the casesensitive - flags. -

-
-<au:assertTrue>
-  <matches string="AB${line.separator}C" pattern="^ab.*C$"
-           casesensitive="false"
-           singleline="true"/>
-</au:assertTrue>
-<au:assertFalse>
-  <matches string="AB${line.separator}C" pattern="^ab.*C$"
-           casesensitive="false"
-           singleline="false"/>
-</au:assertFalse>
-
- -

antversion

-

This condition is identical to the Antversion task, all attributes are supported, the property attribute -is redundant and will be ignored.

- - -

hasfreespace

- -

- Tests a partition to see if there is enough space. - Since Ant 1.7.0

-

Needed attribute can be specified using standard computing terms:
-

-

- - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
partitionThe partition or filesystem to check for freespaceYes
neededThe amount of freespace needed.Yes
-

- An example: -

-
-<hasfreespace partition="c:" needed="100M"/>
-
- -

islastmodified

- -

Tests the last modified date of a resource. Since Ant -1.8.0

- - - - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
millisSpecifies the expected modification time of the resource - in milliseconds since midnight Jan 1 1970.Exactly one of the - two.
datetimeSpecifies the expected modification time of the - resource. The special value "now" indicates the - current time.
patternSimpleDateFormat-compatible pattern string. - Defaults to MM/DD/YYYY HH:MM AM_or_PM or MM/DD/YYYY HH:MM:SS AM_or_PM. - No
modeHow to compare the timestamp. Accepted values - are "equals", "before", "not-before", "after" and "not-after". - No, defaults to "equals".
- -

The actual resource to test is specified as a nested element.

- -

- An example: -

-
-<islastmodified dateTime="08/18/2009 04:41:19 AM" mode="not-before">
-  <file file="${file}"/>
-</islastmodified>
-
- -

resourceexists

- -

Tests a resource for existence. since Ant 1.8.0

- -

The actual resource to test is specified as a nested element.

- -

- An example: -

-
-<resourceexists>
-  <file file="${file}"/>
-</resourceexists>
-
- - -- cgit 1.2.3-korg