From notifications-return-30183-archive-asf-public=cust-asf.ponee.io@ant.apache.org Wed Feb 28 08:01:25 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id B62471807A6 for ; Wed, 28 Feb 2018 08:01:23 +0100 (CET) Received: (qmail 68853 invoked by uid 500); 28 Feb 2018 07:01:22 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 66911 invoked by uid 99); 28 Feb 2018 07:01:18 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Feb 2018 07:01:18 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7A10FF4E44; Wed, 28 Feb 2018 07:01:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: gintas@apache.org To: notifications@ant.apache.org Date: Wed, 28 Feb 2018 07:01:41 -0000 Message-Id: <26a35c8d3ebf483ab1cda2b1e8334338@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [26/47] ant git commit: Use HTML 5(-ish), fix links http://git-wip-us.apache.org/repos/asf/ant/blob/66b52f99/manual/Tasks/schemavalidate.html ---------------------------------------------------------------------- diff --git a/manual/Tasks/schemavalidate.html b/manual/Tasks/schemavalidate.html index 6a6f1e9..4188519 100644 --- a/manual/Tasks/schemavalidate.html +++ b/manual/Tasks/schemavalidate.html @@ -26,252 +26,220 @@

SchemaValidate

Description

-

This schemavalidate task validates XML files described by an XML Schema. -The task extends the XmlValidate task with XSD-specific features.

+

This schemavalidate task validates XML files described by an XML Schema. The task +extends the XmlValidate task with XSD-specific features.

    -
  1. The parser is created validating and namespace aware -
  2. -
  3. Validation is turned on.
  4. -
  5. Schema validation is turned on.
  6. -
  7. Any no-namespace schema URL or file supplied is used as the no-namespace schema -
  8. All nested schema declarations are turned into the list of namespace-url -bindings for schema lookup. +
  9. The parser is created validating and namespace aware.
  10. +
  11. Validation is turned on.
  12. +
  13. Schema validation is turned on.
  14. +
  15. Any no-namespace schema URL or file supplied is used as the no-namespace schema.
  16. +
  17. All nested schema declarations are turned into the list of namespace-url bindings for schema + lookup.
-Note that nested catalogs are still used for lookup of the URLs given as the -sources of schema documents, so you can still delegate lookup to a catalog, you -just need to list all schema URIs and their URL equivalents. +

Note that nested catalogs are still used for lookup of the URLs given as the sources of schema +documents, so you can still delegate lookup to a catalog, you just need to list all schema URIs and +their URL equivalents.

This task supports the use of nested

    -
  • <xmlcatalog> elements
  • -
  • <schema> elements, that bind a namespace URI to a URL or a - local filename. -
  • <dtd> elements which are used to resolve DTDs and entities.
  • -
  • <attribute> elements which are used to set features on the parser. - These can be any number of - http://xml.org/sax/features/ - or other features that your parser may support.
  • -
  • <property> elements, containing string properties
  • +
  • <xmlcatalog> elements
  • +
  • <schema> elements, that bind a namespace URI to a URL or a local + filename.
  • +
  • <dtd> elements which are used to resolve DTDs and entities.
  • +
  • <attribute> elements which are used to set features on the parser. These + can be any number + of http://xml.org/sax/features/ + or other features that your parser may support.
  • +
  • <property> elements, containing string properties
-

-The task only supports SAX2 or later parsers: it is an error to specify a SAX1 -parser. -

+

The task only supports SAX2 or later parsers: it is an error to specify a esSAX1 parser.

Parameters

- +
- - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - + + + - - - + + + - - - + + + - - - + + +
AttributeDescriptionRequiredAttributeDescriptionRequired
classnamethe parser to use.Noclassnamethe parser to use.No
classpathrefwhere to find the parser class. - Optionally can use an embedded <classpath> element.Noclasspathrefwhere to find the parser class. Optionally can use an + embedded <classpath> element.No
disableDTD - Flag to disable DTD support. DTD support is needed to - validate XSD files themselves, amongst others. - No - default falsedisableDTDFlag to disable DTD support. DTD support is needed to validate XSD files themselves, amongst + others.No; default false
failonerrorfails on a error if set to true (defaults to true).Nofailonerrorfails on a error if set to true (defaults to true).No
filethe file(s) you want to check. (optionally can use an embedded fileset)Nofilethe file(s) you want to check (optionally use an embedded fileset).No
fullchecking - enable full schema checking. Slow but strict. - No - default truefullcheckingenable full schema checking. Slow but strict.No; default true
lenient - if true, only check the XML document is well formed - Nolenientif true, only check the XML document is well formedNo
noNamespaceFile - filename of a no-namespace XSD file to provide the - schema for no-namespace XML content. - NonoNamespaceFilefilename of a no-namespace XSD file to provide the schema for no-namespace XML contentNo
noNamespaceURL - URL of a no-namespace XSD file to provide the - schema for no-namespace XML content. - NonoNamespaceURLURL of a no-namespace XSD file to provide the schema for no-namespace XML contentNo
warnlog parser warn events.Nowarnlog parser warn eventsNo

Nested Elements

schema

-

-Identify the name and location of a schema that may be used in validating -the document(s). -

- +

Identify the name and location of a schema that may be used in validating the document(s).

+
- - - + + + - - - + + + - - - + + + - - + +
AttributeDescriptionRequiredAttributeDescriptionRequired
namespaceURI of the schema namespaceYesnamespaceURI of the schema namespaceYes
urlURL of the schemaExactly one of the twourlURL of the schemaExactly one of the two
filefile of the schemafilefile of the schema

dtd

-

-<dtd> is used to specify different locations for DTD resolution. -

- +

<dtd> is used to specify different locations for DTD resolution.

+
- - - + + + - - - + + + - - + - +
AttributeDescriptionRequiredAttributeDescriptionRequired
publicIdPublic ID of the DTD to resolveYespublicIdPublic ID of the DTD to resolveYes
locationLocation of the DTD to use, which can be a file, + locationLocation of the DTD to use, which can be a file, a resource, or a URLYesYes

xmlcatalog

-

The <xmlcatalog> -element is used to perform entity resolution.

+

The <xmlcatalog> element is used to +perform entity resolution.

attribute

-

The <attribute> element is used to set parser features.
-Features usable with the xerces parser are defined here : - Setting features
- -SAX features are defined here: - http://xml.org/sax/features/
-

- - - - - +

The <attribute> element is used to set parser features.
Features usable +with the xerces parser are defined +here: Setting features
SAX features +are defined +here: http://xml.org/sax/features/

+
AttributeDescriptionRequired
+ + + + - - - + + + - - - + + +
AttributeDescriptionRequired
nameThe name of the featureYesnameThe name of the featureYes
valueThe boolean value of the featureYesvalueThe boolean value of the featureYes

property

-

The <property> element is used to set properties. -These properties are defined here for the xerces XML parser implementation : - XML Parser properties +

The <property> element is used to set properties. These properties are +defined here for the Xerces XML parser +implementation: XML Parser properties Properties can be used to set the schema used to validate the XML file.

- +
- - - + + + - - - + + + - - - + + +
AttributeDescriptionRequiredAttributeDescriptionRequired
nameThe name of the featureYesnameThe name of the featureYes
valueThe string value of the propertyYesvalueThe string value of the propertyYes

Examples

-    <schemavalidate
-      noNamespaceFile="document.xsd"
-      file="xml/endpiece.xml">
-    </schemavalidate>
-
-Validate a document against an XML schema. The document does not declare -any schema itself, which is why the noNamespaceFile is needed. -
-    <presetdef name="validate-soap">
-      <schemavalidate>
-        <schema namespace="http://schemas.xmlsoap.org/ws/2003/03/addressing"
-          file="${soap.dir}/ws-addressing.xsd" />
-        <schema namespace="http://www.w3.org/2003/05/soap-envelope"
-          file="${soap.dir}/soap12.xsd" />
-        <schema namespace="http://schemas.xmlsoap.org/wsdl/"
-          file="${soap.dir}/wsdl.xsd" />
-        <schema namespace="http://www.w3.org/2001/XMLSchema"
-          file="${soap.dir}/XMLSchema.xsd" />
-        </schemavalidate>
-    </presetdef>
-
-Declare a new preset task, <validate-soap>, that validates -XSD and WSDL documents against the relevant specifications. -To validate XSD documents, you also need XMLSchema.dtd and datatypes.dtd in -the same directory as XMLSchema.xsd, or pointed to via the catalog. All -these files can be fetched from -the W3C. +<schemavalidate noNamespaceFile="document.xsd" + file="xml/endpiece.xml"/> +

Validate a document against an XML schema. The document does not declare any schema itself, which +is why the noNamespaceFile is needed.

-    <validate-soap file="xml/test.xsd"/>
-
-Use the preset task defined above to validate an XML Schema document. -
+<presetdef name="validate-soap"> + <schemavalidate> + <schema namespace="http://schemas.xmlsoap.org/ws/2003/03/addressing" + file="${soap.dir}/ws-addressing.xsd"/> + <schema namespace="http://www.w3.org/2003/05/soap-envelope" + file="${soap.dir}/soap12.xsd"/> + <schema namespace="http://schemas.xmlsoap.org/wsdl/" + file="${soap.dir}/wsdl.xsd"/> + <schema namespace="http://www.w3.org/2001/XMLSchema" + file="${soap.dir}/XMLSchema.xsd"/> + </schemavalidate> +</presetdef> +

Declare a new preset task, <validate-soap>, that validates XSD and WSDL +documents against the relevant specifications. To validate XSD documents, you also +need XMLSchema.dtd and datatypes.dtd in the same directory +as XMLSchema.xsd, or pointed to via the catalog. All these files can be fetched +from W3C.

+
<validate-soap file="xml/test.xsd"/>
+

Use the preset task defined above to validate an XML Schema document.

http://git-wip-us.apache.org/repos/asf/ant/blob/66b52f99/manual/Tasks/scp.html ---------------------------------------------------------------------- diff --git a/manual/Tasks/scp.html b/manual/Tasks/scp.html index bcd9964..ced38dd 100644 --- a/manual/Tasks/scp.html +++ b/manual/Tasks/scp.html @@ -30,292 +30,246 @@

since Apache Ant 1.6

Copies a file or FileSet to or from a (remote) machine running an SSH daemon. -FileSet only works for copying files from the local machine to a -remote machine.

+FileSet only works for copying files from the local machine to a remote machine.

-

Note: This task depends on external libraries not included -in the Ant distribution. See Library Dependencies -for more information. This task has been tested with jsch-0.1.2 and later.

+

Note: This task depends on external libraries not included in the Ant +distribution. See Library Dependencies for more +information. This task has been tested with jsch-0.1.2 and later.

See also the sshexec task

Parameters

- +
- - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + +
AttributeDescriptionRequiredAttributeDescriptionRequired
fileThe file to copy. This can be a local path or a - remote path of the form user[:password]@host:/directory/path. - :password can be omitted if you use key based - authentication or specify the password attribute. The way remote - path is recognized is whether it contains @ character or not. This - will not work if your localPath contains @ character.Yes, unless a nested - <fileset> element is used.fileThe file to copy. This can be a local path or a remote path of the + form user[:password]@host:/directory/path. :password can be omitted + if you use key based authentication or specify the password attribute. The way + remote path is recognized is whether it contains @ character or not. This will not work + if your localPath contains @ character.Yes, unless a nested <fileset> element is used
localFileThis is an alternative to the file attribute. But - this must always point to a local file. The reason this was added - was that when you give file attribute it is treated as remote if - it contains @ character. This character can exist also in local - paths. since Ant 1.6.2Alternative to file attribute.localFileThis is an alternative to the file attribute. But this must always point to a + local file. The reason this was added was that when you give file attribute it is treated as + remote if it contains @ character. This character can exist also in local + paths. since Ant 1.6.2Alternative to file attribute
remoteFileThis is an alternative to the file attribute. But - this must always point to a remote file. since Ant 1.6.2Alternative to file attribute.remoteFileThis is an alternative to the file attribute. But this must always point to a + remote file. since Ant 1.6.2Alternative to file attribute
todirThe directory to copy to. This can be a local path - or a remote path of the form user[:password]@host:/directory/path. - :password can be omitted if you use key based - authentication or specify the password attribute. The way remote - path is recognized is whether it contains @ character or not. This - will not work if your localPath contains @ character.YestodirThe directory to copy to. This can be a local path or a remote path of the + form user[:password]@host:/directory/path. :password can be omitted + if you use key based authentication or specify the password attribute. The way + remote path is recognized is whether it contains @ character or not. This will not work + if your localPath contains @ character.Yes
localTodirThis is an alternative to the todir - attribute. But this must always point to a local directory. The - reason this was added was that when you give todir attribute it is - treated as remote if it contains @ character. This character can - exist also in local paths. since Ant 1.6.2Alternative to todir attribute.localTodirThis is an alternative to the todir attribute. But this must always point to a + local directory. The reason this was added was that when you give todir attribute it + is treated as remote if it contains @ character. This character can exist also in local + paths. since Ant 1.6.2Alternative to todir attribute
localTofileChanges the file name to the given name while - receiving it, only useful if receiving a single file. since - Ant 1.6.2Alternative to todir attribute.localTofileChanges the file name to the given name while receiving it, only useful if receiving a + single file. since Ant 1.6.2Alternative to todir attribute
remoteTodirThis is an alternative to the todir - attribute. But this must always point to a remote directory. - since Ant 1.6.2Alternative to todir attribute.remoteTodirThis is an alternative to the todir attribute. But this must always point to a + remote directory. since Ant 1.6.2Alternative to todir attribute
remoteTofileChanges the file name to the given name while - sending it, only useful if sending a single file. since - Ant 1.6.2Alternative to todir attribute.remoteTofileChanges the file name to the given name while sending it, only useful if sending a single + file. since Ant 1.6.2Alternative to todir attribute
portThe port to connect to on the remote host.No, defaults to 22.portThe port to connect to on the remote host.No; defaults to 22
trustThis trusts all unknown hosts if set to yes/true.
- Note: If you set this to false (the default), the - host you connect to must be listed in your knownhosts file, this - also implies that the file exists.
No, defaults to No.trustThis trusts all unknown hosts if set to yes + or true.
Note: If you set this to false (the default), the + host you connect to must be listed in your knownhosts file, this also implies that + the file exists.
No; defaults to no
knownhostsThis sets the known hosts file to use to validate - the identity of the remote host. This must be a SSH2 format file. - SSH1 format is not supported.No, defaults to - ${user.home}/.ssh/known_hosts.knownhostsThis sets the known hosts file to use to validate the identity of the remote host. This + must be a SSH2 format file. SSH1 format is not supported.No; defaults to ${user.home}/.ssh/known_hosts
failonerrorWhether to halt the build if the transfer fails. - No; defaults to true.failonerrorWhether to halt the build if the transfer fails.No; defaults to true
passwordThe password.Not if you are using key based - authentication or the password has been given in the file or - todir attribute.passwordThe password.Yes, unless you are using key based authentication or the password has been given in the + file or todir attribute
keyfileLocation of the file holding the private key.Yes, if you are using key based - authentication.keyfileLocation of the file holding the private key.Yes, if you are using key based authentication
passphrasePassphrase for your private key.No, defaults to an empty string.passphrasePassphrase for your private key.No; defaults to an empty string
verboseDetermines whether SCP outputs verbosely to the - user. Currently this means outputting dots/stars showing the - progress of a file transfer. since Ant 1.6.2No; defaults to false.verboseDetermines whether SCP outputs verbosely to the user. Currently this means outputting + dots/stars showing the progress of a file transfer. since Ant 1.6.2No; defaults to false
sftpDetermines whether SCP uses the sftp protocol. - The sftp protocol is the file transfer protocol of SSH2. It is - recommended that this be set to true if you are copying to/from a - server that doesn't support scp1. since Ant 1.7No; defaults to false.sftpDetermines whether SCP uses the sftp protocol. The sftp protocol is the file transfer + protocol of SSH2. It is recommended that this be set to true if you are copying to/from + a server that doesn't support scp1. since Ant 1.7No; defaults to false
preserveLastModifiedDetermines whether the last modification - timestamp of downloaded files is preserved. It only works when - transferring from a remote to a local system and probably doesn't - work with a server that doesn't support SSH2. since Ant - 1.8.0No; defaults to false.preserveLastModifiedDetermines whether the last modification timestamp of downloaded files is preserved. It + only works when transferring from a remote to a local system and probably doesn't work with a + server that doesn't support SSH2. since Ant 1.8.0No; defaults to false
filemodeA 3 digit octal string, specify the user, group - and other modes in the standard Unix fashion. Only applies to - uploaded files. Note the actual permissions of the remote - file will be governed by this setting and the UMASK on the - remote server. Default is 644. since Ant 1.9.5.NofilemodeA 3 digit octal string, specify the user, group and other modes in the standard Unix + fashion. Only applies to uploaded files. Note the actual permissions of the remote file will + be governed by this setting and the UMASK on the remote server. since Ant + 1.9.5.No; default is 644
dirmodeA 3 digit octal string, specify the user, group - and other modes in the standard Unix fashion. Only applies to - uploaded dirs. Note the actual permissions of the remote - dir will be governed by this setting and the UMASK on the - remote server. Default is 755. since Ant 1.9.5.NodirmodeA 3 digit octal string, specify the user, group and other modes in the standard Unix + fashion. Only applies to uploaded dirs. Note the actual permissions of the remote dir will + be governed by this setting and the UMASK on the remote server. since Ant + 1.9.5.No; default is 755
serverAliveIntervalSecondsSets a timeout interval in seconds after which if no data has - been received from the server, the task will send a message through - the encrypted channel to request a response from the server. - since Ant 1.9.7No, the default is 0, indicating - that these messages will not be sent to the serverserverAliveIntervalSecondsSets a timeout interval in seconds after which if no data has been received from the server, + the task will send a message through the encrypted channel to request a response from the + server. since Ant 1.9.7No, the default is 0, indicating that these messages will not be sent to the + server
serverAliveCountMaxThe number of server alive messages which may be - sent without receiving any messages back from the server. Only - used if serverAliveIntervalSeconds is not 0. - since Ant 1.9.7No, defaults to 3serverAliveCountMaxThe number of server alive messages which may be sent without receiving any messages back + from the server. Only used if serverAliveIntervalSeconds is + not 0. since Ant 1.9.7No; defaults to 3
compressedWhether to enable compression during transfer. - since Ant 1.9.8No, defaults to falsecompressedWhether to enable compression during transfer. since Ant 1.9.8No; defaults to false

Parameters specified as nested elements

fileset or resource collections

-

FileSets or Resource Collections are used to select - groups of files to copy. To use a fileset or a resource collection, the todir attribute must be set.

+

FileSets +or Resource Collections are used to select groups +of files to copy. To use a fileset or a resource collection, the todir attribute must be +set.

-Prior to Ant 1.9.7 only <fileset> has been supported as a nested element. +

Prior to Ant 1.9.7 only <fileset> has been supported as a nested element.

Examples

-

Copy a single local file to a remote machine

-
-  <scp file="myfile.txt" todir="user:password@somehost:/home/chuck"/>
-
+

Copy a single local file to a remote machine

+
<scp file="myfile.txt" todir="user:password@somehost:/home/chuck"/>
-

Copy a single local file to a remote machine with separate -password attribute

-
-  <scp file="myfile.txt" todir="user@somehost:/home/chuck" password="password"/>
-
+

Copy a single local file to a remote machine with separate password +attribute

+
<scp file="myfile.txt" todir="user@somehost:/home/chuck" password="password"/>
-

Copy a single local file to a remote machine using key base -authentication.

+

Copy a single local file to a remote machine using key base authentication.

-  <scp file="myfile.txt"
-       todir="user@somehost:/home/chuck"
-       keyfile="${user.home}/.ssh/id_dsa"
-       passphrase="my extremely secret passphrase"/>
-
+<scp file="myfile.txt" + todir="user@somehost:/home/chuck" + keyfile="${user.home}/.ssh/id_dsa" + passphrase="my extremely secret passphrase"/> -

Copy a single remote file to a local directory

-
-  <scp file="user:password@somehost:/home/chuck/myfile.txt" todir="../some/other/dir"/>
-
+

Copy a single remote file to a local directory

+
<scp file="user:password@somehost:/home/chuck/myfile.txt" todir="../some/other/dir"/>
-

Copy a remote directory to a local directory

-
-  <scp file="user:password@somehost:/home/chuck/*" todir="/home/sara"/>
-
+

Copy a remote directory to a local directory

+
<scp file="user:password@somehost:/home/chuck/*" todir="/home/sara"/>
-

Copy a local directory to a remote directory

+

Copy a local directory to a remote directory

+
+<scp todir="user:password@somehost:/home/chuck/">
+  <fileset dir="src_dir"/>
+</scp>
+

Copy a set of files to a directory

-  <scp todir="user:password@somehost:/home/chuck/">
-    <fileset dir="src_dir"/>
-  </scp>
-
-

Copy a set of files to a directory

+<scp todir="user:password@somehost:/home/chuck"> + <fileset dir="src_dir"> + <include name="**/*.java"/> + </fileset> +</scp> +

Copy a set of files to a remote directory in reverse last-modified order

-  <scp todir="user:password@somehost:/home/chuck">
+<scp todir="user:password@somehost:/home/chuck">
+  <sort>
+    <reverse>
+      <date/>
+    </reverse>
     <fileset dir="src_dir">
-      <include name="**/*.java"/>
+      <include name="**/*"/>
     </fileset>
-  </scp>
-
-

Copy a set of files to a remote directory in reverse last-modified order

-
-  <scp todir="user:password@somehost:/home/chuck">
-    <sort>
-      <reverse>
-        <date />
-      </reverse>
-      <fileset dir="src_dir">
-        <include name="**/*" />
-      </fileset>
-    </sort>
-  </scp>
-
+ </sort> +</scp> -

Security Note: Hardcoding passwords and/or usernames -in scp task can be a serious security hole. Consider using variable -substitution and include the password on the command line. For example: -

-

-    <scp todir="${username}:${password}@host:/dir" ...>
-
-Invoking Ant with the following command line: -
-    ant -Dusername=me -Dpassword=mypassword target1 target2
-
-

-Is slightly better, but the username/password is exposed to all users on an Unix -system (via the ps command). The best approach is to use the -<input> task and/or retrieve the password from a (secured) -.properties file. -

+

Security Note: Hardcoding passwords and/or usernames in scp task +can be a serious security hole. Consider using variable substitution and include the password on +the command line. For example:

+
<scp todir="${username}:${password}@host:/dir" ...>
+

Invoking Ant with the following command line:

+
ant -Dusername=me -Dpassword=mypassword target1 target2
+

Is slightly better, but the username/password is exposed to all users on an Unix system (via +the ps command). The best approach is to use the <input> task and/or +retrieve the password from a (secured) .properties file.

-

Unix Note: File permissions are not retained when files -are downloaded; they end up with the default UMASK permissions -instead. This is caused by the lack of any means to query or set file -permissions in the current Java runtimes. If you need a permission- -preserving copy function, use <exec executable="scp" ... > -instead. -

+

Unix Note: File permissions are not retained when files are downloaded; they end +up with the default UMASK permissions instead. This is caused by the lack of any means +to query or set file permissions in the current Java runtimes. If you need a permission-preserving +copy function, use <exec executable="scp" ... > instead.

http://git-wip-us.apache.org/repos/asf/ant/blob/66b52f99/manual/Tasks/script.html ---------------------------------------------------------------------- diff --git a/manual/Tasks/script.html b/manual/Tasks/script.html index 375c1f9..1566caf 100644 --- a/manual/Tasks/script.html +++ b/manual/Tasks/script.html @@ -26,143 +26,116 @@

Script

Description

-

Execute a script in a - Apache BSF - or - JSR 223 supported language. -

-

Note: - This task depends on external libraries not included in the Apache Ant distribution. - See Library Dependencies - for more information. -

-

- The task may use the BSF scripting manager or the JSR 223 manager that - is included in JDK 6 and higher. This is controlled by the manager - attribute. The JSR 223 scripting manager is indicated by "javax". -

-

All items (tasks, targets, etc) of the running project are - accessible from the script, using either their name or - id attributes (as long as their names are considered - valid Java identifiers, that is). - This is controlled by the "setbeans" attribute of the task. - The name "project" is a pre-defined reference to the Project, which can be - used instead of the project name. The name "self" is a pre-defined reference to the actual - <script>-Task instance.
From these objects you have access to the Ant Java API, see the -JavaDoc (especially for -Project and -Script) for more information.

-

If you are using JavaScript under BSF, a good resource is -http://www.mozilla.org/rhino/doc.html as we are using their JavaScript interpreter.

+

Execute a script in a Apache BSF +or JSR +223 supported language. +

+

Note: This task depends on external libraries not included in the Apache Ant +distribution. See Library Dependencies for more +information.

+

The task may use the BSF scripting manager or the JSR 223 manager that is included in JDK 6 and +higher. This is controlled by the manager attribute. The JSR 223 scripting manager is +indicated by javax.

+

All items (tasks, targets, etc) of the running project are accessible from the script, using +either their name or id attributes (as long as their names are considered +valid Java identifiers, that is). This is controlled by the setbeans attribute of the +task. The name project is a pre-defined reference to the Project, which can be used +instead of the project name. The name self is a pre-defined reference to the +actual <script>-Task instance.
From these objects you have access to the Ant +Java API, see the JavaDoc (especially +for Project +and Script) for more +information.

+

If you are using JavaScript under BSF, a good resource is https://www.mozilla.org/rhino/doc.html as we are +using their JavaScript interpreter.

Scripts can do almost anything a task written in Java could do.

-

Rhino provides a special construct - the JavaAdapter. With that you can -create an object which implements several interfaces, extends classes and for which you -can overwrite methods. Because this is an undocumented feature (yet), here is the link -to an explanation: -Groups@Google: "Rhino, enum.js, JavaAdapter?" by Norris Boyd in the newsgroup -netscape.public.mozilla.jseng.

+

Rhino provides a special construct—the JavaAdapter. With that you can create +an object which implements several interfaces, extends classes and for which you can overwrite +methods. Because this is an undocumented feature (yet), here is the link to an +explanation: Google +Groups: "Rhino, enum.js, JavaAdapter?" by Norris Boyd in the +newsgroup netscape.public.mozilla.jseng.

-

If you are creating Targets programmatically, make sure you set the -Location to a useful value. In particular all targets should have -different location values.

+

If you are creating Targets programmatically, make sure you set the Location to a useful value. +In particular all targets should have different location values.

Parameters

- +
- - - + + + - - - + + + - - + - + - - - + + + - - - + + + - - - + + + - - - + + + - - + - +
AttributeDescriptionRequiredAttributeDescriptionRequired
languageThe programming language the script is written in. - Must be a supported Apache BSF or JSR 223 languageYeslanguageThe programming language the script is written in. Must be a supported Apache BSF or JSR + 223 languageYes
manager - Since Ant 1.7. - The script engine manager to use. This can have - one of three values ("auto", "bsf" or "javax"). - The default value is "auto". + manager + Since Ant 1.7. The script engine manager to use. This can have one of three + values: auto, bsf or javax.
    -
  • "bsf" use the BSF scripting manager to run - the language.
  • -
  • "javax" use the javax.scripting manager - to run the language. (This will only work for JDK 6 and higher).
  • -
  • "auto" use the BSF engine if it exists, - otherwise use the javax.scripting manager.
  • +
  • bsf use the BSF scripting manager to run the language.
  • +
  • javax use the javax.scripting manager to run the language. (This + will only work for JDK 6 and higher).
  • +
  • auto use the BSF engine if it exists, otherwise use + the javax.scripting manager.
NoNo; default is auto
srcThe location of the script as a file, if not inlineNosrcThe location of the script as a file, if not inlineNo
encodingThe encoding of the script as a file. Since Ant 1.10.2.No - defaults to default JVM encodingencodingThe encoding of the script as a file. Since Ant 1.10.2.No; defaults to default JVM character encoding
setbeans - This attribute controls whether to set variables for - all properties, references and targets in the running script. - If this attribute is false, only the the "project" and "self" variables are set. - If this attribute is true all the variables are set. The default value of this - attribute is "true". Since Ant 1.7 - NosetbeansThis attribute controls whether to set variables for all properties, references and targets + in the running script. If this attribute is false, only the the project + and self variables are set. If this attribute is true all the variables + are set. Since Ant 1.7No; defaults to true
classpath - The classpath to pass into the script. Since Ant 1.7 - NoclasspathThe classpath to pass into the script. Since Ant 1.7No
classpathrefThe classpath to use, given as a - reference to a path defined elsewhere. + classpathrefThe classpath to use, given as a reference to a path + defined elsewhere. Since Ant 1.7NoNo

Parameters specified as nested elements

classpath

-

Since Ant 1.7

-

- Script's classpath attribute is a - path-like structure and can also be set via a nested - <classpath> element. +

Since Ant 1.7

+

Script's classpath attribute is a path-like +structure and can also be set via a nestedq <classpath> element.

-

- If a classpath is set, it will be used as the current thread - context classloader, and - as the classloader given to the BSF manager. - This means that it can be used to specify - the classpath containing the language implementation for BSF - or for JSR 223 managers. - This can be useful if one wants - to keep ${user.home}/.ant/lib free of lots of scripting language - specific jar files. -

-

- Note: (since Ant 1.7.1) - This classpath can be used to - specify the location of - the BSF jar file and/or languages - that have engines in the BSF jar file. This includes the - javascript, jython, netrexx and jacl languages. -

+

If a classpath is set, it will be used as the current thread context classloader, and as the +classloader given to the BSF manager. This means that it can be used to specify the classpath +containing the language implementation for BSF or for JSR 223 managers. This can be useful if one +wants to keep ${user.home}/.ant/lib free of lots of scripting language specific jar +files.

+

Note: (since Ant 1.7.1) This classpath can be used to specify +the location of the BSF jar file and/or languages that have engines in the BSF jar file. This +includes the javascript, jython, netrexx and jacl languages.

Examples

-The following snippet shows use of five different languages: -
+

The following snippet shows use of five different languages:

+
     <property name="message" value="Hello world"/>
 
     <script language="groovy">
@@ -183,68 +156,48 @@ The following snippet shows use of five different languages:
 
     <script language="jython">
 print "message is %s" % message
-    </script>
-
-

- Note that for the jython example, the script contents must - start on the first column. -

-

- Note also that for the ruby example, the names of the set variables are prefixed - by a '$'. -

- The following script shows a little more complicated jruby example: -

-
+    </script>
+

Note that for the jython example, the script contents must start on the +first column.

+

Note also that for the ruby example, the names of the set variables are prefixed by +a $.

+

The following script shows a little more complicated JRuby example:

+
 <script language="ruby">
   xmlfiles = Dir.new(".").entries.delete_if { |i| ! (i =~ /\.xml$/) }
   xmlfiles.sort.each { |i| $self.log(i) }
-</script>
-
-

- The same example in groovy is: -

-
+</script>
+

The same example in Groovy is:

+
 <script language="groovy">
   xmlfiles = new java.io.File(".").listFiles().findAll{ it =~ "\.xml$"}
-  xmlfiles.sort().each { self.log(it.toString())}
-</script>
-
-

- The following example shows the use of classpath to specify the location - of the beanshell jar file. -

-
+  xmlfiles.sort().each { self.log(it.toString()) }
+</script>
+

The following example shows the use of classpath to specify the location of the beanshell jar +file.

+
 <script language="beanshell" setbeans="true">
   <classpath>
-    <fileset dir="${user.home}/lang/beanshell" includes="*.jar" />
+    <fileset dir="${user.home}/lang/beanshell" includes="*.jar"/>
   </classpath>
   System.out.println("Hello world");
-</script>
-
+</script>

- The following script uses javascript to create a number of - echo tasks and execute them. + The following script uses JavaScript to create a number of + echo tasks and execute them.

 <project name="squares" default="main" basedir=".">
-
   <target name="main">
-
     <script language="javascript"> <![CDATA[
-
-      for (i=1; i<=10; i++) {
+      for (i = 1; i <= 10; i++) {
         echo = squares.createTask("echo");
         echo.setMessage(i*i);
         echo.perform();
       }
-
     ]]> </script>
-
   </target>
-
-</project>
-
+</project>

generates

 main:
@@ -259,15 +212,13 @@ main:
 81
 100
 
-BUILD SUCCESSFUL
-
+BUILD SUCCESSFUL -

Now a more complex example using the Java API and the Ant API. The goal is to list the -filesizes of all files a <fileset/> caught.

+

Now a more complex example using the Java API and the Ant API. The goal is to list the file sizes +of all files a <fileset/> caught.

-
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<project name="MyProject" basedir="." default="main">
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="MyProject" basedir="." default="main">
 
   <property name="fs.dir" value="src"/>
   <property name="fs.includes" value="**/*.txt"/>
@@ -275,20 +226,19 @@ filesizes of all files a <fileset/> caught.

<target name="main"> <script language="javascript"> <![CDATA[ - // import statements - // importPackage(java.io); - importClass(java.io.File); + // importPackage(java.io); + importClass(java.io.File); // Access to Ant-Properties by their names - dir = project.getProperty("fs.dir"); - includes = MyProject.getProperty("fs.includes"); - excludes = self.getProject().getProperty("fs.excludes"); + dir = project.getProperty("fs.dir"); + includes = MyProject.getProperty("fs.includes"); + excludes = self.getProject().getProperty("fs.excludes"); // Create a <fileset dir="" includes=""/> - fs = project.createDataType("fileset"); - fs.setDir( new File(dir) ); - fs.setIncludes(includes); + fs = project.createDataType("fileset"); + fs.setDir(new File(dir)); + fs.setIncludes(includes); fs.setExcludes(excludes); // Get the files (array) of that fileset @@ -296,49 +246,42 @@ filesizes of all files a <fileset/> caught.

srcFiles = ds.getIncludedFiles(); // iterate over that array - for (i=0; i<srcFiles.length; i++) { + for (i = 0; i < srcFiles.length; i++) { // get the values via Java API var basedir = fs.getDir(project); var filename = srcFiles[i]; - var file = new File(basedir, filename); + var file = new File(basedir, filename); var size = file.length(); // create and use a Task via Ant API - echo = MyProject.createTask("echo"); + echo = MyProject.createTask("echo"); echo.setMessage(filename + ": " + size + " byte"); - echo.perform(); + echo.perform(); } ]]></script> </target> -</project> -
-

We want to use the Java API. Because we don't want always typing the package signature -we do an import. Rhino knows two different methods for import statements: one for packages -and one for a single class. By default only the java packages are available, so -java.lang.System can be directly imported with importClass/importPackage. -For other packages you have to prefix the full classified name with Packages. -For example Ant's FileUtils class can be imported with -importClass(Packages.org.apache.tools.ant.util.FileUtils) -
-The <script> task populates the Project instance under -the name project, so we can use that reference. Another way is to use its given name -or getting its reference from the task itself.
-The Project provides methods for accessing and setting properties, creating DataTypes and -Tasks and much more.
-After creating a FileSet object we initialize that by calling its set-methods. Then we can -use that object like a normal Ant task (<copy> for example).
-For getting the size of a file we instantiate a java.io.File. So we are using -normal Java API here.
-Finally we use the <echo> task for producing the output. The task is not executed by -its execute() method, because the perform() method (implemented in Task itself) does the -appropriate logging before and after invoking execute(). -

-

- Here is an example of using beanshell to create an ant - task. This task will add filesets and paths to a referenced - path. If the path does not exist, it will be created. -

+</project> +

We want to use the Java API. Because we don't want always typing the package signature we do an +import. Rhino knows two different methods for import statements: one for packages and one for a +single class. By default only the java packages are available, +so java.lang.System can be directly imported +with importClass/importPackage. For other packages you have to prefix the full +classified name with Packages. For example Ant's FileUtils class can +be imported +with importClass(Packages.org.apache.tools.ant.util.FileUtils)
+The <script> task populates the Project instance under the +name project, so we can use that reference. Another way is to use its given name or +getting its reference from the task itself.
The Project provides methods for accessing and +setting properties, creating DataTypes and Tasks and much more.
After creating a FileSet object +we initialize that by calling its set-methods. Then we can use that object like a normal Ant task +(<copy> for example).
For getting the size of a file we instantiate +a java.io.File. So we are using normal Java API here.
Finally we use +the <echo> task for producing the output. The task is not executed by +its execute() method, because the perform() method (implemented in Task +itself) does the appropriate logging before and after invoking execute().

+

Here is an example of using beanshell to create an Ant task. This task will add filesets and +paths to a referenced path. If the path does not exist, it will be created.

 <!--
        Define addtopath task
@@ -367,14 +310,10 @@ appropriate logging before and after invoking execute().
         }
     }
     project.addTaskDefinition("addtopath", AddToPath.class);
-</script>
-
-

- An example of using this task to create a path - from a list of directories (using antcontrib's - - <for> task) follows: -

+</script> +

An example of using this task to create a path from a list of directories (using +antcontrib's <for> +task) follows:

 <path id="main.path">
   <fileset dir="build/classes"/>
@@ -387,8 +326,7 @@ appropriate logging before and after invoking execute().
                includes="**/*.jar"/>
     </addtopath>
   </sequential>
-</ac:for>
-
+</ac:for> http://git-wip-us.apache.org/repos/asf/ant/blob/66b52f99/manual/Tasks/scriptdef.html ---------------------------------------------------------------------- diff --git a/manual/Tasks/scriptdef.html b/manual/Tasks/scriptdef.html index 554e04e..0f8292d 100644 --- a/manual/Tasks/scriptdef.html +++ b/manual/Tasks/scriptdef.html @@ -26,318 +26,267 @@

Scriptdef

Description

-

Scriptdef can be used to define an Apache Ant task using a scripting language. Ant -scripting languages supported by -Apache BSF -or - JSR 223 -may be -used to define the script. Scriptdef provides a mechanism to encapsulate -control logic from a build within an Ant task minimizing the need for -providing control style tasks in Ant itself. Complex logic can be made -available while retaining the simple structure of an Ant build file. Scriptdef -is also useful for prototyping new custom tasks. Certainly as the complexity -of the script increases it would be better to migrate the task definition -into a Java based custom task. -

- -

Note: This task depends on external libraries not included in the -Ant distribution. See -Library Dependencies -for more information.

- - +

Scriptdef can be used to define an Apache Ant task using a scripting language. Ant +scripting languages supported by Apache +BSF +or JSR +223 may be used to define the script. Scriptdef provides a mechanism to encapsulate +control logic from a build within an Ant task minimizing the need for providing control style tasks +in Ant itself. Complex logic can be made available while retaining the simple structure of an Ant +build file. Scriptdef is also useful for prototyping new custom tasks. Certainly as the +complexity of the script increases it would be better to migrate the task definition into a Java +based custom task.

+ +

Note: This task depends on external libraries not included in the Ant +distribution. See Library Dependencies for more +information.

The attributes and nested elements supported by the task may be defined using <attribute> and <element> nested elements. These are -available to the script that implements the task as two collection style -script variables attributes and elements. The -elements in the attributes collection may be accessed by the -attribute name. The elements collection is accessed by the nested -element name. This will return a list of all instances of the nested element. -The instances in this list may be accessed by an integer index. -

- -

Note: Ant will turn all attribute and element names into all -lowercase names, so even if you use name="SomeAttribute", you'll have -to use "someattribute" to retrieve the attribute's value from the -attributes collection.

- -

The name "self" (since Ant 1.6.3) is a pre-defined reference to the - script def task instance. - It can be used for logging, or for integration with the rest of - Ant. the self.text attribute contains - any nested text passed to the script

- -

If an attribute or element is not passed in, -then attributes.get() or elements.get() will -return null. It is up to the script to perform any checks and validation. -self.fail(String message)can be used to raise a -BuildException. -

- - -

The name "project" is a pre-defined reference to the Ant Project. For -more information on writing scripts, please refer to the -<script> task -

- +available to the script that implements the task as two collection style script +variables attributes and elements. The elements in +the attributes collection may be accessed by the attribute +name. The elements collection is accessed by the nested element name. This will return +a list of all instances of the nested element. The instances in this list may be accessed by an +integer index.

+ +

Note: Ant will turn all attribute and element names into all lowercase names, so +even if you use name=SomeAttribute, you'll have to use someattribute to +retrieve the attribute's value from the attributes collection.

+ +

The name self (since Ant 1.6.3) is a pre-defined reference to +the scriptdef task instance. It can be used for logging, or for integration with the +rest of Ant. the self.text attribute contains any nested text passed to the script

+ +

If an attribute or element is not passed in, then attributes.get() +or elements.get() will return null. It is up to the script to perform any checks and +validation. self.fail(String message)can be used to raise +a BuildException.

+ +

The name project is a pre-defined reference to the Ant Project. For more information +on writing scripts, please refer to the <script> +task.

Parameters

- +
- - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + + + + + - - - - - - - - -
AttributeDescriptionRequiredAttributeDescriptionRequired
namethe name of the task to be created using the scriptYesnamethe name of the task to be created using the scriptYes
languageThe programming language the script is written in. - Must be a supported Apache BSF or JSR 223 languageYeslanguageThe programming language the script is written in. Must be a supported Apache BSF or JSR + 223 languageYes
manager - The script engine manager to use. - See the script task - for using this attribute. - No - default is "auto"managerThe script engine manager to use. See the script task + for using this attribute.No; default is auto
srcThe location of the script as a file, if not inlineNosrcThe location of the script as a file, if not inlineNo
encodingThe encoding of the script as a file. since Ant 1.10.2.No - defaults to default JVM encodingencodingThe encoding of the script as a file. since Ant 1.10.2.No; defaults to default JVM character encoding
compiledIf true, the script is compiled before the first - evaluation for faster multiple executions, on the condition that the manager is "javax" and the - target engine implements javax.script.Compilable. - Note that the bsf manager may automatically compiles the script. - since Ant 1.10.2.No - defaults to falsecompiledIf true, the script is compiled before the first evaluation for faster multiple executions, + on the condition that the manager is javax and the target engine + implements javax.script.Compilable. Note that the bsf manager may + automatically compile the script. since Ant 1.10.2.No; defaults to false
uri - The XML namespace uri that this definition should live in. - NouriThe XML namespace uri that this definition should live in.No
classpath - The classpath to pass into the script. - NoclasspathThe classpath to pass into the script.No
classpathrefThe classpath to use, given as a reference to a path + defined elsewhere. + No
classpathrefThe classpath to use, given as a - reference to a path defined elsewhere. - No
loaderRefthe name of the loader that is - used to load the script, constructed from the specified - classpath. This allows multiple script definitions - to reuse the same class loader. - No
+ loaderRef + the name of the loader that is used to load the script, constructed from the specified + classpath. This allows multiple script definitions to reuse the same class loader. + + No + +

Nested elements

attribute

- +
- - - + + + - - - + + +
AttributeDescriptionRequiredAttributeDescriptionRequired
namethe name of the attributeYesnamethe name of the attributeYes

element

- +
- - - + + + - - - + + + - - - + + + - - - + + + - - - + + + -
AttributeDescriptionRequiredAttributeDescriptionRequired
namethe name of the nested element to be supported by the - task defined by the scriptYesnamethe name of the nested element to be supported by the task defined by the scriptYes
classnamethe classname of the class to be used for the nested element. - This specifies the class directly and is an alternative to specifying - the Ant type name.Noclassnamethe classname of the class to be used for the nested element. This specifies the class + directly and is an alternative to specifying the Ant type name.No
typeThis is the name of an Ant task or type which is to - be used when this element is to be created. This is an alternative - to specifying the class name directly. If the type is in a namespace, - the URI and a : must be prefixed to the type. For example - type="antlib:example.org:newtype"NotypeThis is the name of an Ant task or type which is to be used when this element is to be + created. This is an alternative to specifying the class name directly. If the type is in a + namespace, the URI and a : must be prefixed to the type. For + example type=antlib:example.org:newtypeNo
any resource or resource collectionSince Ant 1.7.1, this task can load scripts - from any resource supplied as a nested element.Noany resource or resource collectionSince Ant 1.7.1, this task can load scripts from any resource supplied as a nested + element.No
-

classpath

-

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

- +

classpath

+

See the script task for using this nested element.

Examples

-

-The following definition creates a task which supports an attribute called -attr and two nested elements, one being a fileset and the other a path. When -executed, the resulting task logs the value of the attribute and the basedir -of the first fileset. -

+

The following definition creates a task which supports an attribute called attr and +two nested elements, one being a fileset and the other a path. When executed, the resulting task +logs the value of the attribute and the basedir of the first fileset.

-  <scriptdef name="scripttest" language="javascript">
-    <attribute name="attr1"/>
-    <element name="fileset" type="fileset"/>
-    <element name="path" type="path"/>
-    <![CDATA[
-
-      self.log("Hello from script");
-      self.log("Attribute attr1 = " + attributes.get("attr1"));
-      self.log("First fileset basedir = "
-        + elements.get("fileset").get(0).getDir(project));
-
-    ]]>
-  </scriptdef>
-
-  <scripttest attr1="test">
-    <path>
-      <pathelement location="src"/>
-    </path>
-    <fileset dir="src"/>
-    <fileset dir="main"/>
-  </scripttest>
-
- -

-The following variation on the above script lists the number of fileset elements -and iterates through them -

+<scriptdef name="scripttest" language="javascript"> + <attribute name="attr1"/> + <element name="fileset" type="fileset"/> + <element name="path" type="path"/> + <![CDATA[ + + self.log("Hello from script"); + self.log("Attribute attr1 = " + attributes.get("attr1")); + self.log("First fileset basedir = " + + elements.get("fileset").get(0).getDir(project)); + + ]]> +</scriptdef> + +<scripttest attr1="test"> + <path> + <pathelement location="src"/> + </path> + <fileset dir="src"/> + <fileset dir="main"/> +</scripttest> + +

The following variation on the above script lists the number of fileset elements and iterates +through them

-  <scriptdef name="scripttest2" language="javascript">
-    <element name="fileset" type="fileset"/>
-    <![CDATA[
-      filesets = elements.get("fileset");
-      self.log("Number of filesets = " + filesets.size());
-      for (i = 0; i < filesets.size(); ++i) {
-        self.log("fileset " + i + " basedir = "
-          + filesets.get(i).getDir(project));
-      }
-    ]]>
-  </scriptdef>
-
-  <scripttest2>
-    <fileset dir="src"/>
-    <fileset dir="main"/>
-  </scripttest2>
-
- -

-When a script has a syntax error, the scriptdef name will be listed in the -error. For example in the above script, removing the closing curly bracket -would result in this error -

+<scriptdef name="scripttest2" language="javascript"> + <element name="fileset" type="fileset"/> + <![CDATA[ + filesets = elements.get("fileset"); + self.log("Number of filesets = " + filesets.size()); + for (i = 0; i < filesets.size(); ++i) { + self.log("fileset " + i + " basedir = " + + filesets.get(i).getDir(project)); + } + ]]> +</scriptdef> + +<scripttest2> + <fileset dir="src"/> + <fileset dir="main"/> +</scripttest2> + +

When a script has a syntax error, the scriptdef name will be listed in the +error. For example in the above script, removing the closing curly bracket would result in this +error

build.xml:15: SyntaxError: missing } in compound
 statement (scriptdef <scripttest2>; line 10)
-

-Script errors are only detected when a script task is actually executed. -

-

- The next example does uses nested text in Jython. It also declares - the script in a new xml namespace, which must be used to refer to - the task. Declaring scripts in a new namespace guarantees that Ant will - not create a task of the same (namespace,localname) name pair. -

+

Script errors are only detected when a script task is actually executed.

+

The next example does uses nested text in Jython. It also declares the script in a new xml +namespace, which must be used to refer to the task. Declaring scripts in a new namespace guarantees +that Ant will not create a task of the same (namespace,localname) name pair.

 <target name="echo-task-jython">
   <scriptdef language="jython"
-      name="echo"
-      uri="http://example.org/script">
+             name="echo"
+             uri="http://example.org/script">
       <![CDATA[
 self.log("text: " +self.text)
-    ]]>
+      ]]>
     </scriptdef>
 </target>
 
 <target name="testEcho" depends="echo-task-jython"
-    xmlns:s="http://example.org/script">
+        xmlns:s="http://example.org/script">
   <s:echo>nested text</s:echo>
-</target>
-
+</target> -The next example shows the use of <classpath> and -"loaderref" to get access to the beanshell jar. +

The next example shows the use of <classpath> and loaderref to get access to the +beanshell jar.

-    <scriptdef name="b1" language="beanshell"
-               loaderref="beanshell-ref">
-      <attribute name="a"/>
-      <classpath
-        path="${user.home}/scripting/beanshell/bsh-1.3b1.jar"/>
-      self.log("attribute a is " + attributes.get("a"));
-    </scriptdef>
-
-    <scriptdef name="b2" language="beanshell"
-               loaderref="beanshell-ref">
-      <attribute name="a2"/>
-      self.log("attribute a2 is " + attributes.get("a2"));
-    </scriptdef>
+<scriptdef name="b1" language="beanshell"
+           loaderref="beanshell-ref">
+  <attribute name="a"/>
+  <classpath path="${user.home}/scripting/beanshell/bsh-1.3b1.jar"/>
+  self.log("attribute a is " + attributes.get("a"));
+</scriptdef>
+
+<scriptdef name="b2" language="beanshell"
+           loaderref="beanshell-ref">
+  <attribute name="a2"/>
+  self.log("attribute a2 is " + attributes.get("a2"));
+</scriptdef>
+
+<b1 a="this is an 'a'"/>
+<b2 a2="this is an 'a2' for b2"/>
- <b1 a="this is an 'a'"/> - <b2 a2="this is an 'a2' for b2"/> -

Testing Scripts

-

-The easiest way to test scripts is to use the -AntUnit ant library. -This will run all targets in a script that begin with "test" (and their dependencies).

+

The easiest way to test scripts is to use +the AntUnit Ant library. This will run all +targets in a script that begin with test (and their dependencies).

http://git-wip-us.apache.org/repos/asf/ant/blob/66b52f99/manual/Tasks/sequential.html ---------------------------------------------------------------------- diff --git a/manual/Tasks/sequential.html b/manual/Tasks/sequential.html index 3551d60..3d7fc10 100644 --- a/manual/Tasks/sequential.html +++ b/manual/Tasks/sequential.html @@ -26,14 +26,12 @@

Sequential

Description

-

Sequential is a container task - it can contain other Apache Ant tasks. The nested -tasks are simply executed in sequence. Sequential's primary use is to support -the sequential execution of a subset of tasks within the -parallel task

+

Sequential is a container task—it can contain other Apache Ant tasks. The +nested tasks are simply executed in sequence. Sequential's primary use is to support the sequential +execution of a subset of tasks within the parallel task

-

The sequential task has no attributes and does not support any nested -elements apart from Ant tasks. Any valid Ant task may be embedded within the -sequential task.

+

The sequential task has no attributes and does not support any nested elements apart +from Ant tasks. Any valid Ant task may be embedded within the sequential task.

Example

@@ -44,9 +42,8 @@ sequential task.

<junit ... > <wlstop/> </sequential> -</parallel> -
-

This example shows how the sequential task is used to execute three tasks in +</parallel> +

This example shows how the sequential task is used to execute three tasks in sequence, while another task is being executed in a separate thread.