If you use this task to delete temporary files created by editors and it doesn't seem to work, read up on the default exclusion set in Directory-based Tasks , and see the defaultexcludes attribute below. Delete the lib directory, including all files and subdirectories of lib. Delete all files with the extension. Delete the Subversion metadata directories under src.
The file to delete, specified as either the simple filename if the file exists in the current base directory , a relative-path filename, or a full-path filename. The directory to delete, including all its files and subdirectories.
Note : dir is not used to specify a directory name for file ; file and dir are independent of each other. All tasks that use nested elements for PatternSet s, FileSet s, ZipFileSet s or path-like structures accept references to these structures as shown in the examples.
Using refid on a task will ordinarily have the same effect referencing a task already declared , but the user should be aware that the interpretation of this attribute is dependent on the implementation of the element upon which it is specified.
Some tasks the property task is a handy example deliberately assign a different meaning to refid. Ant supports a plugin mechanism for using third party tasks. For using them you have to do two steps:. Use Ant's own mechanisms for adding libraries:. No; however, since Ant 1. This target will always be executed as part of the project's initialization, even when Ant is run with the -projecthelp option.
A relative path is resolved relative to the directory containing the buildfile. No; defaults to the parent directory of the buildfile, unless overridden by the project's basedir or the basedir property.
The name of a file as a single command-line argument; will be replaced with the absolute filename of the file. A string that will be treated as a path-like string as a single command-line argument; you can use ; or : as path separators and Ant will convert it to the platform's local conventions.
Reference to a path defined elsewhere. Ant will convert it to the platform's local conventions. A fixed string to be placed in front of the argument. In the case of a line broken into parts, it will be placed in front of every part. A fixed string to be placed immediately after the argument.
In the case of a line broken into parts, it will be placed after every part. This task, however, has no notion of "changed" files, unlike the javac task. This means all packages will be processed each time this task is run. In general, however, this task is used much less frequently. This task works seamlessly between different javadoc versions 1. NOTE: since javadoc calls System. For this reason, this task always forks the VM. This overhead is not significant since javadoc is normally a heavy application and will be called infrequently.
NOTE: the packagelist attribute allows you to specify the list of packages to document outside of the Ant file. It's a much better practice to include everything inside the build. This option was added in order to make it easier to migrate from regular makefiles, where you would use this option of javadoc. The packages listed in packagelist are not checked, so the task performs even if some packages are missing or broken.
Use this option if you wish to convert from an existing makefile. Once things are running you should then switch to the regular notation. Since this task will be removed in future versions, you are strongly encouraged to use javadoc instead. Create link to javadoc output at the given URL. This performs the same role as the link and linkoffline attributes. You can use either syntax or both at once , but with the nested elements you can easily specify multiple occurrences of the arguments.
Separates packages on the overview page into whatever groups you specify, one group per table. This performs the same role as the group attribute. The doclet nested element is used to specify the doclet that javadoc will use to process the input source files. A number of the standard javadoc arguments are actually arguments of the standard doclet. Such attributes should only be specified, therefore, if they can be interpreted by the doclet in use. These paramaters are restricted to simple strings.
Sends an eMail from me to you with a subject of Results of nightly build and includes the contents of build. Moves a file to a new file or directory, or sets of files to a new directory. By default, the destination file is overwritten if it already exists. When overwrite is turned off, then files are only moved if the source file is newer than the destination file, or when the destination file does not exist.
FileSet s are used to select sets of files to move to the todir directory. Applies a diff file to originals. Parameters Attribute Description Required patchfile the file that includes the diff output Yes originalfile the file to patch No, tries to guess it from the diff file backups Keep backups of the unpatched files No quiet Work silently unless an error occurs No reverse Assume patch was created with old and new files swapped.
No ignorewhitespace Ignore whitespace differences. No strip Strip the smallest prefix containing num leading slashes from filenames. Property Description Sets a property by name and value , or set of properties from file or resource in the project. When a property was set by the user, or was a property in a parent project that started this project with the ant task , then this property cannot be set, and will be ignored.
This means that properties set outside the current project always override the properties of the current project. Although combinations of the three ways are possible, only one should be used at a time.
Problems might occur with the order in which properties are set, for instance. The value part of the properties being set, might contain references to other properties. These references are resolved at the time these properties are set.
This also holds for properties loaded from a property file. This technique is more appropriate for Unix than Windows since the notion of a home directory doesn't exist on Windows.
Different JVM implementations may use other values for the home directory on Windows. Rename Deprecated This task has been deprecated. Use the Move task instead. Renames the file foo. Replace is a directory based task for replacing the occurrence of a given string with another string in selected file.
If either the text you want to replace or the replacement text cross line boundaries, you can use nested elements to specify them. It is possible to refine the set of files that are being rmiced. Rmic 's classpath attribute is a PATH like structure and can also be set via a nested classpath elements. It is possible to refine the set of files that are being tarred. Note that this task does not perform compression.
You might want to use the GZip task to come up with a. Files in the directory mydocs , or files with the name todo. Adds a task definition to the current project, such that this new task can be used in the current project.
Two attributes are needed, the name that identifies this task uniquely, and the full name of the class including the packages that implements this task. Taskdef should be used to add your own tasks to the system.
See also " Writing your own task ". Taskdef 's classpath attribute is a PATH like structure and can also be set via a nested classpath element. The class com. JavadocTask implements the task. For JDK 1. These properties can be used in the buildfile, for instance, to create timestamped filenames or used to replace placeholder tags inside documents to indicate, for example, the release date. The best place for this task is in your initialization target.
Sets a property if a Target file is more up to date than a set of Source files. The value part of the property being set is true if the timestamp of the Target file is more recent than the timestamp of every Source file. Normally, this task is used to set properties that are useful to avoid target execution depending on the relative age of the specified files.
The nested lib element specifies a FileSet. The nested classes element specifies a FileSet. The nested webinf element specifies a FileSet. If this fileset includes a file named web.
MF index. It is possible to refine the set of files that are being zipped. Or, you may place within it nested file sets, or references to file sets. In this case basedir is optional; the implicit file set is only used if basedir is set. The ZIP file will only reflect the relative paths of files within each fileset. If skip the default , the ZIP is not created and a warning is issued. If fail , the ZIP is not created and the build is halted with an error. If create , an empty ZIP file explicitly zero entries is created, which should be recognized as such by compliant ZIP manipulation tools.
Only html files under the directory api are zipped, and files with the name todo. The cab task creates Microsoft cab archive files. It is invoked similar to the jar or zip tasks. This task will only work on Windows, and will be silently ignored on other platforms.
You must have the Microsoft cabarc tool available in your executable path. Files in the directory mydocs, or files with the name todo. Only html files under the directory api are archived, and files with the name todo. Output from the cabarc tool is displayed in the build output.
The ftp task implements a basic FTP client that can send, receive, list, and delete files. See below for descriptions and examples of how to perform each task. The ftp task makes no attempt to determine what file system syntax is required by the remote server, and defaults to Unix standards. If the usual Unix conventions are not supported by the server, separator can be used to set the file separator that should be used instead.
Logs in to ftp. The files are transferred in text mode. Logs in to the Windows-based ftp. Progress messages are displayed as each file is uploaded. Getting files from an FTP server works pretty much the same way as sending them does.
The only difference is that the nested filesets use the remotedir attribute as the base directory for the files on the FTP server, and the dir attribute as the local directory to put the files into. The file structure from the FTP site is preserved on the local machine.
If you don't have permission to delete a file, a BuildException is thrown. The listing is in whatever format the FTP server normally lists files. The source and destination directory will be recursively scanned for NetRexx source files to compile. Only NetRexx files that have no corresponding class file or where the class file is older than the java file will be compiled. Files in the source tree are copied to the destination directory, allowing support files to be located properly in the classpath.
The source files are copied because the NetRexx compiler cannot produce class files in a specific directory via parameters. Renames files in the srcDir directory ending with the fromExtension string so that they end with the toExtension string.
Files are only replaced if replace is true. Execute a script in a BSF supported language. All items tasks, targets, etc of the running project are accessible from the script, using either their name or id attributes. Another example, using references by id and two different scripting languages:. If you specify two or more attributes from version, date and label only one will be used in the order version, date, label. The local files will be writable. For both of these encoding there are illegal byte sequences more in UTF-8 than for Cp How the Reader class deals with these illegal sequences is up to the implementation of the character decoder.
The current Sun Java implementation is to map them to legal characters. Previous Sun Java 1. IBM Java 1. It is the mapping of the characters that cause the corruption. When this is copied with filtering by Ant, the character get converted to a question mark or some such thing.
There is not much that Ant can do. It cannot figure out which files are binary—a UTF-8 version of Korean will have lots of bytes with the top bit set. It is not informed about illegal character sequences by current Sun Java implementations. Another trick is to change the LANG environment variable from something like us.
0コメント